Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(726)

Unified Diff: Source/core/dom/Node.h

Issue 23890025: WIP (Introduce WTF::NonNullPtr<T>.) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/LiveNodeList.cpp ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.h
diff --git a/Source/core/dom/Node.h b/Source/core/dom/Node.h
index 58738dcc8f2720a3a7b149df6ea97f8f570ccea4..0f915b46052dc1c99d41a466fc0b9461eaf2c670 100644
--- a/Source/core/dom/Node.h
+++ b/Source/core/dom/Node.h
@@ -39,6 +39,7 @@
#include "weborigin/KURLHash.h"
#include "wtf/Forward.h"
#include "wtf/ListHashSet.h"
+#include "wtf/NonNullPtr.h"
#include "wtf/text/AtomicString.h"
// This needs to be here because Document.h also depends on it.
@@ -265,7 +266,7 @@ public:
bool isStyledElement() const { return isHTMLElement() || isSVGElement(); }
bool isDocumentNode() const;
- bool isTreeScope() const { return treeScope().rootNode() == this; }
+ bool isTreeScope() const { return treeScope()->rootNode() == this; }
bool isDocumentFragment() const { return getFlag(IsDocumentFragmentFlag); }
bool isShadowRoot() const { return isDocumentFragment() && isTreeScope(); }
bool isInsertionPoint() const { return getFlag(IsInsertionPointFlag); }
@@ -480,7 +481,7 @@ public:
return *documentInternal();
}
- TreeScope& treeScope() const { return *m_treeScope; }
+ NonNullPtr<TreeScope> treeScope() const { return m_treeScope; }
// Returns true if this node is associated with a document and is in its associated document's
// node tree, false otherwise.
@@ -805,7 +806,7 @@ protected:
void setHasCustomStyleCallbacks() { setFlag(true, HasCustomStyleCallbacksFlag); }
- Document* documentInternal() const { return treeScope().documentScope(); }
+ Document* documentInternal() const { return treeScope()->documentScope(); }
void setTreeScope(TreeScope* scope) { m_treeScope = scope; }
private:
« no previous file with comments | « Source/core/dom/LiveNodeList.cpp ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698