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

Side by Side Diff: Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp

Issue 242123005: Allow posting a Task to Microtasks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: changes made Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/MutationObserver.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "config.h" 5 #include "config.h"
6 #include "core/dom/custom/CustomElementMicrotaskDispatcher.h" 6 #include "core/dom/custom/CustomElementMicrotaskDispatcher.h"
7 7
8 #include "core/dom/Microtask.h" 8 #include "core/dom/Microtask.h"
9 #include "core/dom/custom/CustomElementCallbackDispatcher.h" 9 #include "core/dom/custom/CustomElementCallbackDispatcher.h"
10 #include "core/dom/custom/CustomElementCallbackQueue.h" 10 #include "core/dom/custom/CustomElementCallbackQueue.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 void CustomElementMicrotaskDispatcher::importDidFinish(CustomElementMicrotaskImp ortStep* step) 50 void CustomElementMicrotaskDispatcher::importDidFinish(CustomElementMicrotaskImp ortStep* step)
51 { 51 {
52 ASSERT(m_phase == Quiescent || m_phase == DispatchingCallbacks); 52 ASSERT(m_phase == Quiescent || m_phase == DispatchingCallbacks);
53 ensureMicrotaskScheduled(); 53 ensureMicrotaskScheduled();
54 } 54 }
55 55
56 void CustomElementMicrotaskDispatcher::ensureMicrotaskScheduled() 56 void CustomElementMicrotaskDispatcher::ensureMicrotaskScheduled()
57 { 57 {
58 if (!m_hasScheduledMicrotask) { 58 if (!m_hasScheduledMicrotask) {
59 Microtask::enqueueMicrotask(&dispatch); 59 Microtask::enqueueMicrotask(WTF::bind(&dispatch));
60 m_hasScheduledMicrotask = true; 60 m_hasScheduledMicrotask = true;
61 } 61 }
62 } 62 }
63 63
64 void CustomElementMicrotaskDispatcher::dispatch() 64 void CustomElementMicrotaskDispatcher::dispatch()
65 { 65 {
66 instance().doDispatch(); 66 instance().doDispatch();
67 } 67 }
68 68
69 void CustomElementMicrotaskDispatcher::doDispatch() 69 void CustomElementMicrotaskDispatcher::doDispatch()
(...skipping 17 matching lines...) Expand all
87 CustomElementCallbackDispatcher::CallbackDeliveryScope scope; 87 CustomElementCallbackDispatcher::CallbackDeliveryScope scope;
88 (*it)->processInElementQueue(kMicrotaskQueueId); 88 (*it)->processInElementQueue(kMicrotaskQueueId);
89 } 89 }
90 90
91 m_elements.clear(); 91 m_elements.clear();
92 CustomElementScheduler::microtaskDispatcherDidFinish(); 92 CustomElementScheduler::microtaskDispatcherDidFinish();
93 m_phase = Quiescent; 93 m_phase = Quiescent;
94 } 94 }
95 95
96 } // namespace WebCore 96 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/MutationObserver.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698