Skip to content

Commit

Permalink
Include less from Node.h
Browse files Browse the repository at this point in the history
Node.h is a popular header, so this affects compilation times.

Change-Id: Iea71e63f518885aa7c1552470f75b78a1e29a4cf
Reviewed-on: https://chromium-review.googlesource.com/668370
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502493}
  • Loading branch information
Morten Stenshorne authored and Commit Bot committed Sep 16, 2017
1 parent 352a000 commit cf17243
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 12 deletions.
24 changes: 24 additions & 0 deletions third_party/WebKit/Source/core/dom/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@ Node* Node::insertBefore(Node* new_child,
return nullptr;
}

Node* Node::insertBefore(Node* new_child, Node* ref_child) {
return insertBefore(new_child, ref_child, ASSERT_NO_EXCEPTION);
}

Node* Node::replaceChild(Node* new_child,
Node* old_child,
ExceptionState& exception_state) {
Expand All @@ -456,6 +460,10 @@ Node* Node::replaceChild(Node* new_child,
return nullptr;
}

Node* Node::replaceChild(Node* new_child, Node* old_child) {
return replaceChild(new_child, old_child, ASSERT_NO_EXCEPTION);
}

Node* Node::removeChild(Node* old_child, ExceptionState& exception_state) {
if (IsContainerNode())
return ToContainerNode(this)->RemoveChild(old_child, exception_state);
Expand All @@ -465,6 +473,10 @@ Node* Node::removeChild(Node* old_child, ExceptionState& exception_state) {
return nullptr;
}

Node* Node::removeChild(Node* old_child) {
return removeChild(old_child, ASSERT_NO_EXCEPTION);
}

Node* Node::appendChild(Node* new_child, ExceptionState& exception_state) {
if (IsContainerNode())
return ToContainerNode(this)->AppendChild(new_child, exception_state);
Expand All @@ -474,6 +486,10 @@ Node* Node::appendChild(Node* new_child, ExceptionState& exception_state) {
return nullptr;
}

Node* Node::appendChild(Node* new_child) {
return appendChild(new_child, ASSERT_NO_EXCEPTION);
}

static bool IsNodeInNodes(const Node* const node,
const HeapVector<NodeOrString>& nodes) {
for (const NodeOrString& node_or_string : nodes) {
Expand Down Expand Up @@ -583,6 +599,14 @@ void Node::remove(ExceptionState& exception_state) {
parent->RemoveChild(this, exception_state);
}

void Node::remove() {
remove(ASSERT_NO_EXCEPTION);
}

Node* Node::cloneNode(bool deep) {
return cloneNode(deep, ASSERT_NO_EXCEPTION);
}

void Node::normalize() {
UpdateDistribution();

Expand Down
24 changes: 12 additions & 12 deletions third_party/WebKit/Source/core/dom/Node.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@
#ifndef Node_h
#define Node_h

#include "bindings/core/v8/ExceptionState.h"
#include "core/CoreExport.h"
#include "core/dom/MutationObserver.h"
#include "core/dom/TreeScope.h"
#include "core/dom/events/EventTarget.h"
#include "core/dom/events/SimulatedClickOptions.h"
#include "core/editing/EditingBoundary.h"
#include "core/style/ComputedStyleConstants.h"
#include "platform/bindings/TraceWrapperMember.h"
#include "platform/geometry/LayoutRect.h"
Expand Down Expand Up @@ -238,7 +236,8 @@ class CORE_EXPORT Node : public EventTarget {
void Before(const HeapVector<NodeOrString>&, ExceptionState&);
void After(const HeapVector<NodeOrString>&, ExceptionState&);
void ReplaceWith(const HeapVector<NodeOrString>&, ExceptionState&);
void remove(ExceptionState& = ASSERT_NO_EXCEPTION);
void remove(ExceptionState&);
void remove();

Node* PseudoAwareNextSibling() const;
Node* PseudoAwarePreviousSibling() const;
Expand All @@ -247,17 +246,18 @@ class CORE_EXPORT Node : public EventTarget {

const KURL& baseURI() const;

Node* insertBefore(Node* new_child,
Node* ref_child,
ExceptionState& = ASSERT_NO_EXCEPTION);
Node* replaceChild(Node* new_child,
Node* old_child,
ExceptionState& = ASSERT_NO_EXCEPTION);
Node* removeChild(Node* child, ExceptionState& = ASSERT_NO_EXCEPTION);
Node* appendChild(Node* new_child, ExceptionState& = ASSERT_NO_EXCEPTION);
Node* insertBefore(Node* new_child, Node* ref_child, ExceptionState&);
Node* insertBefore(Node* new_child, Node* ref_child);
Node* replaceChild(Node* new_child, Node* old_child, ExceptionState&);
Node* replaceChild(Node* new_child, Node* old_child);
Node* removeChild(Node* child, ExceptionState&);
Node* removeChild(Node* child);
Node* appendChild(Node* new_child, ExceptionState&);
Node* appendChild(Node* new_child);

bool hasChildren() const { return firstChild(); }
virtual Node* cloneNode(bool deep, ExceptionState& = ASSERT_NO_EXCEPTION) = 0;
virtual Node* cloneNode(bool deep, ExceptionState&) = 0;
Node* cloneNode(bool deep);
void normalize();

bool isEqualNode(Node*) const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "modules/media_capabilities/MediaDecodingConfiguration.h"
#include "modules/media_capabilities/MediaEncodingConfiguration.h"
#include "platform/bindings/ScriptState.h"
#include "platform/bindings/V8ThrowException.h"
#include "platform/network/ParsedContentType.h"
#include "public/platform/Platform.h"
#include "public/platform/WebMediaRecorderHandler.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h"
#include "modules/serviceworkers/ServiceWorkerWindowClient.h"
#include "modules/serviceworkers/ServiceWorkerWindowClientCallback.h"
#include "platform/bindings/V8ThrowException.h"
#include "platform/wtf/PtrUtil.h"
#include "platform/wtf/RefPtr.h"
#include "platform/wtf/Vector.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "modules/serviceworkers/ServiceWorkerError.h"
#include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h"
#include "modules/serviceworkers/ServiceWorkerWindowClientCallback.h"
#include "platform/bindings/V8ThrowException.h"
#include "platform/wtf/RefPtr.h"
#include "public/platform/WebString.h"

Expand Down

0 comments on commit cf17243

Please sign in to comment.