| Index: Source/core/dom/Document.cpp
|
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
|
| index 81aa69ba996a4db5ccb37b13f4002a1691fb8629..4328dd7de63043a109573ea84f23ff14c72a3c53 100644
|
| --- a/Source/core/dom/Document.cpp
|
| +++ b/Source/core/dom/Document.cpp
|
| @@ -336,14 +336,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 {
|
| @@ -481,9 +478,7 @@ Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC
|
| // ignoring the defersLoading flag.
|
| ASSERT(!parentDocument() || !parentDocument()->activeDOMObjectsAreSuspended());
|
|
|
| -#ifndef NDEBUG
|
| liveDocumentSet().add(this);
|
| -#endif
|
| }
|
|
|
| Document::~Document()
|
| @@ -544,10 +539,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);
|
| }
|
| @@ -5789,7 +5782,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());
|
|
|