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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.cpp

Issue 2612523002: Move bindings timers to frame-specific task runners. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h ('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 "bindings/core/v8/ScriptPromiseResolver.h" 5 #include "bindings/core/v8/ScriptPromiseResolver.h"
6 6
7 #include "core/dom/TaskRunnerHelper.h"
7 #include "core/inspector/InspectorInstrumentation.h" 8 #include "core/inspector/InspectorInstrumentation.h"
8 9
9 namespace blink { 10 namespace blink {
10 11
11 ScriptPromiseResolver::ScriptPromiseResolver(ScriptState* scriptState) 12 ScriptPromiseResolver::ScriptPromiseResolver(ScriptState* scriptState)
12 : SuspendableObject(scriptState->getExecutionContext()), 13 : SuspendableObject(scriptState->getExecutionContext()),
13 m_state(Pending), 14 m_state(Pending),
14 m_scriptState(scriptState), 15 m_scriptState(scriptState),
15 m_timer(this, &ScriptPromiseResolver::onTimerFired), 16 m_timer(TaskRunnerHelper::get(TaskType::Microtask, getExecutionContext()),
17 this,
18 &ScriptPromiseResolver::onTimerFired),
16 m_resolver(scriptState) 19 m_resolver(scriptState)
17 #if ENABLE(ASSERT) 20 #if ENABLE(ASSERT)
18 , 21 ,
19 m_isPromiseCalled(false) 22 m_isPromiseCalled(false)
20 #endif 23 #endif
21 { 24 {
22 if (getExecutionContext()->isContextDestroyed()) { 25 if (getExecutionContext()->isContextDestroyed()) {
23 m_state = Detached; 26 m_state = Detached;
24 m_resolver.clear(); 27 m_resolver.clear();
25 } 28 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 86 }
84 } 87 }
85 detach(); 88 detach();
86 } 89 }
87 90
88 DEFINE_TRACE(ScriptPromiseResolver) { 91 DEFINE_TRACE(ScriptPromiseResolver) {
89 SuspendableObject::trace(visitor); 92 SuspendableObject::trace(visitor);
90 } 93 }
91 94
92 } // namespace blink 95 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698