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

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

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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.cpp » ('j') | 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 #ifndef ScriptPromiseResolver_h 5 #ifndef ScriptPromiseResolver_h
6 #define ScriptPromiseResolver_h 6 #define ScriptPromiseResolver_h
7 7
8 #include "bindings/core/v8/ScopedPersistent.h" 8 #include "bindings/core/v8/ScopedPersistent.h"
9 #include "bindings/core/v8/ScriptPromise.h" 9 #include "bindings/core/v8/ScriptPromise.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 if (getExecutionContext()->activeDOMObjectsAreSuspended()) { 132 if (getExecutionContext()->activeDOMObjectsAreSuspended()) {
133 // Retain this object until it is actually resolved or rejected. 133 // Retain this object until it is actually resolved or rejected.
134 keepAliveWhilePending(); 134 keepAliveWhilePending();
135 return; 135 return;
136 } 136 }
137 resolveOrRejectImmediately(); 137 resolveOrRejectImmediately();
138 } 138 }
139 139
140 void resolveOrRejectImmediately(); 140 void resolveOrRejectImmediately();
141 void onTimerFired(Timer<ScriptPromiseResolver>*); 141 void onTimerFired(TimerBase*);
142 142
143 ResolutionState m_state; 143 ResolutionState m_state;
144 const RefPtr<ScriptState> m_scriptState; 144 const RefPtr<ScriptState> m_scriptState;
145 Timer<ScriptPromiseResolver> m_timer; 145 Timer<ScriptPromiseResolver> m_timer;
146 Resolver m_resolver; 146 Resolver m_resolver;
147 ScopedPersistent<v8::Value> m_value; 147 ScopedPersistent<v8::Value> m_value;
148 148
149 // To support keepAliveWhilePending(), this object needs to keep itself 149 // To support keepAliveWhilePending(), this object needs to keep itself
150 // alive while in that state. 150 // alive while in that state.
151 SelfKeepAlive<ScriptPromiseResolver> m_keepAlive; 151 SelfKeepAlive<ScriptPromiseResolver> m_keepAlive;
152 152
153 #if ENABLE(ASSERT) 153 #if ENABLE(ASSERT)
154 // True if promise() is called. 154 // True if promise() is called.
155 bool m_isPromiseCalled; 155 bool m_isPromiseCalled;
156 #endif 156 #endif
157 }; 157 };
158 158
159 } // namespace blink 159 } // namespace blink
160 160
161 #endif // ScriptPromiseResolver_h 161 #endif // ScriptPromiseResolver_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698