Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: Source/core/dom/CustomElementCallbackQueue.cpp

Issue 18167006: Implement Custom Elements' entered and left document callbacks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Feedback. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/CustomElementCallbackQueue.h ('k') | Source/core/dom/CustomElementLifecycleCallbacks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/CustomElementCallbackQueue.cpp
diff --git a/Source/core/dom/CustomElementCallbackQueue.cpp b/Source/core/dom/CustomElementCallbackQueue.cpp
index 168fada2724ef654fdce1915c90937bde969f129..d5641bdb27f6cf157903716cc3eb32a85bf12cd9 100644
--- a/Source/core/dom/CustomElementCallbackQueue.cpp
+++ b/Source/core/dom/CustomElementCallbackQueue.cpp
@@ -35,14 +35,13 @@
namespace WebCore {
-PassOwnPtr<CustomElementCallbackQueue> CustomElementCallbackQueue::create(PassRefPtr<CustomElementLifecycleCallbacks> callbacks, PassRefPtr<Element> element)
+PassOwnPtr<CustomElementCallbackQueue> CustomElementCallbackQueue::create(PassRefPtr<Element> element)
{
- return adoptPtr(new CustomElementCallbackQueue(callbacks, element));
+ return adoptPtr(new CustomElementCallbackQueue(element));
}
-CustomElementCallbackQueue::CustomElementCallbackQueue(PassRefPtr<CustomElementLifecycleCallbacks> callbacks, PassRefPtr<Element> element)
- : m_callbacks(callbacks)
- , m_element(element)
+CustomElementCallbackQueue::CustomElementCallbackQueue(PassRefPtr<Element> element)
+ : m_element(element)
, m_owner(-1)
, m_index(0)
{
@@ -50,11 +49,11 @@ CustomElementCallbackQueue::CustomElementCallbackQueue(PassRefPtr<CustomElementL
void CustomElementCallbackQueue::processInElementQueue(ElementQueue caller)
{
- for (; m_index < m_queue.size() && owner() == caller; m_index++) {
+ while (m_index < m_queue.size() && owner() == caller) {
// dispatch() may cause recursion which steals this callback
// queue and reenters processInQueue. owner() == caller
// detects this recursion and cedes processing.
- m_queue[m_index]->dispatch(m_callbacks.get(), m_element.get());
+ m_queue[m_index++]->dispatch(m_element.get());
}
if (owner() == caller && m_index == m_queue.size()) {
« no previous file with comments | « Source/core/dom/CustomElementCallbackQueue.h ('k') | Source/core/dom/CustomElementLifecycleCallbacks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698