Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM CreateOfferRequest.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_CreateOfferRequestBinding_h
4 : #define mozilla_dom_CreateOfferRequestBinding_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 CreateOfferRequest;
19 : struct CreateOfferRequestAtoms;
20 : struct NativePropertyHooks;
21 : class ProtoAndIfaceCache;
22 :
23 : } // namespace dom
24 : } // namespace mozilla
25 :
26 : namespace mozilla {
27 : namespace dom {
28 :
29 : namespace CreateOfferRequestBinding {
30 :
31 : typedef mozilla::dom::CreateOfferRequest 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::CreateOfferRequest* 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 CreateOfferRequestBinding
74 :
75 :
76 :
77 0 : class CreateOfferRequestJSImpl : public CallbackInterface
78 : {
79 : public:
80 0 : explicit inline CreateOfferRequestJSImpl(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal)
81 0 : : CallbackInterface(aCx, aCallback, aIncumbentGlobal)
82 : {
83 0 : }
84 :
85 : explicit inline CreateOfferRequestJSImpl(JS::Handle<JSObject*> aCallback, const FastCallbackConstructor& )
86 : : CallbackInterface(aCallback, FastCallbackConstructor())
87 : {
88 : }
89 :
90 : explicit inline CreateOfferRequestJSImpl(JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
91 : : CallbackInterface(aCallback, aAsyncStack, aIncumbentGlobal)
92 : {
93 : }
94 :
95 : inline bool
96 : operator==(const CreateOfferRequestJSImpl& aOther) const
97 : {
98 : return CallbackInterface::operator==(aOther);
99 : }
100 :
101 : uint64_t GetWindowID(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
102 :
103 : uint64_t GetInnerWindowID(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
104 :
105 : void GetCallID(nsString& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
106 :
107 : bool GetIsSecure(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
108 :
109 : private:
110 : static bool
111 : InitIds(JSContext* cx, CreateOfferRequestAtoms* atomsCache);
112 : };
113 :
114 :
115 : class CreateOfferRequest final : public nsSupportsWeakReference,
116 : public nsWrapperCache
117 : {
118 : public:
119 : NS_DECL_CYCLE_COLLECTING_ISUPPORTS
120 0 : NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CreateOfferRequest)
121 :
122 : private:
123 : RefPtr<CreateOfferRequestJSImpl> mImpl;
124 : nsCOMPtr<nsISupports> mParent;
125 :
126 : public:
127 : CreateOfferRequest(JS::Handle<JSObject*> aJSImplObject, nsIGlobalObject* aParent);
128 :
129 : private:
130 : ~CreateOfferRequest();
131 :
132 : public:
133 : nsISupports* GetParentObject() const;
134 :
135 : virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
136 :
137 : uint64_t GetWindowID(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
138 :
139 : uint64_t GetInnerWindowID(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
140 :
141 : void GetCallID(nsString& aRetVal, ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
142 :
143 : bool GetIsSecure(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
144 :
145 : static bool
146 : _Create(JSContext* cx, unsigned argc, JS::Value* vp);
147 : };
148 :
149 :
150 : } // namespace dom
151 : } // namespace mozilla
152 :
153 : #endif // mozilla_dom_CreateOfferRequestBinding_h
|