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 22 matching lines...) Expand all Loading... |
33 | 33 |
34 enum State { | 34 enum State { |
35 Pending, | 35 Pending, |
36 Resolved, | 36 Resolved, |
37 Rejected, | 37 Rejected, |
38 }; | 38 }; |
39 State state() const { return m_state; } | 39 State state() const { return m_state; } |
40 | 40 |
41 ScriptPromise promise(DOMWrapperWorld&); | 41 ScriptPromise promise(DOMWrapperWorld&); |
42 | 42 |
43 virtual void trace(Visitor*) override; | 43 DECLARE_VIRTUAL_TRACE(); |
44 | 44 |
45 protected: | 45 protected: |
46 ScriptPromisePropertyBase(ExecutionContext*, Name); | 46 ScriptPromisePropertyBase(ExecutionContext*, Name); |
47 | 47 |
48 void resolveOrReject(State targetState); | 48 void resolveOrReject(State targetState); |
49 | 49 |
50 // ScriptPromiseProperty overrides these to wrap the holder, | 50 // ScriptPromiseProperty overrides these to wrap the holder, |
51 // rejected value and resolved value. The | 51 // rejected value and resolved value. The |
52 // ScriptPromisePropertyBase caller will enter the V8Context for | 52 // ScriptPromisePropertyBase caller will enter the V8Context for |
53 // the property's execution context and the world it is | 53 // the property's execution context and the world it is |
(...skipping 18 matching lines...) Expand all Loading... |
72 v8::Isolate* m_isolate; | 72 v8::Isolate* m_isolate; |
73 Name m_name; | 73 Name m_name; |
74 State m_state; | 74 State m_state; |
75 | 75 |
76 WeakPersistentSet m_wrappers; | 76 WeakPersistentSet m_wrappers; |
77 }; | 77 }; |
78 | 78 |
79 } // namespace blink | 79 } // namespace blink |
80 | 80 |
81 #endif // ScriptPromisePropertyBase_h | 81 #endif // ScriptPromisePropertyBase_h |
OLD | NEW |