Chromium Code Reviews| 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/CEReactionsScope.h" | 5 #include "core/dom/custom/CEReactionsScope.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/dom/Element.h" | 8 #include "core/dom/Element.h" |
| 9 #include "core/dom/custom/CustomElementReactionStack.h" | 9 #include "core/dom/custom/CustomElementReactionStack.h" |
| 10 #include "core/frame/FrameHost.h" | 10 #include "core/frame/FrameHost.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 CEReactionsScope* CEReactionsScope::s_topOfStack = nullptr; | 14 CEReactionsScope* CEReactionsScope::s_topOfStack = nullptr; |
| 15 | 15 |
| 16 void CEReactionsScope::enqueue( | 16 CustomElementReactionStack* CEReactionsScope::currentCustomElementReactionStack( |
| 17 Element* element, | 17 Element* element) |
| 18 CustomElementReaction* reaction) | |
| 19 { | 18 { |
| 20 if (!m_frameHost.get()) { | 19 if (!s_topOfStack) |
|
dominicc (has gone to gerrit)
2016/06/28 03:37:13
I don't like this, because it looks like a getter
kojii
2016/06/28 04:19:04
By moving to CustomElement::enqueue(), this was re
| |
| 21 m_frameHost = element->document().frameHost(); | 20 return nullptr; |
| 22 m_frameHost->customElementReactionStack().push(); | 21 |
| 22 if (!s_topOfStack->m_frameHost.get()) { | |
| 23 s_topOfStack->m_frameHost = element->document().frameHost(); | |
| 24 s_topOfStack->m_frameHost->customElementReactionStack().push(); | |
| 23 } | 25 } |
| 24 m_frameHost->customElementReactionStack().enqueue(element, reaction); | 26 return &s_topOfStack->m_frameHost->customElementReactionStack(); |
| 25 } | 27 } |
| 26 | 28 |
| 27 void CEReactionsScope::invokeReactions() | 29 void CEReactionsScope::invokeReactions() |
| 28 { | 30 { |
| 29 m_frameHost->customElementReactionStack().popInvokingReactions(); | 31 m_frameHost->customElementReactionStack().popInvokingReactions(); |
| 30 } | 32 } |
| 31 | 33 |
| 32 } // namespace blink | 34 } // namespace blink |
| OLD | NEW |