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

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

Issue 16379002: inline WebCore::Node::Node constructor more safely (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 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
Index: Source/core/dom/Node.h
diff --git a/Source/core/dom/Node.h b/Source/core/dom/Node.h
index 65deb0c302124b390b44a39a8b1befa63918256a..33c51fc5e766db6be927fa7145a71631fa0cce69 100644
--- a/Source/core/dom/Node.h
+++ b/Source/core/dom/Node.h
@@ -31,6 +31,7 @@
#include "core/dom/SimulatedClickOptions.h"
#include "core/dom/TreeScope.h"
#include "core/editing/EditingBoundary.h"
+#include "core/inspector/InspectorCounters.h"
#include "core/page/FocusDirection.h"
#include "core/platform/KURLHash.h"
#include "core/platform/TreeShared.h"
@@ -749,7 +750,24 @@ protected:
CreateInsertionPoint = CreateHTMLElement | NeedsShadowTreeWalkerFlag,
CreateEditingText = CreateText | HasNameOrIsEditingTextFlag,
};
- Node(Document*, ConstructionType);
+
+ Node(TreeScope *tree_scope, ConstructionType type)
adamk 2013/06/04 23:08:08 Style: the '*' should be next to the type, and the
Mostyn Bramley-Moore 2013/06/04 23:46:07 Done.
+ : m_nodeFlags(type)
+ , m_parentOrShadowHostNode(0)
+ , m_treeScope(tree_scope)
+ , m_previous(0)
+ , m_next(0)
+ {
+ ScriptWrappable::init(this);
+ if (!m_treeScope)
+ m_treeScope = TreeScope::noDocumentInstance();
adamk 2013/06/04 23:08:08 I think you'll want a TreeScope.h #include in Node
Mostyn Bramley-Moore 2013/06/04 23:46:07 TreeScope.h is already included on line 32.
+ m_treeScope->guardRef();
+
+#if !defined(NDEBUG) || (defined(DUMP_NODE_STATISTICS) && DUMP_NODE_STATISTICS)
+ trackForDebugging();
+#endif
+ InspectorCounters::incrementCounter(InspectorCounters::NodeCounter);
+ }
virtual void didMoveToNewDocument(Document* oldDocument);

Powered by Google App Engine
This is Rietveld 408576698