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

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

Issue 1317533002: Sibling invalidation sets (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase 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.cpp
diff --git a/Source/core/css/invalidation/InvalidationData.cpp b/Source/core/css/invalidation/InvalidationData.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..402350644dd784bee2cdb0d8bb1e6e43e3c970bc
--- /dev/null
+++ b/Source/core/css/invalidation/InvalidationData.cpp
@@ -0,0 +1,33 @@
+// 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 {
+
+InvalidationSet& InvalidationData::ensureInvalidationSet(InvalidateType type)
+{
+ if (!m_invalidationSet[type])
+ m_invalidationSet[type] = InvalidationSet::create();
esprehn 2015/09/10 08:54:53 Why do you need dynamic dispatch for the type? Usi
Eric Willigers 2015/09/15 05:39:17 I dispatch on the type to avoid duplicating the Ru
+
+ return *m_invalidationSet[type];
+}
+
+void InvalidationData::combine(const InvalidationData& other)
+{
+ if (other.descendants())
+ ensureInvalidationSet(InvalidateDescendants).combine(*other.descendants());
+
+ if (other.siblings())
+ ensureInvalidationSet(InvalidateSiblings).combine(*other.siblings());
+}
+
+DEFINE_TRACE(InvalidationData)
+{
+ visitor->trace(m_invalidationSet[InvalidateDescendants]);
+ visitor->trace(m_invalidationSet[InvalidateSiblings]);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698