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

Unified Diff: Source/core/css/analyzer/DescendantInvalidationSet.h

Issue 177653003: Free HashSets on setWholeSubtreeInvalid. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 | « Source/core/core.gypi ('k') | Source/core/css/analyzer/DescendantInvalidationSet.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/analyzer/DescendantInvalidationSet.h
diff --git a/Source/core/css/analyzer/DescendantInvalidationSet.h b/Source/core/css/analyzer/DescendantInvalidationSet.h
index d2ba761d601cf0808863f8e2748750eabd86318a..40751446deed846ec1b4f2b0e2e89d4d6638da27 100644
--- a/Source/core/css/analyzer/DescendantInvalidationSet.h
+++ b/Source/core/css/analyzer/DescendantInvalidationSet.h
@@ -58,10 +58,10 @@ public:
void addTagName(const AtomicString& tagName);
// Appends the classes in this DescendantInvalidationSet to the vector.
- void getClasses(Vector<AtomicString>& classes);
+ void getClasses(Vector<AtomicString>& classes) const;
- void setWholeSubtreeInvalid() { m_allDescendantsMightBeInvalid = true; };
- bool wholeSubtreeInvalid() { return m_allDescendantsMightBeInvalid; }
+ void setWholeSubtreeInvalid();
+ bool wholeSubtreeInvalid() const { return m_allDescendantsMightBeInvalid; }
private:
DescendantInvalidationSet();
@@ -69,7 +69,6 @@ private:
HashSet<AtomicString>& ensureIdSet();
HashSet<AtomicString>& ensureTagNameSet();
- bool invalidateElementSubtreeInternal(Element*);
// If true, all descendants might be invalidated, so a full subtree recalc is required.
bool m_allDescendantsMightBeInvalid;
@@ -79,6 +78,17 @@ private:
OwnPtr<HashSet<AtomicString> > m_tagNames;
};
+inline void DescendantInvalidationSet::setWholeSubtreeInvalid()
ojan 2014/02/25 00:30:53 Did you actually see performance difference in mak
rune 2014/02/25 08:36:17 https://codereview.chromium.org/179483002/
+{
+ if (m_allDescendantsMightBeInvalid)
+ return;
+
+ m_allDescendantsMightBeInvalid = true;
+ m_classes = nullptr;
+ m_ids = nullptr;
+ m_tagNames = nullptr;
+}
+
} // namespace WebCore
#endif // DescendantInvalidationSet_h
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/css/analyzer/DescendantInvalidationSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698