Chromium Code Reviews| Index: Source/core/animation/InterpolationIsInvalid.h |
| diff --git a/Source/core/animation/InterpolationIsInvalid.h b/Source/core/animation/InterpolationIsInvalid.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..af13d4e709e12c50c638438520ecfd23d0e79e36 |
| --- /dev/null |
| +++ b/Source/core/animation/InterpolationIsInvalid.h |
| @@ -0,0 +1,56 @@ |
| +// 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 InterpolationIsInvalid_h |
| +#define InterpolationIsInvalid_h |
| + |
| +#include "platform/heap/Handle.h" |
| + |
| +namespace blink { |
| + |
| +class StyleResolverState; |
| + |
| +class InterpolationIsInvalid : public RefCountedWillBeGarbageCollectedFinalized<InterpolationIsInvalid> { |
| +public: |
| + virtual ~InterpolationIsInvalid() { } |
| + |
| + bool checkChain(const StyleResolverState& state) |
| + { |
| + return checkSingle(state) || (m_next && m_next->checkChain(state)); |
| + } |
| + |
| + static void chain(RefPtrWillBeRawPtr<InterpolationIsInvalid>& existing, PassRefPtrWillBeRawPtr<InterpolationIsInvalid> extra) |
|
Eric Willigers
2015/05/27 04:26:35
Possibly rename arguments to prefix, suffix
alancutter (OOO until 2018)
2015/05/27 08:27:48
Done.
|
| + { |
| + if (!extra) |
| + return; |
| + if (!existing) |
| + existing = extra; |
| + else if (existing != extra) |
| + existing->chainWith(extra); |
| + } |
| + |
| + DEFINE_INLINE_VIRTUAL_TRACE() |
| + { |
| + visitor->trace(m_next); |
| + } |
| + |
| +protected: |
| + virtual bool checkSingle(const StyleResolverState&) = 0; |
| + |
| +private: |
| + void chainWith(PassRefPtrWillBeRawPtr<InterpolationIsInvalid> extra) |
|
Eric Willigers
2015/05/27 04:26:35
Possibly rename argument to suffix
alancutter (OOO until 2018)
2015/05/27 08:27:48
Done.
|
| + { |
| + ASSERT(extra); |
| + if (!m_next) |
| + m_next = extra; |
| + else if (m_next != extra) |
| + m_next->chainWith(extra); |
|
Eric Willigers
2015/05/27 04:26:35
Explicit while loop instead?
alancutter (OOO until 2018)
2015/05/27 08:27:48
Done.
|
| + } |
| + |
| + RefPtrWillBeMember<InterpolationIsInvalid> m_next; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // InterpolationIsInvalid_h |