/work/obj-fuzz/dist/include/mozilla/dom/BrowserFeedWriterBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM BrowserFeedWriter.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_BrowserFeedWriterBinding_h |
4 | | #define mozilla_dom_BrowserFeedWriterBinding_h |
5 | | |
6 | | #include "GeckoProfiler.h" |
7 | | #include "js/RootingAPI.h" |
8 | | #include "jspubtd.h" |
9 | | #include "mozilla/ErrorResult.h" |
10 | | #include "mozilla/dom/BindingDeclarations.h" |
11 | | #include "mozilla/dom/CallbackInterface.h" |
12 | | #include "mozilla/dom/Nullable.h" |
13 | | #include "mozilla/dom/PrototypeList.h" |
14 | | #include "mozilla/dom/ToJSValue.h" |
15 | | #include "nsWeakReference.h" |
16 | | |
17 | | namespace mozilla { |
18 | | namespace dom { |
19 | | |
20 | | class BrowserFeedWriter; |
21 | | struct BrowserFeedWriterAtoms; |
22 | | struct NativePropertyHooks; |
23 | | class ProtoAndIfaceCache; |
24 | | |
25 | | } // namespace dom |
26 | | } // namespace mozilla |
27 | | |
28 | | namespace mozilla { |
29 | | namespace dom { |
30 | | |
31 | | namespace BrowserFeedWriter_Binding { |
32 | | |
33 | | typedef mozilla::dom::BrowserFeedWriter NativeType; |
34 | | |
35 | | bool |
36 | | ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj); |
37 | | |
38 | | const JSClass* |
39 | | GetJSClass(); |
40 | | |
41 | | bool |
42 | | Wrap(JSContext* aCx, mozilla::dom::BrowserFeedWriter* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
43 | | |
44 | | template <class T> |
45 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
46 | 0 | { |
47 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
48 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
49 | 0 | } |
50 | | |
51 | | // We declare this as an array so that retrieving a pointer to this |
52 | | // binding's property hooks only requires compile/link-time resolvable |
53 | | // address arithmetic. Declaring it as a pointer instead would require |
54 | | // doing a run-time load to fetch a pointer to this binding's property |
55 | | // hooks. And then structures which embedded a pointer to this structure |
56 | | // would require a run-time load for proper initialization, which would |
57 | | // then induce static constructors. Lots of static constructors. |
58 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
59 | | |
60 | | void |
61 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
62 | | |
63 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
64 | 0 | { |
65 | 0 | /* Get the interface prototype object for this class. This will create the |
66 | 0 | object as needed. */ |
67 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::BrowserFeedWriter, |
68 | 0 | &CreateInterfaceObjects, |
69 | 0 | /* aDefineOnGlobal = */ true); |
70 | 0 |
|
71 | 0 | } |
72 | | |
73 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
74 | 0 | { |
75 | 0 | /* Get the interface object for this class. This will create the object as |
76 | 0 | needed. */ |
77 | 0 |
|
78 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::BrowserFeedWriter, |
79 | 0 | &CreateInterfaceObjects, |
80 | 0 | aDefineOnGlobal); |
81 | 0 | } |
82 | | |
83 | | JSObject* |
84 | | GetConstructorObject(JSContext* aCx); |
85 | | |
86 | | } // namespace BrowserFeedWriter_Binding |
87 | | |
88 | | |
89 | | |
90 | | class BrowserFeedWriterJSImpl : public CallbackInterface |
91 | | { |
92 | | public: |
93 | | explicit inline BrowserFeedWriterJSImpl(JSContext* aCx, JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aCallbackGlobal, nsIGlobalObject* aIncumbentGlobal) |
94 | | : CallbackInterface(aCx, aCallback, aCallbackGlobal, aIncumbentGlobal) |
95 | 0 | { |
96 | 0 | } |
97 | | |
98 | | explicit inline BrowserFeedWriterJSImpl(JSObject* aCallback, JSObject* aCallbackGlobal, const FastCallbackConstructor& ) |
99 | | : CallbackInterface(aCallback, aCallbackGlobal, FastCallbackConstructor()) |
100 | 0 | { |
101 | 0 | } |
102 | | |
103 | | explicit inline BrowserFeedWriterJSImpl(JSObject* aCallback, JSObject* aCallbackGlobal, JSObject* aAsyncStack, nsIGlobalObject* aIncumbentGlobal) |
104 | | : CallbackInterface(aCallback, aCallbackGlobal, aAsyncStack, aIncumbentGlobal) |
105 | 0 | { |
106 | 0 | } |
107 | | |
108 | | void WriteContent(ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
109 | | |
110 | | void Close(ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
111 | | |
112 | | void __Init(ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
113 | | |
114 | | inline bool |
115 | | operator==(const BrowserFeedWriterJSImpl& aOther) const |
116 | 0 | { |
117 | 0 | return CallbackInterface::operator==(aOther); |
118 | 0 | } |
119 | | |
120 | | private: |
121 | | static bool |
122 | | InitIds(JSContext* cx, BrowserFeedWriterAtoms* atomsCache); |
123 | | }; |
124 | | |
125 | | |
126 | | class BrowserFeedWriter final : public nsSupportsWeakReference, |
127 | | public nsWrapperCache |
128 | | { |
129 | | public: |
130 | | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
131 | | NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(BrowserFeedWriter) |
132 | | |
133 | | private: |
134 | | RefPtr<BrowserFeedWriterJSImpl> mImpl; |
135 | | nsCOMPtr<nsIGlobalObject> mParent; |
136 | | |
137 | | public: |
138 | | BrowserFeedWriter(JS::Handle<JSObject*> aJSImplObject, JS::Handle<JSObject*> aJSImplGlobal, nsIGlobalObject* aParent); |
139 | | |
140 | | private: |
141 | | ~BrowserFeedWriter(); |
142 | | |
143 | | public: |
144 | | nsISupports* GetParentObject() const; |
145 | | |
146 | | virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; |
147 | | |
148 | | static already_AddRefed<BrowserFeedWriter> Constructor(const GlobalObject& global, JSContext* cx, ErrorResult& aRv, JS::Handle<JSObject*> aGivenProto = nullptr); |
149 | | |
150 | | void WriteContent(ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
151 | | |
152 | | void Close(ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
153 | | |
154 | | static bool |
155 | | _Create(JSContext* cx, unsigned argc, JS::Value* vp); |
156 | | }; |
157 | | |
158 | | |
159 | | } // namespace dom |
160 | | } // namespace mozilla |
161 | | |
162 | | #endif // mozilla_dom_BrowserFeedWriterBinding_h |