| 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" |
| 11 #include "bindings/core/v8/ScriptState.h" | 11 #include "bindings/core/v8/ScriptState.h" |
| 12 #include "bindings/core/v8/ScriptValue.h" | 12 #include "bindings/core/v8/ScriptValue.h" |
| 13 #include "core/CoreExport.h" | 13 #include "core/CoreExport.h" |
| 14 #include "core/events/Event.h" | 14 #include "core/events/Event.h" |
| 15 #include "core/events/PromiseRejectionEventInit.h" | 15 #include "core/events/PromiseRejectionEventInit.h" |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 class CORE_EXPORT PromiseRejectionEvent final : public Event { | 19 class CORE_EXPORT PromiseRejectionEvent final : public Event { |
| 20 DEFINE_WRAPPERTYPEINFO(); | 20 DEFINE_WRAPPERTYPEINFO(); |
| 21 public: | 21 public: |
| 22 static PassRefPtrWillBeRawPtr<PromiseRejectionEvent> create() | 22 static RawPtr<PromiseRejectionEvent> create() |
| 23 { | 23 { |
| 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 RawPtr<PromiseRejectionEvent> create(ScriptState* state, const Atomic
String& type, const PromiseRejectionEventInit& initializer) |
| 27 { | 27 { |
| 28 return adoptRefWillBeNoop(new PromiseRejectionEvent(state, type, initial
izer)); | 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>&); | 34 void setWrapperReference(v8::Isolate*, const v8::Persistent<v8::Object>&); |
| 35 | 35 |
| 36 const AtomicString& interfaceName() const override; | 36 const AtomicString& interfaceName() const override; |
| 37 | 37 |
| 38 // PromiseRejectionEvents are similar to ErrorEvents in that they can't be | 38 // PromiseRejectionEvents are similar to ErrorEvents in that they can't be |
| (...skipping 11 matching lines...) Expand all Loading... |
| 50 static void didCollectReason(const v8::WeakCallbackInfo<PromiseRejectionEven
t>&); | 50 static void didCollectReason(const v8::WeakCallbackInfo<PromiseRejectionEven
t>&); |
| 51 | 51 |
| 52 RefPtr<ScriptState> m_scriptState; | 52 RefPtr<ScriptState> m_scriptState; |
| 53 ScopedPersistent<v8::Value> m_promise; | 53 ScopedPersistent<v8::Value> m_promise; |
| 54 ScopedPersistent<v8::Value> m_reason; | 54 ScopedPersistent<v8::Value> m_reason; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } // namespace blink | 57 } // namespace blink |
| 58 | 58 |
| 59 #endif // PromiseRejectionEvent_h | 59 #endif // PromiseRejectionEvent_h |
| OLD | NEW |