Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM Cache.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_CacheBinding_h
4 : #define mozilla_dom_CacheBinding_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 : #include "mozilla/dom/Request.h"
12 : #include "mozilla/dom/Response.h"
13 :
14 : namespace mozilla {
15 : namespace dom {
16 :
17 : struct CacheBatchOperationAtoms;
18 : struct CacheQueryOptions;
19 : struct CacheQueryOptionsAtoms;
20 : struct NativePropertyHooks;
21 : class ProtoAndIfaceCache;
22 : class Request;
23 : class Response;
24 :
25 : namespace cache {
26 :
27 : class Cache;
28 : struct CacheAtoms;
29 :
30 : } // namespace cache
31 :
32 : } // namespace dom
33 : } // namespace mozilla
34 :
35 : namespace mozilla {
36 : namespace dom {
37 :
38 0 : struct CacheQueryOptions : public DictionaryBase
39 : {
40 : MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mCacheName;
41 : MOZ_INIT_OUTSIDE_CTOR bool mIgnoreMethod;
42 : MOZ_INIT_OUTSIDE_CTOR bool mIgnoreSearch;
43 : MOZ_INIT_OUTSIDE_CTOR bool mIgnoreVary;
44 :
45 : CacheQueryOptions();
46 :
47 0 : explicit inline CacheQueryOptions(const FastDictionaryInitializer& )
48 0 : {
49 : // Do nothing here; this is used by our "Fast" subclass
50 0 : }
51 :
52 : explicit inline CacheQueryOptions(const CacheQueryOptions& aOther)
53 : {
54 : *this = aOther;
55 : }
56 :
57 : bool
58 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
59 :
60 : bool
61 : Init(const nsAString& aJSON);
62 :
63 : bool
64 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
65 :
66 : bool
67 : ToJSON(nsAString& aJSON) const;
68 :
69 : void
70 : TraceDictionary(JSTracer* trc);
71 :
72 : CacheQueryOptions&
73 : operator=(const CacheQueryOptions& aOther);
74 :
75 : private:
76 : static bool
77 : InitIds(JSContext* cx, CacheQueryOptionsAtoms* atomsCache);
78 : };
79 :
80 : namespace binding_detail {
81 0 : struct FastCacheQueryOptions : public CacheQueryOptions
82 : {
83 0 : inline FastCacheQueryOptions()
84 0 : : CacheQueryOptions(FastDictionaryInitializer())
85 : {
86 : // Doesn't matter what int we pass to the parent constructor
87 0 : }
88 : };
89 : } // namespace binding_detail
90 :
91 :
92 : struct CacheBatchOperation : public DictionaryBase
93 : {
94 : MOZ_INIT_OUTSIDE_CTOR CacheQueryOptions mOptions;
95 : MOZ_INIT_OUTSIDE_CTOR Optional<OwningNonNull<mozilla::dom::Request>> mRequest;
96 : MOZ_INIT_OUTSIDE_CTOR Optional<OwningNonNull<mozilla::dom::Response>> mResponse;
97 : MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mType;
98 :
99 : CacheBatchOperation();
100 :
101 : explicit inline CacheBatchOperation(const FastDictionaryInitializer& )
102 : : mOptions(FastDictionaryInitializer())
103 : {
104 : // Do nothing here; this is used by our "Fast" subclass
105 : }
106 :
107 : explicit inline CacheBatchOperation(const CacheBatchOperation& aOther)
108 : : mOptions(FastDictionaryInitializer())
109 : {
110 : *this = aOther;
111 : }
112 :
113 : bool
114 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
115 :
116 : bool
117 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
118 :
119 : void
120 : TraceDictionary(JSTracer* trc);
121 :
122 : CacheBatchOperation&
123 : operator=(const CacheBatchOperation& aOther);
124 :
125 : private:
126 : static bool
127 : InitIds(JSContext* cx, CacheBatchOperationAtoms* atomsCache);
128 : };
129 :
130 : namespace binding_detail {
131 : struct FastCacheBatchOperation : public CacheBatchOperation
132 : {
133 : inline FastCacheBatchOperation()
134 : : CacheBatchOperation(FastDictionaryInitializer())
135 : {
136 : // Doesn't matter what int we pass to the parent constructor
137 : }
138 : };
139 : } // namespace binding_detail
140 :
141 :
142 : namespace CacheBinding {
143 :
144 : typedef mozilla::dom::cache::Cache NativeType;
145 :
146 : bool
147 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
148 :
149 : JSObject*
150 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
151 :
152 : const JSClass*
153 : GetJSClass();
154 :
155 : bool
156 : Wrap(JSContext* aCx, mozilla::dom::cache::Cache* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
157 :
158 : template <class T>
159 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
160 : {
161 0 : JS::Rooted<JSObject*> reflector(aCx);
162 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
163 : }
164 :
165 : // We declare this as an array so that retrieving a pointer to this
166 : // binding's property hooks only requires compile/link-time resolvable
167 : // address arithmetic. Declaring it as a pointer instead would require
168 : // doing a run-time load to fetch a pointer to this binding's property
169 : // hooks. And then structures which embedded a pointer to this structure
170 : // would require a run-time load for proper initialization, which would
171 : // then induce static constructors. Lots of static constructors.
172 : extern const NativePropertyHooks sNativePropertyHooks[];
173 :
174 : void
175 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
176 :
177 : JS::Handle<JSObject*>
178 : GetProtoObjectHandle(JSContext* aCx);
179 :
180 : JS::Handle<JSObject*>
181 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
182 :
183 : JSObject*
184 : GetConstructorObject(JSContext* aCx);
185 :
186 : } // namespace CacheBinding
187 :
188 :
189 :
190 : } // namespace dom
191 : } // namespace mozilla
192 :
193 : #endif // mozilla_dom_CacheBinding_h
|