Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM MozSelfSupport.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_MozSelfSupportBinding_h
4 : #define mozilla_dom_MozSelfSupportBinding_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 MozSelfSupport;
19 : struct MozSelfSupportAtoms;
20 : struct NativePropertyHooks;
21 : class Promise;
22 : class ProtoAndIfaceCache;
23 :
24 : } // namespace dom
25 : } // namespace mozilla
26 :
27 : namespace mozilla {
28 : namespace dom {
29 :
30 : namespace MozSelfSupportBinding {
31 :
32 : typedef mozilla::dom::MozSelfSupport NativeType;
33 :
34 : bool
35 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
36 :
37 : JSObject*
38 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
39 :
40 : const JSClass*
41 : GetJSClass();
42 :
43 : bool
44 : Wrap(JSContext* aCx, mozilla::dom::MozSelfSupport* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
45 :
46 : template <class T>
47 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
48 : {
49 0 : JS::Rooted<JSObject*> reflector(aCx);
50 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
51 : }
52 :
53 : // We declare this as an array so that retrieving a pointer to this
54 : // binding's property hooks only requires compile/link-time resolvable
55 : // address arithmetic. Declaring it as a pointer instead would require
56 : // doing a run-time load to fetch a pointer to this binding's property
57 : // hooks. And then structures which embedded a pointer to this structure
58 : // would require a run-time load for proper initialization, which would
59 : // then induce static constructors. Lots of static constructors.
60 : extern const NativePropertyHooks sNativePropertyHooks[];
61 :
62 : void
63 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
64 :
65 : JS::Handle<JSObject*>
66 : GetProtoObjectHandle(JSContext* aCx);
67 :
68 : JS::Handle<JSObject*>
69 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
70 :
71 : JSObject*
72 : GetConstructorObject(JSContext* aCx);
73 :
74 : } // namespace MozSelfSupportBinding
75 :
76 :
77 :
78 0 : class MozSelfSupportJSImpl : public CallbackInterface
79 : {
80 : public:
81 0 : explicit inline MozSelfSupportJSImpl(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal)
82 0 : : CallbackInterface(aCx, aCallback, aIncumbentGlobal)
83 : {
84 0 : }
85 :
86 : explicit inline MozSelfSupportJSImpl(JS::Handle<JSObject*> aCallback, const FastCallbackConstructor& )
87 : : CallbackInterface(aCallback, FastCallbackConstructor())
88 : {
89 : }
90 :
91 : explicit inline MozSelfSupportJSImpl(JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
92 : : CallbackInterface(aCallback, aAsyncStack, aIncumbentGlobal)
93 : {
94 : }
95 :
96 : already_AddRefed<Promise> GetTelemetryPingList(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
97 :
98 : already_AddRefed<Promise> GetTelemetryPing(const nsAString& pingID, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
99 :
100 : already_AddRefed<Promise> GetCurrentTelemetryEnvironment(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
101 :
102 : already_AddRefed<Promise> GetCurrentTelemetrySubsessionPing(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
103 :
104 : void ResetPref(const nsAString& name, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
105 :
106 : void ResetSearchEngines(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
107 :
108 : void __Init(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
109 :
110 : inline bool
111 : operator==(const MozSelfSupportJSImpl& aOther) const
112 : {
113 : return CallbackInterface::operator==(aOther);
114 : }
115 :
116 : bool GetHealthReportDataSubmissionEnabled(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
117 :
118 : void SetHealthReportDataSubmissionEnabled(bool arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
119 :
120 : private:
121 : static bool
122 : InitIds(JSContext* cx, MozSelfSupportAtoms* atomsCache);
123 : };
124 :
125 :
126 : class MozSelfSupport final : public nsSupportsWeakReference,
127 : public nsWrapperCache
128 : {
129 : public:
130 : NS_DECL_CYCLE_COLLECTING_ISUPPORTS
131 1 : NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MozSelfSupport)
132 :
133 : private:
134 : RefPtr<MozSelfSupportJSImpl> mImpl;
135 : nsCOMPtr<nsISupports> mParent;
136 :
137 : public:
138 : MozSelfSupport(JS::Handle<JSObject*> aJSImplObject, nsIGlobalObject* aParent);
139 :
140 : private:
141 : ~MozSelfSupport();
142 :
143 : public:
144 : nsISupports* GetParentObject() const;
145 :
146 : virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
147 :
148 : static already_AddRefed<MozSelfSupport> Constructor(const GlobalObject& global, JSContext* cx, ErrorResult& aRv);
149 :
150 : bool GetHealthReportDataSubmissionEnabled(ErrorResult& aRv, JSCompartment* aCompartment = nullptr) const;
151 :
152 : void SetHealthReportDataSubmissionEnabled(bool arg, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
153 :
154 : // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
155 : already_AddRefed<Promise> GetTelemetryPingList(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
156 :
157 : // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
158 : already_AddRefed<Promise> GetTelemetryPing(const nsAString& pingID, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
159 :
160 : // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
161 : already_AddRefed<Promise> GetCurrentTelemetryEnvironment(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
162 :
163 : // Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
164 : already_AddRefed<Promise> GetCurrentTelemetrySubsessionPing(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
165 :
166 : void ResetPref(const nsAString& name, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
167 :
168 : void ResetSearchEngines(ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
169 :
170 : static bool
171 : _Create(JSContext* cx, unsigned argc, JS::Value* vp);
172 : };
173 :
174 :
175 : } // namespace dom
176 : } // namespace mozilla
177 :
178 : #endif // mozilla_dom_MozSelfSupportBinding_h
|