OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef PromiseRejectionEvent_h | |
6 #define PromiseRejectionEvent_h | |
7 | |
8 #include "bindings/core/v8/ScriptPromise.h" | |
9 #include "bindings/core/v8/ScriptValue.h" | |
10 #include "core/CoreExport.h" | |
11 #include "core/events/Event.h" | |
12 #include "core/events/PromiseRejectionEventInit.h" | |
13 | |
14 namespace blink { | |
15 | |
16 class CORE_EXPORT PromiseRejectionEvent : public Event { | |
17 DEFINE_WRAPPERTYPEINFO(); | |
18 public: | |
19 static PassRefPtrWillBeRawPtr<PromiseRejectionEvent> create() | |
20 { | |
21 return adoptRefWillBeNoop(new PromiseRejectionEvent); | |
22 } | |
23 static PassRefPtrWillBeRawPtr<PromiseRejectionEvent> create(const AtomicStri ng& type, ScriptPromise promise, ScriptValue reason) | |
24 { | |
25 return adoptRefWillBeNoop(new PromiseRejectionEvent(type, promise, reaso n)); | |
26 } | |
27 static PassRefPtrWillBeRawPtr<PromiseRejectionEvent> create(const AtomicStri ng& type, PromiseRejectionEventInit& initializer) | |
28 { | |
29 initializer.setCancelable(true); | |
philipj_slow
2015/06/16 14:58:03
https://github.com/domenic/unhandled-rejections-br
jochen (gone - plz use gerrit)
2015/06/17 07:57:53
spec was updated
| |
30 return adoptRefWillBeNoop(new PromiseRejectionEvent(type, initializer)); | |
31 } | |
32 | |
33 ScriptValue reason() const { return m_reason; } | |
34 ScriptPromise promise() const { return m_promise; } | |
35 | |
36 virtual const AtomicString& interfaceName() const override; | |
37 | |
38 DECLARE_VIRTUAL_TRACE(); | |
39 | |
40 private: | |
41 PromiseRejectionEvent(); | |
42 PromiseRejectionEvent(const AtomicString& type, ScriptPromise, ScriptValue r eason); | |
43 PromiseRejectionEvent(const AtomicString&, const PromiseRejectionEventInit&) ; | |
44 ~PromiseRejectionEvent() override; | |
45 | |
46 ScriptPromise m_promise; | |
47 ScriptValue m_reason; | |
48 }; | |
49 | |
50 } // namespace blink | |
51 | |
52 #endif // PromiseRejectionEvent_h | |
OLD | NEW |