| 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/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
| 10 #include "bindings/core/v8/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 static PromiseRejectionEvent* create( | 24 static PromiseRejectionEvent* create( |
| 25 ScriptState* state, | 25 ScriptState* state, |
| 26 const AtomicString& type, | 26 const AtomicString& type, |
| 27 const PromiseRejectionEventInit& initializer) { | 27 const PromiseRejectionEventInit& initializer) { |
| 28 return new PromiseRejectionEvent(state, type, initializer); | 28 return new PromiseRejectionEvent(state, type, initializer); |
| 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 | |
| 36 const AtomicString& interfaceName() const override; | 34 const AtomicString& interfaceName() const override; |
| 37 | 35 |
| 38 // PromiseRejectionEvents are similar to ErrorEvents in that they can't be | 36 // PromiseRejectionEvents are similar to ErrorEvents in that they can't be |
| 39 // observed across different worlds. | 37 // observed across different worlds. |
| 40 bool canBeDispatchedInWorld(const DOMWrapperWorld&) const override; | 38 bool canBeDispatchedInWorld(const DOMWrapperWorld&) const override; |
| 41 | 39 |
| 42 DECLARE_VIRTUAL_TRACE(); | 40 DECLARE_VIRTUAL_TRACE(); |
| 43 | 41 |
| 44 DECLARE_VIRTUAL_TRACE_WRAPPERS(); | 42 DECLARE_VIRTUAL_TRACE_WRAPPERS(); |
| 45 | 43 |
| 46 private: | 44 private: |
| 47 PromiseRejectionEvent(ScriptState*, | 45 PromiseRejectionEvent(ScriptState*, |
| 48 const AtomicString&, | 46 const AtomicString&, |
| 49 const PromiseRejectionEventInit&); | 47 const PromiseRejectionEventInit&); |
| 50 ~PromiseRejectionEvent() override; | 48 ~PromiseRejectionEvent() override; |
| 51 void dispose(); | 49 void dispose(); |
| 52 | 50 |
| 53 RefPtr<DOMWrapperWorld> m_world; | 51 RefPtr<DOMWrapperWorld> m_world; |
| 54 TraceWrapperV8Reference<v8::Value> m_promise; | 52 TraceWrapperV8Reference<v8::Value> m_promise; |
| 55 TraceWrapperV8Reference<v8::Value> m_reason; | 53 TraceWrapperV8Reference<v8::Value> m_reason; |
| 56 }; | 54 }; |
| 57 | 55 |
| 58 } // namespace blink | 56 } // namespace blink |
| 59 | 57 |
| 60 #endif // PromiseRejectionEvent_h | 58 #endif // PromiseRejectionEvent_h |
| OLD | NEW |