/work/obj-fuzz/dom/bindings/PromiseRejectionEvent.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim:set ts=2 sw=2 sts=2 et cindent: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | /* THIS FILE IS AUTOGENERATED FROM PromiseRejectionEvent.webidl BY Codegen.py - DO NOT EDIT */ |
8 | | |
9 | | #include "EventBinding.h" |
10 | | #include "PromiseRejectionEvent.h" |
11 | | #include "PromiseRejectionEventBinding.h" |
12 | | #include "js/GCAPI.h" |
13 | | #include "mozilla/dom/DOMPrefs.h" |
14 | | #include "mozilla/dom/Nullable.h" |
15 | | #include "mozilla/dom/PrimitiveConversions.h" |
16 | | #include "mozilla/dom/Promise.h" |
17 | | #include "mozilla/dom/PromiseRejectionEvent.h" |
18 | | #include "mozilla/dom/ToJSValue.h" |
19 | | |
20 | | namespace mozilla { |
21 | | namespace dom { |
22 | | |
23 | | |
24 | | NS_IMPL_CYCLE_COLLECTION_CLASS(PromiseRejectionEvent) |
25 | | |
26 | | NS_IMPL_ADDREF_INHERITED(PromiseRejectionEvent, Event) |
27 | | NS_IMPL_RELEASE_INHERITED(PromiseRejectionEvent, Event) |
28 | | |
29 | 0 | NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(PromiseRejectionEvent, Event) |
30 | 0 | NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPromise) |
31 | 0 | NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END |
32 | | |
33 | 0 | NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(PromiseRejectionEvent, Event) |
34 | 0 | NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mReason) |
35 | 0 | NS_IMPL_CYCLE_COLLECTION_TRACE_END |
36 | | |
37 | 0 | NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(PromiseRejectionEvent, Event) |
38 | 0 | NS_IMPL_CYCLE_COLLECTION_UNLINK(mPromise) |
39 | 0 | tmp->mReason.setUndefined(); |
40 | 0 | NS_IMPL_CYCLE_COLLECTION_UNLINK_END |
41 | | |
42 | 0 | NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PromiseRejectionEvent) |
43 | 0 | NS_INTERFACE_MAP_END_INHERITING(Event) |
44 | | |
45 | | PromiseRejectionEvent::PromiseRejectionEvent(mozilla::dom::EventTarget* aOwner) |
46 | | : Event(aOwner, nullptr, nullptr) |
47 | 0 | { |
48 | 0 | } |
49 | | |
50 | | PromiseRejectionEvent::~PromiseRejectionEvent() |
51 | 0 | { |
52 | 0 | mReason = JS::UndefinedValue(); |
53 | 0 | mozilla::DropJSObjects(this); |
54 | 0 | } |
55 | | |
56 | | void |
57 | | PromiseRejectionEvent::GetReason(JS::MutableHandle<JS::Value> aRetVal) const |
58 | 0 | { |
59 | 0 | JS::ExposeValueToActiveJS(mReason); |
60 | 0 | aRetVal.set(mReason); |
61 | 0 | } |
62 | | |
63 | | PromiseRejectionEvent* |
64 | | PromiseRejectionEvent::AsPromiseRejectionEvent() |
65 | 0 | { |
66 | 0 | return this; |
67 | 0 | } |
68 | | |
69 | | JSObject* |
70 | | PromiseRejectionEvent::WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) |
71 | 0 | { |
72 | 0 | return PromiseRejectionEvent_Binding::Wrap(aCx, this, aGivenProto); |
73 | 0 | } |
74 | | |
75 | | already_AddRefed<PromiseRejectionEvent> |
76 | | PromiseRejectionEvent::Constructor(mozilla::dom::EventTarget* aOwner, const nsAString& aType, const PromiseRejectionEventInit& aEventInitDict) |
77 | 0 | { |
78 | 0 | RefPtr<PromiseRejectionEvent> e = new PromiseRejectionEvent(aOwner); |
79 | 0 | bool trusted = e->Init(aOwner); |
80 | 0 | e->InitEvent(aType, aEventInitDict.mBubbles, aEventInitDict.mCancelable); |
81 | 0 | e->mPromise = aEventInitDict.mPromise; |
82 | 0 | e->mReason = aEventInitDict.mReason; |
83 | 0 | e->SetTrusted(trusted); |
84 | 0 | e->SetComposed(aEventInitDict.mComposed); |
85 | 0 | mozilla::HoldJSObjects(e.get()); |
86 | 0 | return e.forget(); |
87 | 0 | } |
88 | | |
89 | | already_AddRefed<PromiseRejectionEvent> |
90 | | PromiseRejectionEvent::Constructor(const GlobalObject& aGlobal, const nsAString& aType, const PromiseRejectionEventInit& aEventInitDict, ErrorResult& aRv) |
91 | 0 | { |
92 | 0 | nsCOMPtr<mozilla::dom::EventTarget> owner = do_QueryInterface(aGlobal.GetAsSupports()); |
93 | 0 | return Constructor(owner, aType, aEventInitDict); |
94 | 0 | } |
95 | | |
96 | | Promise* |
97 | | PromiseRejectionEvent::RejectedPromise() const |
98 | 0 | { |
99 | 0 | return mPromise; |
100 | 0 | } |
101 | | |
102 | | void |
103 | | PromiseRejectionEvent::GetReason(JSContext* cx, JS::MutableHandle<JS::Value> aRetVal) const |
104 | 0 | { |
105 | 0 | GetReason(aRetVal); |
106 | 0 | } |
107 | | |
108 | | |
109 | | } // namespace dom |
110 | | } // namespace mozilla |