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

Unified Diff: Source/core/css/invalidation/InvalidationData.h

Issue 1317533002: Sibling invalidation sets (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review feedback Created 5 years, 3 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
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

Powered by Google App Engine
This is Rietveld 408576698