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