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

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

Issue 159503003: Do not cause unnecessary node lists invalidation on id/name attribute change (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Code clean up Created 6 years, 10 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
« no previous file with comments | « no previous file | Source/core/dom/Document.cpp » ('j') | Source/core/dom/NodeRareData.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.h
diff --git a/Source/core/dom/Document.h b/Source/core/dom/Document.h
index 4fa870bdcf8ccd59138f293e85766194fe2c40c7..d2c5d8c8e68a1bb9e646363b459eff6d41f3f829 100644
--- a/Source/core/dom/Document.h
+++ b/Source/core/dom/Document.h
@@ -650,6 +650,8 @@ public:
void registerNodeList(LiveNodeListBase*);
void unregisterNodeList(LiveNodeListBase*);
+ void incrementNodeListWithIdNameCacheCount();
+ void decrementNodeListWithIdNameCacheCount();
bool shouldInvalidateNodeListCaches(const QualifiedName* attrName = 0) const;
void invalidateNodeListCaches(const QualifiedName* attrName);
@@ -1377,6 +1379,17 @@ inline bool Document::shouldOverrideLegacyDescription(ViewportDescription::Type
return origin >= m_legacyViewportDescription.type;
}
+inline void Document::incrementNodeListWithIdNameCacheCount()
+{
+ m_nodeListCounts[InvalidateOnIdNameAttrChange]++;
eseidel 2014/02/12 01:55:24 This seems about the same size as just keeping a l
Inactive 2014/02/12 02:21:41 You mean an array of linked lists (whose items wou
+}
+
+inline void Document::decrementNodeListWithIdNameCacheCount()
+{
+ ASSERT(m_nodeListCounts[InvalidateOnIdNameAttrChange] > 0);
Inactive 2014/02/12 02:21:41 You mentioned having good assertions an IRC. There
+ m_nodeListCounts[InvalidateOnIdNameAttrChange]--;
+}
+
DEFINE_TYPE_CASTS(Document, ExecutionContextClient, client, client->isDocument(), client.isDocument());
DEFINE_TYPE_CASTS(Document, ExecutionContext, context, context->isDocument(), context.isDocument());
DEFINE_NODE_TYPE_CASTS(Document, isDocumentNode());
« no previous file with comments | « no previous file | Source/core/dom/Document.cpp » ('j') | Source/core/dom/NodeRareData.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698