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

Unified Diff: Source/core/css/SelectorFilter.h

Issue 422143005: Oilpan: Move SelectorFilter to oilpan's heap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/css/SelectorFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/SelectorFilter.h
diff --git a/Source/core/css/SelectorFilter.h b/Source/core/css/SelectorFilter.h
index 15bfa0c698acc895ea0cf8882cc1e23e027b1ac6..b475bc09eaaf119ca1e3eda8849dbf66947bb681 100644
--- a/Source/core/css/SelectorFilter.h
+++ b/Source/core/css/SelectorFilter.h
@@ -38,7 +38,20 @@ namespace blink {
class CSSSelector;
class SelectorFilter {
+ DISALLOW_ALLOCATION();
public:
+ class ParentStackFrame {
+ ALLOW_ONLY_INLINE_ALLOCATION();
+ public:
+ ParentStackFrame() : element(nullptr) { }
+ explicit ParentStackFrame(Element& element) : element(&element) { }
+
+ void trace(Visitor*);
+
+ RawPtrWillBeMember<Element> element;
+ Vector<unsigned, 4> identifierHashes;
+ };
+
void pushParentStackFrame(Element& parent);
void popParentStackFrame();
@@ -52,14 +65,10 @@ public:
inline bool fastRejectSelector(const unsigned* identifierHashes) const;
static void collectIdentifierHashes(const CSSSelector&, unsigned* identifierHashes, unsigned maximumIdentifierCount);
+ void trace(Visitor*);
+
private:
- struct ParentStackFrame {
- ParentStackFrame() : element(0) { }
- ParentStackFrame(Element& element) : element(&element) { }
- Element* element;
- Vector<unsigned, 4> identifierHashes;
- };
- Vector<ParentStackFrame> m_parentStack;
+ WillBeHeapVector<ParentStackFrame> m_parentStack;
// With 100 unique strings in the filter, 2^12 slot table has false positive rate of ~0.2%.
static const unsigned bloomFilterKeyBits = 12;
@@ -79,4 +88,6 @@ inline bool SelectorFilter::fastRejectSelector(const unsigned* identifierHashes)
}
+WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::SelectorFilter::ParentStackFrame);
+
#endif
« no previous file with comments | « no previous file | Source/core/css/SelectorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698