Index: Source/core/css/invalidation/InvalidationData.h |
diff --git a/Source/core/css/invalidation/InvalidationData.h b/Source/core/css/invalidation/InvalidationData.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..018802a35602310a60c9ddf48c4234f2908857e1 |
--- /dev/null |
+++ b/Source/core/css/invalidation/InvalidationData.h |
@@ -0,0 +1,48 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef InvalidationData_h |
+#define InvalidationData_h |
+ |
+#include "core/css/invalidation/InvalidationSet.h" |
+ |
+namespace blink { |
+ |
+enum InvalidationType { |
+ InvalidateDescendants = 0, |
rune
2015/09/14 23:06:51
Enums start from 0 if you don't specify. Just drop
Eric Willigers
2015/09/15 05:39:17
Done.
|
+ InvalidateSiblings = 1, |
+ InvalidationTypeCount = 2 |
+}; |
+ |
+class CORE_EXPORT InvalidationData final : public RefCountedWillBeGarbageCollected<InvalidationData> { |
+ WTF_MAKE_NONCOPYABLE(InvalidationData); |
+public: |
+ static PassRefPtrWillBeRawPtr<InvalidationData> create() |
+ { |
+ return adoptRefWillBeNoop(new InvalidationData); |
+ } |
+ |
+ void combine(const InvalidationData& other); |
+ |
+ PassRefPtrWillBeRawPtr<InvalidationSet> descendants() { return m_invalidationSet[InvalidateDescendants]; } |
+ PassRefPtrWillBeRawPtr<InvalidationSet> siblings() { return m_invalidationSet[InvalidateSiblings]; } |
+ |
+ const InvalidationSet* descendants() const { return m_invalidationSet[InvalidateDescendants].get(); } |
+ const InvalidationSet* siblings() const { return m_invalidationSet[InvalidateSiblings].get(); } |
+ |
+ PassRefPtrWillBeRawPtr<InvalidationSet> select(InvalidationType type) { return m_invalidationSet[type]; } |
+ |
+ InvalidationSet& ensureInvalidationSet(InvalidationType); |
+ |
+ DECLARE_TRACE(); |
+ |
+private: |
+ InvalidationData() {} |
+ |
+ RefPtrWillBeMember<InvalidationSet> m_invalidationSet[InvalidationTypeCount]; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // InvalidationData_h |