WebKit Bugzilla
Attachment 343470 Details for
Bug 186982
: Fix the DUMP_NODE_STATISTICS code so that it compiles
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186982-20180624160118.patch (text/plain), 3.74 KB, created by
Simon Fraser (smfr)
on 2018-06-24 16:01:18 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2018-06-24 16:01:18 PDT
Size:
3.74 KB
patch
obsolete
>Subversion Revision: 233132 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8ffb021ad5f848e06fb7849c0c980d8f46447b21..a1d18fd4963a68f263a890c936712bd63e861b97 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2018-06-24 Simon Fraser <simon.fraser@apple.com> >+ >+ Fix the DUMP_NODE_STATISTICS code so that it compiles >+ https://bugs.webkit.org/show_bug.cgi?id=186982 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The DUMP_NODE_STATISTICS code had bitrotted. ENTITY_NODE no longer exists. >+ liveNodeSet needs to be a static function with a NeverDestroyed<>. >+ >+ * dom/Node.cpp: >+ (WebCore::Node::dumpStatistics): >+ (WebCore::Node::trackForDebugging): >+ (WebCore::Node::~Node): >+ > 2018-06-23 Zalan Bujtas <zalan@apple.com> > > [Mail] Use the Mail Viewer width as the base for resolving horizontal viewport units >diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp >index 77364e4cdd5eed1ae8945a8baf7d9f9804a91838..97a2e0cec85734edeba67c133ee0b176c90bc73f 100644 >--- a/Source/WebCore/dom/Node.cpp >+++ b/Source/WebCore/dom/Node.cpp >@@ -86,7 +86,11 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(Node); > using namespace HTMLNames; > > #if DUMP_NODE_STATISTICS >-static HashSet<Node*> liveNodeSet; >+static HashSet<Node*>& liveNodeSet() >+{ >+ static NeverDestroyed<HashSet<Node*>> liveNodes; >+ return liveNodes; >+} > #endif > > void Node::dumpStatistics() >@@ -99,7 +103,6 @@ void Node::dumpStatistics() > size_t textNodes = 0; > size_t cdataNodes = 0; > size_t commentNodes = 0; >- size_t entityNodes = 0; > size_t piNodes = 0; > size_t documentNodes = 0; > size_t docTypeNodes = 0; >@@ -114,7 +117,7 @@ void Node::dumpStatistics() > size_t elementsWithRareData = 0; > size_t elementsWithNamedNodeMap = 0; > >- for (auto* node : liveNodeSet) { >+ for (auto* node : liveNodeSet()) { > if (node->hasRareData()) { > ++nodesWithRareData; > if (is<Element>(*node)) { >@@ -158,18 +161,14 @@ void Node::dumpStatistics() > ++cdataNodes; > break; > } >- case COMMENT_NODE: { >- ++commentNodes; >- break; >- } >- case ENTITY_NODE: { >- ++entityNodes; >- break; >- } > case PROCESSING_INSTRUCTION_NODE: { > ++piNodes; > break; > } >+ case COMMENT_NODE: { >+ ++commentNodes; >+ break; >+ } > case DOCUMENT_NODE: { > ++documentNodes; > break; >@@ -188,7 +187,7 @@ void Node::dumpStatistics() > } > } > >- printf("Number of Nodes: %d\n\n", liveNodeSet.size()); >+ printf("Number of Nodes: %d\n\n", liveNodeSet().size()); > printf("Number of Nodes with RareData: %zu\n\n", nodesWithRareData); > > printf("NodeType distribution:\n"); >@@ -197,7 +196,6 @@ void Node::dumpStatistics() > printf(" Number of Text nodes: %zu\n", textNodes); > printf(" Number of CDATASection nodes: %zu\n", cdataNodes); > printf(" Number of Comment nodes: %zu\n", commentNodes); >- printf(" Number of Entity nodes: %zu\n", entityNodes); > printf(" Number of ProcessingInstruction nodes: %zu\n", piNodes); > printf(" Number of Document nodes: %zu\n", documentNodes); > printf(" Number of DocumentType nodes: %zu\n", docTypeNodes); >@@ -255,7 +253,7 @@ void Node::trackForDebugging() > #endif > > #if DUMP_NODE_STATISTICS >- liveNodeSet.add(this); >+ liveNodeSet().add(this); > #endif > } > >@@ -286,7 +284,7 @@ Node::~Node() > #endif > > #if DUMP_NODE_STATISTICS >- liveNodeSet.remove(this); >+ liveNodeSet().remove(this); > #endif > > RELEASE_ASSERT(!renderer());
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186982
: 343470