| 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 "bindings/core/v8/Microtask.h" | 7 #include "bindings/core/v8/Microtask.h" |
| 8 #include "core/dom/Element.h" | 8 #include "core/dom/Element.h" |
| 9 #include "core/dom/custom/CEReactionsScope.h" | 9 #include "core/dom/custom/CEReactionsScope.h" |
| 10 #include "core/dom/custom/CustomElementReactionQueue.h" | 10 #include "core/dom/custom/CustomElementReactionQueue.h" |
| 11 #include "core/frame/FrameHost.h" | 11 #include "core/frame/FrameHost.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 Persistent<CustomElementReactionStack>& customElementReactionStack() { | 17 Persistent<CustomElementReactionStack>& customElementReactionStack() { |
| 18 ALLOW_UNSAFE_SINGLETON() |
| 18 DEFINE_STATIC_LOCAL(Persistent<CustomElementReactionStack>, | 19 DEFINE_STATIC_LOCAL(Persistent<CustomElementReactionStack>, |
| 19 customElementReactionStack, | 20 customElementReactionStack, |
| 20 (new CustomElementReactionStack)); | 21 (new CustomElementReactionStack)); |
| 21 return customElementReactionStack; | 22 return customElementReactionStack; |
| 22 } | 23 } |
| 23 | 24 |
| 24 } // namespace | 25 } // namespace |
| 25 | 26 |
| 26 // TODO(dominicc): Consider using linked heap structures, avoiding | 27 // TODO(dominicc): Consider using linked heap structures, avoiding |
| 27 // finalizers, to make short-lived entries fast. | 28 // finalizers, to make short-lived entries fast. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 CustomElementReactionStack* | 122 CustomElementReactionStack* |
| 122 CustomElementReactionStackTestSupport::setCurrentForTest( | 123 CustomElementReactionStackTestSupport::setCurrentForTest( |
| 123 CustomElementReactionStack* newStack) { | 124 CustomElementReactionStack* newStack) { |
| 124 Persistent<CustomElementReactionStack>& stack = customElementReactionStack(); | 125 Persistent<CustomElementReactionStack>& stack = customElementReactionStack(); |
| 125 CustomElementReactionStack* oldStack = stack.get(); | 126 CustomElementReactionStack* oldStack = stack.get(); |
| 126 stack = newStack; | 127 stack = newStack; |
| 127 return oldStack; | 128 return oldStack; |
| 128 } | 129 } |
| 129 | 130 |
| 130 } // namespace blink | 131 } // namespace blink |
| OLD | NEW |