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

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

Issue 2191533003: Refactor Timer classes in preparation for landing FrameTimers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More build fixes Created 4 years, 4 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
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/inspector/InspectorInstrumentation.h" 7 #include "core/inspector/InspectorInstrumentation.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // is created in a suspended execution context and the resolver 54 // is created in a suspended execution context and the resolver
55 // is then resolved/rejected while in that suspended state. 55 // is then resolved/rejected while in that suspended state.
56 if (m_state == Detached || m_keepAlive) 56 if (m_state == Detached || m_keepAlive)
57 return; 57 return;
58 58
59 // Keep |this| around while the promise is Pending; 59 // Keep |this| around while the promise is Pending;
60 // see detach() for the dual operation. 60 // see detach() for the dual operation.
61 m_keepAlive = this; 61 m_keepAlive = this;
62 } 62 }
63 63
64 void ScriptPromiseResolver::onTimerFired(Timer<ScriptPromiseResolver>*) 64 void ScriptPromiseResolver::onTimerFired(TimerBase*)
65 { 65 {
66 ASSERT(m_state == Resolving || m_state == Rejecting); 66 ASSERT(m_state == Resolving || m_state == Rejecting);
67 if (!getScriptState()->contextIsValid()) { 67 if (!getScriptState()->contextIsValid()) {
68 detach(); 68 detach();
69 return; 69 return;
70 } 70 }
71 71
72 ScriptState::Scope scope(m_scriptState.get()); 72 ScriptState::Scope scope(m_scriptState.get());
73 resolveOrRejectImmediately(); 73 resolveOrRejectImmediately();
74 } 74 }
(...skipping 13 matching lines...) Expand all
88 } 88 }
89 detach(); 89 detach();
90 } 90 }
91 91
92 DEFINE_TRACE(ScriptPromiseResolver) 92 DEFINE_TRACE(ScriptPromiseResolver)
93 { 93 {
94 ActiveDOMObject::trace(visitor); 94 ActiveDOMObject::trace(visitor);
95 } 95 }
96 96
97 } // namespace blink 97 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698