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

Unified Diff: third_party/WebKit/Source/core/css/invalidation/InvalidationData.cpp

Issue 1317533002: Sibling invalidation sets (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Oilpan Created 5 years, 2 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: third_party/WebKit/Source/core/css/invalidation/InvalidationData.cpp
diff --git a/third_party/WebKit/Source/core/css/invalidation/InvalidationData.cpp b/third_party/WebKit/Source/core/css/invalidation/InvalidationData.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..630233dec68815a0ac13143639930ae05fd1f76a
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/invalidation/InvalidationData.cpp
@@ -0,0 +1,43 @@
+// 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.
+
+#include "config.h"
+#include "core/css/invalidation/InvalidationData.h"
+
+namespace blink {
+
+DescendantInvalidationSet& InvalidationData::ensureDescendantInvalidationSet()
+{
+ if (!m_descendants)
+ m_descendants = DescendantInvalidationSet::create();
+ return *m_descendants;
+}
+
+SiblingInvalidationSet& InvalidationData::ensureSiblingInvalidationSet()
+{
+ if (!m_siblings)
+ m_siblings = SiblingInvalidationSet::create();
+ return *m_siblings;
+}
+
+InvalidationSet& InvalidationData::ensureInvalidationSet(InvalidationType type)
+{
+ if (type == InvalidateDescendants)
+ return ensureDescendantInvalidationSet();
+
+ return ensureSiblingInvalidationSet();
+}
+
+void InvalidationData::combine(const InvalidationData& other)
+{
+ if (other.descendants()) {
+ ensureDescendantInvalidationSet().combine(*other.descendants());
+ }
+
+ if (other.siblings()) {
+ ensureSiblingInvalidationSet().combine(*other.siblings());
+ }
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698