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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // the property's execution context and the world it is | 53 // the property's execution context and the world it is |
54 // creating/settling promises in; the implementation should use | 54 // creating/settling promises in; the implementation should use |
55 // this context. | 55 // this context. |
56 virtual v8::Handle<v8::Object> holder(v8::Handle<v8::Object> creationContext
, v8::Isolate*) = 0; | 56 virtual v8::Handle<v8::Object> holder(v8::Handle<v8::Object> creationContext
, v8::Isolate*) = 0; |
57 virtual v8::Handle<v8::Value> resolvedValue(v8::Isolate*, v8::Handle<v8::Obj
ect> creationContext) = 0; | 57 virtual v8::Handle<v8::Value> resolvedValue(v8::Isolate*, v8::Handle<v8::Obj
ect> creationContext) = 0; |
58 virtual v8::Handle<v8::Value> rejectedValue(v8::Isolate*, v8::Handle<v8::Obj
ect> creationContext) = 0; | 58 virtual v8::Handle<v8::Value> rejectedValue(v8::Isolate*, v8::Handle<v8::Obj
ect> creationContext) = 0; |
59 | 59 |
60 void resetBase(); | 60 void resetBase(); |
61 | 61 |
62 private: | 62 private: |
63 typedef Vector<OwnPtr<ScopedPersistent<v8::Object> > > WeakPersistentSet; | 63 typedef Vector<OwnPtr<ScopedPersistent<v8::Object>>> WeakPersistentSet; |
64 | 64 |
65 void resolveOrRejectInternal(v8::Handle<v8::Promise::Resolver>); | 65 void resolveOrRejectInternal(v8::Handle<v8::Promise::Resolver>); |
66 v8::Local<v8::Object> ensureHolderWrapper(ScriptState*); | 66 v8::Local<v8::Object> ensureHolderWrapper(ScriptState*); |
67 void clearWrappers(); | 67 void clearWrappers(); |
68 | 68 |
69 v8::Handle<v8::String> promiseName(); | 69 v8::Handle<v8::String> promiseName(); |
70 v8::Handle<v8::String> resolverName(); | 70 v8::Handle<v8::String> resolverName(); |
71 | 71 |
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 |