| 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 ScriptPromisePropertyBase_h | 5 #ifndef ScriptPromisePropertyBase_h |
| 6 #define ScriptPromisePropertyBase_h | 6 #define ScriptPromisePropertyBase_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/ScriptPromiseProperties.h" | 10 #include "bindings/core/v8/ScriptPromiseProperties.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 enum State { | 33 enum State { |
| 34 Pending, | 34 Pending, |
| 35 Resolved, | 35 Resolved, |
| 36 Rejected, | 36 Rejected, |
| 37 }; | 37 }; |
| 38 State state() const { return m_state; } | 38 State state() const { return m_state; } |
| 39 | 39 |
| 40 ScriptPromise promise(DOMWrapperWorld&); | 40 ScriptPromise promise(DOMWrapperWorld&); |
| 41 | 41 |
| 42 virtual void trace(Visitor*) { } | |
| 43 | |
| 44 protected: | 42 protected: |
| 45 ScriptPromisePropertyBase(ExecutionContext*, Name); | 43 ScriptPromisePropertyBase(ExecutionContext*, Name); |
| 46 | 44 |
| 47 void resolveOrReject(State targetState); | 45 void resolveOrReject(State targetState); |
| 48 | 46 |
| 49 // ScriptPromiseProperty overrides these to wrap the holder, | 47 // ScriptPromiseProperty overrides these to wrap the holder, |
| 50 // rejected value and resolved value. The | 48 // rejected value and resolved value. The |
| 51 // ScriptPromisePropertyBase caller will enter the V8Context for | 49 // ScriptPromisePropertyBase caller will enter the V8Context for |
| 52 // the property's execution context and the world it is | 50 // the property's execution context and the world it is |
| 53 // creating/settling promises in; the implementation should use | 51 // creating/settling promises in; the implementation should use |
| (...skipping 17 matching lines...) Expand all Loading... |
| 71 v8::Isolate* m_isolate; | 69 v8::Isolate* m_isolate; |
| 72 Name m_name; | 70 Name m_name; |
| 73 State m_state; | 71 State m_state; |
| 74 | 72 |
| 75 WeakPersistentSet m_wrappers; | 73 WeakPersistentSet m_wrappers; |
| 76 }; | 74 }; |
| 77 | 75 |
| 78 } // namespace blink | 76 } // namespace blink |
| 79 | 77 |
| 80 #endif // ScriptPromisePropertyBase_h | 78 #endif // ScriptPromisePropertyBase_h |
| OLD | NEW |