Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM Clients.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_ClientsBinding_h
4 : #define mozilla_dom_ClientsBinding_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/Nullable.h"
11 :
12 : namespace mozilla {
13 : namespace dom {
14 :
15 : struct ClientQueryOptionsAtoms;
16 : struct NativePropertyHooks;
17 : class ProtoAndIfaceCache;
18 :
19 : namespace workers {
20 :
21 : class ServiceWorkerClients;
22 : struct ServiceWorkerClientsAtoms;
23 :
24 : } // namespace workers
25 :
26 : } // namespace dom
27 : } // namespace mozilla
28 :
29 : namespace mozilla {
30 : namespace dom {
31 :
32 : enum class ClientType : uint8_t {
33 : Window,
34 : Worker,
35 : Sharedworker,
36 : All,
37 : EndGuard_
38 : };
39 :
40 : namespace ClientTypeValues {
41 : extern const EnumEntry strings[5];
42 : } // namespace ClientTypeValues
43 :
44 : bool
45 : ToJSValue(JSContext* aCx, ClientType aArgument, JS::MutableHandle<JS::Value> aValue);
46 :
47 :
48 : struct ClientQueryOptions : public DictionaryBase
49 : {
50 : MOZ_INIT_OUTSIDE_CTOR bool mIncludeUncontrolled;
51 : MOZ_INIT_OUTSIDE_CTOR ClientType mType;
52 :
53 : ClientQueryOptions();
54 :
55 0 : explicit inline ClientQueryOptions(const FastDictionaryInitializer& )
56 0 : {
57 : // Do nothing here; this is used by our "Fast" subclass
58 0 : }
59 :
60 : explicit inline ClientQueryOptions(const ClientQueryOptions& aOther)
61 : {
62 : *this = aOther;
63 : }
64 :
65 : bool
66 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
67 :
68 : bool
69 : Init(const nsAString& aJSON);
70 :
71 : bool
72 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
73 :
74 : bool
75 : ToJSON(nsAString& aJSON) const;
76 :
77 : void
78 : TraceDictionary(JSTracer* trc);
79 :
80 : ClientQueryOptions&
81 : operator=(const ClientQueryOptions& aOther);
82 :
83 : private:
84 : static bool
85 : InitIds(JSContext* cx, ClientQueryOptionsAtoms* atomsCache);
86 : };
87 :
88 : namespace binding_detail {
89 : struct FastClientQueryOptions : public ClientQueryOptions
90 : {
91 0 : inline FastClientQueryOptions()
92 0 : : ClientQueryOptions(FastDictionaryInitializer())
93 : {
94 : // Doesn't matter what int we pass to the parent constructor
95 0 : }
96 : };
97 : } // namespace binding_detail
98 :
99 :
100 : namespace ClientsBinding {
101 :
102 : typedef mozilla::dom::workers::ServiceWorkerClients NativeType;
103 :
104 : bool
105 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
106 :
107 : const JSClass*
108 : GetJSClass();
109 :
110 : bool
111 : Wrap(JSContext* aCx, mozilla::dom::workers::ServiceWorkerClients* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
112 :
113 : template <class T>
114 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
115 : {
116 0 : JS::Rooted<JSObject*> reflector(aCx);
117 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
118 : }
119 :
120 : void
121 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
122 :
123 : JS::Handle<JSObject*>
124 : GetProtoObjectHandle(JSContext* aCx);
125 :
126 : JS::Handle<JSObject*>
127 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
128 :
129 : JSObject*
130 : GetConstructorObject(JSContext* aCx);
131 :
132 : } // namespace ClientsBinding
133 :
134 :
135 :
136 : } // namespace dom
137 : } // namespace mozilla
138 :
139 : #endif // mozilla_dom_ClientsBinding_h
|