| 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/CustomElementReactionStack.h" | 5 #include "core/dom/custom/CustomElementReactionStack.h" |
| 6 | 6 |
| 7 #include "core/dom/Element.h" | 7 #include "core/dom/Element.h" |
| 8 #include "core/dom/custom/CustomElementReactionQueue.h" | 8 #include "core/dom/custom/CustomElementReactionQueue.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 // TODO(dominicc): Consider using linked heap structures, avoiding | 12 // TODO(dominicc): Consider using linked heap structures, avoiding |
| 13 // finalizers, to make short-lived entries fast. | 13 // finalizers, to make short-lived entries fast. |
| 14 | 14 |
| 15 CustomElementReactionStack::CustomElementReactionStack() | 15 CustomElementReactionStack::CustomElementReactionStack() |
| 16 { | 16 { |
| 17 } | 17 } |
| 18 | 18 |
| 19 CustomElementReactionStack::~CustomElementReactionStack() | |
| 20 { | |
| 21 } | |
| 22 | |
| 23 DEFINE_TRACE(CustomElementReactionStack) | 19 DEFINE_TRACE(CustomElementReactionStack) |
| 24 { | 20 { |
| 25 visitor->trace(m_map); | 21 visitor->trace(m_map); |
| 26 visitor->trace(m_stack); | 22 visitor->trace(m_stack); |
| 27 } | 23 } |
| 28 | 24 |
| 29 void CustomElementReactionStack::push() | 25 void CustomElementReactionStack::push() |
| 30 { | 26 { |
| 31 m_stack.append(nullptr); | 27 m_stack.append(nullptr); |
| 32 } | 28 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 58 CustomElementReactionQueue* reactions = m_map.get(element); | 54 CustomElementReactionQueue* reactions = m_map.get(element); |
| 59 if (!reactions) { | 55 if (!reactions) { |
| 60 reactions = new CustomElementReactionQueue(); | 56 reactions = new CustomElementReactionQueue(); |
| 61 m_map.add(element, reactions); | 57 m_map.add(element, reactions); |
| 62 } | 58 } |
| 63 | 59 |
| 64 reactions->add(reaction); | 60 reactions->add(reaction); |
| 65 } | 61 } |
| 66 | 62 |
| 67 } // namespace blink | 63 } // namespace blink |
| OLD | NEW |