Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "config.h" | |
| 6 #include "core/css/invalidation/InvalidationData.h" | |
| 7 | |
| 8 namespace blink { | |
| 9 | |
| 10 InvalidationSet& InvalidationData::ensureInvalidationSet(InvalidateType type) | |
| 11 { | |
| 12 if (!m_invalidationSet[type]) | |
| 13 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
| |
| 14 | |
| 15 return *m_invalidationSet[type]; | |
| 16 } | |
| 17 | |
| 18 void InvalidationData::combine(const InvalidationData& other) | |
| 19 { | |
| 20 if (other.descendants()) | |
| 21 ensureInvalidationSet(InvalidateDescendants).combine(*other.descendants( )); | |
| 22 | |
| 23 if (other.siblings()) | |
| 24 ensureInvalidationSet(InvalidateSiblings).combine(*other.siblings()); | |
| 25 } | |
| 26 | |
| 27 DEFINE_TRACE(InvalidationData) | |
| 28 { | |
| 29 visitor->trace(m_invalidationSet[InvalidateDescendants]); | |
| 30 visitor->trace(m_invalidationSet[InvalidateSiblings]); | |
| 31 } | |
| 32 | |
| 33 } // namespace blink | |
| OLD | NEW |