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 "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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 { | 70 { |
71 #if ENABLE(ASSERT) | 71 #if ENABLE(ASSERT) |
72 m_isPromiseCalled = true; | 72 m_isPromiseCalled = true; |
73 #endif | 73 #endif |
74 return m_resolver.promise(); | 74 return m_resolver.promise(); |
75 } | 75 } |
76 | 76 |
77 ScriptState* scriptState() const { return m_scriptState.get(); } | 77 ScriptState* scriptState() const { return m_scriptState.get(); } |
78 | 78 |
79 // ActiveDOMObject implementation. | 79 // ActiveDOMObject implementation. |
80 virtual void suspend() OVERRIDE; | 80 virtual void suspend() override; |
81 virtual void resume() OVERRIDE; | 81 virtual void resume() override; |
82 virtual void stop() OVERRIDE; | 82 virtual void stop() override; |
83 | 83 |
84 // Once this function is called this resolver stays alive while the | 84 // Once this function is called this resolver stays alive while the |
85 // promise is pending and the associated ExecutionContext isn't stopped. | 85 // promise is pending and the associated ExecutionContext isn't stopped. |
86 void keepAliveWhilePending(); | 86 void keepAliveWhilePending(); |
87 | 87 |
88 protected: | 88 protected: |
89 // You need to call suspendIfNeeded after the construction because | 89 // You need to call suspendIfNeeded after the construction because |
90 // this is an ActiveDOMObject. | 90 // this is an ActiveDOMObject. |
91 explicit ScriptPromiseResolver(ScriptState*); | 91 explicit ScriptPromiseResolver(ScriptState*); |
92 | 92 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 ScopedPersistent<v8::Value> m_value; | 138 ScopedPersistent<v8::Value> m_value; |
139 #if ENABLE(ASSERT) | 139 #if ENABLE(ASSERT) |
140 // True if promise() is called. | 140 // True if promise() is called. |
141 bool m_isPromiseCalled; | 141 bool m_isPromiseCalled; |
142 #endif | 142 #endif |
143 }; | 143 }; |
144 | 144 |
145 } // namespace blink | 145 } // namespace blink |
146 | 146 |
147 #endif // #ifndef ScriptPromiseResolver_h | 147 #endif // #ifndef ScriptPromiseResolver_h |
OLD | NEW |