OLD | NEW |
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 <v8.h> |
8 #include "bindings/core/v8/ScopedPersistent.h" | 9 #include "bindings/core/v8/ScopedPersistent.h" |
9 #include "bindings/core/v8/ScriptPromise.h" | 10 #include "bindings/core/v8/ScriptPromise.h" |
10 #include "bindings/core/v8/ScriptState.h" | 11 #include "bindings/core/v8/ScriptState.h" |
11 #include "bindings/core/v8/ToV8.h" | 12 #include "bindings/core/v8/ToV8.h" |
12 #include "core/CoreExport.h" | 13 #include "core/CoreExport.h" |
13 #include "core/dom/ExecutionContext.h" | 14 #include "core/dom/ExecutionContext.h" |
14 #include "core/dom/SuspendableObject.h" | 15 #include "core/dom/SuspendableObject.h" |
15 #include "platform/ScriptForbiddenScope.h" | 16 #include "platform/ScriptForbiddenScope.h" |
16 #include "platform/Timer.h" | 17 #include "platform/Timer.h" |
17 #include "platform/heap/Handle.h" | 18 #include "platform/heap/Handle.h" |
18 #include "platform/heap/SelfKeepAlive.h" | 19 #include "platform/heap/SelfKeepAlive.h" |
19 #include <v8.h> | |
20 | 20 |
21 namespace blink { | 21 namespace blink { |
22 | 22 |
23 // This class wraps v8::Promise::Resolver and provides the following | 23 // This class wraps v8::Promise::Resolver and provides the following |
24 // functionalities. | 24 // functionalities. |
25 // - A ScriptPromiseResolver retains a ScriptState. A caller | 25 // - A ScriptPromiseResolver retains a ScriptState. A caller |
26 // can call resolve or reject from outside of a V8 context. | 26 // can call resolve or reject from outside of a V8 context. |
27 // - This class is an SuspendableObject and keeps track of the associated | 27 // - This class is an SuspendableObject and keeps track of the associated |
28 // ExecutionContext state. When the ExecutionContext is suspended, | 28 // ExecutionContext state. When the ExecutionContext is suspended, |
29 // resolve or reject will be delayed. When it is stopped, resolve or reject | 29 // resolve or reject will be delayed. When it is stopped, resolve or reject |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 #if DCHECK_IS_ON() | 174 #if DCHECK_IS_ON() |
175 // True if promise() is called. | 175 // True if promise() is called. |
176 bool m_isPromiseCalled = false; | 176 bool m_isPromiseCalled = false; |
177 #endif | 177 #endif |
178 }; | 178 }; |
179 | 179 |
180 } // namespace blink | 180 } // namespace blink |
181 | 181 |
182 #endif // ScriptPromiseResolver_h | 182 #endif // ScriptPromiseResolver_h |
OLD | NEW |