OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef InvalidationData_h |
| 6 #define InvalidationData_h |
| 7 |
| 8 #include "core/css/invalidation/DescendantInvalidationSet.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 enum InvalidateType { |
| 13 InvalidateDescendants = 0, |
| 14 InvalidateSiblings = 1, |
| 15 InvalidateTypeCount = 2 |
| 16 }; |
| 17 |
| 18 class CORE_EXPORT InvalidationData final : public RefCountedWillBeGarbageCollect
ed<InvalidationData> { |
| 19 WTF_MAKE_NONCOPYABLE(InvalidationData); |
| 20 public: |
| 21 static PassRefPtrWillBeRawPtr<InvalidationData> create() |
| 22 { |
| 23 return adoptRefWillBeNoop(new InvalidationData); |
| 24 } |
| 25 |
| 26 void combine(const InvalidationData& other); |
| 27 |
| 28 PassRefPtrWillBeRawPtr<DescendantInvalidationSet> descendants() { return m_i
nvalidationSet[InvalidateDescendants]; } |
| 29 PassRefPtrWillBeRawPtr<DescendantInvalidationSet> siblings() { return m_inva
lidationSet[InvalidateSiblings]; } |
| 30 |
| 31 const DescendantInvalidationSet* descendants() const { return m_invalidation
Set[InvalidateDescendants].get(); } |
| 32 const DescendantInvalidationSet* siblings() const { return m_invalidationSet
[InvalidateSiblings].get(); } |
| 33 |
| 34 PassRefPtrWillBeRawPtr<DescendantInvalidationSet> select(InvalidateType type
) { return m_invalidationSet[type]; } |
| 35 |
| 36 DescendantInvalidationSet& ensureInvalidationSet(InvalidateType); |
| 37 |
| 38 DECLARE_TRACE(); |
| 39 |
| 40 private: |
| 41 InvalidationData() {} |
| 42 |
| 43 RefPtrWillBeMember<DescendantInvalidationSet> m_invalidationSet[InvalidateTy
peCount]; |
| 44 }; |
| 45 |
| 46 } // namespace blink |
| 47 |
| 48 #endif // InvalidationData_h |
OLD | NEW |