| Index: third_party/WebKit/Source/core/css/invalidation/InvalidationSet.h
|
| diff --git a/third_party/WebKit/Source/core/css/invalidation/InvalidationSet.h b/third_party/WebKit/Source/core/css/invalidation/InvalidationSet.h
|
| index 44ae6c66c56df90f365a8880388e4e7809e278ad..fc086a94dacb1d8b81a0194555e385da99e5f4b9 100644
|
| --- a/third_party/WebKit/Source/core/css/invalidation/InvalidationSet.h
|
| +++ b/third_party/WebKit/Source/core/css/invalidation/InvalidationSet.h
|
| @@ -56,10 +56,8 @@ enum InvalidationType {
|
| class CORE_EXPORT InvalidationSet : public RefCounted<InvalidationSet> {
|
| WTF_MAKE_NONCOPYABLE(InvalidationSet);
|
| public:
|
| - virtual ~InvalidationSet() {}
|
| -
|
| - virtual bool isDescendantInvalidationSet() const { return false; }
|
| - virtual bool isSiblingInvalidationSet() const { return false; }
|
| + bool isDescendantInvalidationSet() const { return m_type == InvalidateDescendants; }
|
| + bool isSiblingInvalidationSet() const { return m_type == InvalidateSiblings; }
|
|
|
| static void cacheTracingFlag();
|
|
|
| @@ -98,12 +96,21 @@ public:
|
| const HashSet<AtomicString>& tagNameSetForTesting() const { ASSERT(m_tagNames); return *m_tagNames; }
|
| const HashSet<AtomicString>& attributeSetForTesting() const { ASSERT(m_attributes); return *m_attributes; }
|
|
|
| + void deref()
|
| + {
|
| + if (!derefBase())
|
| + return;
|
| + destroy();
|
| + }
|
| +
|
| protected:
|
| - InvalidationSet();
|
| + InvalidationSet(InvalidationType);
|
|
|
| void combine(const InvalidationSet& other);
|
|
|
| private:
|
| + void destroy();
|
| +
|
| HashSet<AtomicString>& ensureClassSet();
|
| HashSet<AtomicString>& ensureIdSet();
|
| HashSet<AtomicString>& ensureTagNameSet();
|
| @@ -115,6 +122,8 @@ private:
|
| OwnPtr<HashSet<AtomicString>> m_tagNames;
|
| OwnPtr<HashSet<AtomicString>> m_attributes;
|
|
|
| + unsigned m_type : 1;
|
| +
|
| // If true, all descendants might be invalidated, so a full subtree recalc is required.
|
| unsigned m_allDescendantsMightBeInvalid : 1;
|
|
|
| @@ -138,15 +147,14 @@ public:
|
| return adoptRef(new DescendantInvalidationSet);
|
| }
|
|
|
| - bool isDescendantInvalidationSet() const final { return true; }
|
| -
|
| void combine(const DescendantInvalidationSet& other)
|
| {
|
| InvalidationSet::combine(other);
|
| }
|
|
|
| private:
|
| - DescendantInvalidationSet() {}
|
| + DescendantInvalidationSet()
|
| + : InvalidationSet(InvalidateDescendants) {}
|
| };
|
|
|
| class CORE_EXPORT SiblingInvalidationSet final : public InvalidationSet {
|
| @@ -156,8 +164,6 @@ public:
|
| return adoptRef(new SiblingInvalidationSet);
|
| }
|
|
|
| - bool isSiblingInvalidationSet() const final { return true; }
|
| -
|
| void combine(const SiblingInvalidationSet& other);
|
|
|
| DescendantInvalidationSet& descendants() { return *m_descendantInvalidationSet; }
|
|
|