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 |