| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/dom/custom/CustomElementReaction.h" | 5 #include "core/dom/custom/CustomElementReaction.h" |
| 6 | 6 |
| 7 #include "core/dom/custom/CustomElementReactionQueue.h" | 7 #include "core/dom/custom/CustomElementReactionQueue.h" |
| 8 #include "core/dom/custom/CustomElementReactionStack.h" | 8 #include "core/dom/custom/CustomElementReactionStack.h" |
| 9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 class TestReaction : public CustomElementReaction { | 104 class TestReaction : public CustomElementReaction { |
| 105 WTF_MAKE_NONCOPYABLE(TestReaction); | 105 WTF_MAKE_NONCOPYABLE(TestReaction); |
| 106 | 106 |
| 107 public: | 107 public: |
| 108 TestReaction(std::initializer_list<Command*> commands) | 108 TestReaction(std::initializer_list<Command*> commands) |
| 109 : CustomElementReaction(nullptr) { | 109 : CustomElementReaction(nullptr) { |
| 110 // TODO(dominicc): Simply pass the initializer list when | 110 // TODO(dominicc): Simply pass the initializer list when |
| 111 // HeapVector supports initializer lists like Vector. | 111 // HeapVector supports initializer lists like Vector. |
| 112 for (auto& command : commands) | 112 for (auto& command : commands) |
| 113 m_commands.append(command); | 113 m_commands.push_back(command); |
| 114 } | 114 } |
| 115 ~TestReaction() override = default; | 115 ~TestReaction() override = default; |
| 116 DEFINE_INLINE_VIRTUAL_TRACE() { | 116 DEFINE_INLINE_VIRTUAL_TRACE() { |
| 117 CustomElementReaction::trace(visitor); | 117 CustomElementReaction::trace(visitor); |
| 118 visitor->trace(m_commands); | 118 visitor->trace(m_commands); |
| 119 } | 119 } |
| 120 void invoke(Element* element) override { | 120 void invoke(Element* element) override { |
| 121 for (auto& command : m_commands) | 121 for (auto& command : m_commands) |
| 122 command->run(element); | 122 command->run(element); |
| 123 } | 123 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 142 } | 142 } |
| 143 | 143 |
| 144 CustomElementReactionStack& stack() { return *m_stack; } | 144 CustomElementReactionStack& stack() { return *m_stack; } |
| 145 | 145 |
| 146 private: | 146 private: |
| 147 Member<CustomElementReactionStack> m_stack; | 147 Member<CustomElementReactionStack> m_stack; |
| 148 Member<CustomElementReactionStack> m_oldStack; | 148 Member<CustomElementReactionStack> m_oldStack; |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 } // namespace blink | 151 } // namespace blink |
| OLD | NEW |