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

Unified Diff: Source/core/dom/Document.cpp

Issue 1252683003: Oilpan: Schedule a precise GC when a page navigates (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: WIP Created 5 years, 5 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/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 8668dd20dee17af73c1de393abae62a90f05e65d..daab4c30c1f126968f794b2d53384363bccc905c 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -601,6 +601,16 @@ void Document::dispose()
}
#endif
+unsigned Document::nodeCount() const
+{
+ unsigned count = 0;
+ for (Node& node : NodeTraversal::inclusiveDescendantsOf(*this)) {
+ ASSERT_UNUSED(node, &node);
+ count++;
+ }
+ return count;
+}
+
SelectorQueryCache& Document::selectorQueryCache()
{
if (!m_selectorQueryCache)

Powered by Google App Engine
This is Rietveld 408576698