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

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: Created 5 years, 4 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 dd4c9cc3aab3c26ae2f472f09c5f5ff59ce7aa5f..464b0d29488a56f7bd1be5dd31aa6ebe2325b1a0 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -335,14 +335,11 @@ static bool acceptsEditingFocus(const Element& element)
uint64_t Document::s_globalTreeVersion = 0;
-#ifndef NDEBUG
-using WeakDocumentSet = WillBeHeapHashSet<RawPtrWillBeWeakMember<Document>>;
-static WeakDocumentSet& liveDocumentSet()
+Document::WeakDocumentSet& Document::liveDocumentSet()
{
DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WeakDocumentSet>, set, (adoptPtrWillBeNoop(new WeakDocumentSet())));
return *set;
}
-#endif
// This class doesn't work with non-Document ExecutionContext.
class AutofocusTask final : public ExecutionContextTask {
@@ -480,9 +477,7 @@ Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC
// ignoring the defersLoading flag.
ASSERT(!parentDocument() || !parentDocument()->activeDOMObjectsAreSuspended());
-#ifndef NDEBUG
liveDocumentSet().add(this);
-#endif
}
Document::~Document()
@@ -543,10 +538,8 @@ Document::~Document()
for (unsigned i = 0; i < WTF_ARRAY_LENGTH(m_nodeListCounts); ++i)
ASSERT(!m_nodeListCounts[i]);
-#ifndef NDEBUG
liveDocumentSet().remove(this);
#endif
-#endif
InstanceCounters::decrementCounter(InstanceCounters::DocumentCounter);
}
@@ -5781,7 +5774,7 @@ template class CORE_TEMPLATE_EXPORT WillBeHeapSupplement<Document>;
using namespace blink;
void showLiveDocumentInstances()
{
- WeakDocumentSet& set = liveDocumentSet();
+ Document::WeakDocumentSet& set = Document::liveDocumentSet();
fprintf(stderr, "There are %u documents currently alive:\n", set.size());
for (Document* document : set)
fprintf(stderr, "- Document %p URL: %s\n", document, document->url().string().utf8().data());
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Element.h » ('j') | Source/core/dom/Element.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698