| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 PromiseRejectionEvent_h | 5 #ifndef PromiseRejectionEvent_h |
| 6 #define PromiseRejectionEvent_h | 6 #define PromiseRejectionEvent_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/DOMWrapperWorld.h" | 8 #include "bindings/core/v8/DOMWrapperWorld.h" |
| 9 #include "bindings/core/v8/ScopedPersistent.h" | 9 #include "bindings/core/v8/ScopedPersistent.h" |
| 10 #include "bindings/core/v8/ScriptPromise.h" | 10 #include "bindings/core/v8/ScriptPromise.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 return adoptRefWillBeNoop(new PromiseRejectionEvent); | 24 return adoptRefWillBeNoop(new PromiseRejectionEvent); |
| 25 } | 25 } |
| 26 static PassRefPtrWillBeRawPtr<PromiseRejectionEvent> create(ScriptState* sta
te, const AtomicString& type, const PromiseRejectionEventInit& initializer) | 26 static PassRefPtrWillBeRawPtr<PromiseRejectionEvent> create(ScriptState* sta
te, const AtomicString& type, const PromiseRejectionEventInit& initializer) |
| 27 { | 27 { |
| 28 return adoptRefWillBeNoop(new PromiseRejectionEvent(state, type, initial
izer)); | 28 return adoptRefWillBeNoop(new PromiseRejectionEvent(state, type, initial
izer)); |
| 29 } | 29 } |
| 30 | 30 |
| 31 ScriptValue reason(ScriptState*) const; | 31 ScriptValue reason(ScriptState*) const; |
| 32 ScriptPromise promise(ScriptState*) const; | 32 ScriptPromise promise(ScriptState*) const; |
| 33 | 33 |
| 34 void setWrapperReference(v8::Isolate*, const v8::Persistent<v8::Object>&); |
| 35 |
| 34 virtual const AtomicString& interfaceName() const override; | 36 virtual const AtomicString& interfaceName() const override; |
| 35 | 37 |
| 36 // PromiseRejectionEvents are similar to ErrorEvents in that they can't be | 38 // PromiseRejectionEvents are similar to ErrorEvents in that they can't be |
| 37 // observed across different worlds. | 39 // observed across different worlds. |
| 38 virtual bool canBeDispatchedInWorld(const DOMWrapperWorld&) const override; | 40 virtual bool canBeDispatchedInWorld(const DOMWrapperWorld&) const override; |
| 39 | 41 |
| 40 DECLARE_VIRTUAL_TRACE(); | 42 DECLARE_VIRTUAL_TRACE(); |
| 41 | 43 |
| 42 private: | 44 private: |
| 43 PromiseRejectionEvent(); | 45 PromiseRejectionEvent(); |
| 44 PromiseRejectionEvent(ScriptState*, const AtomicString&, const PromiseReject
ionEventInit&); | 46 PromiseRejectionEvent(ScriptState*, const AtomicString&, const PromiseReject
ionEventInit&); |
| 45 ~PromiseRejectionEvent() override; | 47 ~PromiseRejectionEvent() override; |
| 46 | 48 |
| 47 static void didCollectPromise(const v8::WeakCallbackInfo<PromiseRejectionEve
nt>&); | 49 static void didCollectPromise(const v8::WeakCallbackInfo<PromiseRejectionEve
nt>&); |
| 48 static void didCollectReason(const v8::WeakCallbackInfo<PromiseRejectionEven
t>&); | 50 static void didCollectReason(const v8::WeakCallbackInfo<PromiseRejectionEven
t>&); |
| 49 | 51 |
| 50 RefPtr<ScriptState> m_scriptState; | 52 RefPtr<ScriptState> m_scriptState; |
| 51 ScopedPersistent<v8::Value> m_promise; | 53 ScopedPersistent<v8::Value> m_promise; |
| 52 ScopedPersistent<v8::Value> m_reason; | 54 ScopedPersistent<v8::Value> m_reason; |
| 53 }; | 55 }; |
| 54 | 56 |
| 55 } // namespace blink | 57 } // namespace blink |
| 56 | 58 |
| 57 #endif // PromiseRejectionEvent_h | 59 #endif // PromiseRejectionEvent_h |
| OLD | NEW |