/work/obj-fuzz/ipc/ipdl/PBackgroundIDBDatabase.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | // |
2 | | // Automatically generated by ipdlc. |
3 | | // Edit at your own risk |
4 | | // |
5 | | |
6 | | |
7 | | #include "mozilla/dom/indexedDB/SerializationHelpers.h" |
8 | | #include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseFileParent.h" |
9 | | #include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseFileChild.h" |
10 | | #include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseRequestParent.h" |
11 | | #include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseRequestChild.h" |
12 | | #include "mozilla/dom/indexedDB/PBackgroundIDBFactoryParent.h" |
13 | | #include "mozilla/dom/indexedDB/PBackgroundIDBFactoryChild.h" |
14 | | #include "mozilla/dom/indexedDB/PBackgroundIDBTransactionParent.h" |
15 | | #include "mozilla/dom/indexedDB/PBackgroundIDBTransactionChild.h" |
16 | | #include "mozilla/dom/indexedDB/PBackgroundIDBVersionChangeTransactionParent.h" |
17 | | #include "mozilla/dom/indexedDB/PBackgroundIDBVersionChangeTransactionChild.h" |
18 | | #include "mozilla/dom/PBackgroundMutableFileParent.h" |
19 | | #include "mozilla/dom/PBackgroundMutableFileChild.h" |
20 | | #include "mozilla/ipc/PChildToParentStreamParent.h" |
21 | | #include "mozilla/ipc/PChildToParentStreamChild.h" |
22 | | #include "mozilla/ipc/PFileDescriptorSetParent.h" |
23 | | #include "mozilla/ipc/PFileDescriptorSetChild.h" |
24 | | #include "mozilla/ipc/PIPCBlobInputStreamParent.h" |
25 | | #include "mozilla/ipc/PIPCBlobInputStreamChild.h" |
26 | | #include "mozilla/ipc/PParentToChildStreamParent.h" |
27 | | #include "mozilla/ipc/PParentToChildStreamChild.h" |
28 | | #include "mozilla/dom/indexedDB/PBackgroundIDBDatabase.h" |
29 | | |
30 | | namespace mozilla { |
31 | | namespace dom { |
32 | | namespace indexedDB { |
33 | | namespace PBackgroundIDBDatabase { |
34 | | |
35 | | nsresult |
36 | | CreateEndpoints( |
37 | | base::ProcessId aParentDestPid, |
38 | | base::ProcessId aChildDestPid, |
39 | | mozilla::ipc::Endpoint<mozilla::dom::indexedDB::PBackgroundIDBDatabaseParent>* aParent, |
40 | | mozilla::ipc::Endpoint<mozilla::dom::indexedDB::PBackgroundIDBDatabaseChild>* aChild) |
41 | 0 | { |
42 | 0 | return mozilla::ipc::CreateEndpoints(mozilla::ipc::PrivateIPDLInterface(), aParentDestPid, aChildDestPid, aParent, aChild); |
43 | 0 | } |
44 | | IPC::Message* |
45 | | Msg_DeleteMe(int32_t routingId) |
46 | 0 | { |
47 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_DeleteMe__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY)); |
48 | 0 | } |
49 | | IPC::Message* |
50 | | Msg_Blocked(int32_t routingId) |
51 | 0 | { |
52 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_Blocked__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY)); |
53 | 0 | } |
54 | | IPC::Message* |
55 | | Msg_Close(int32_t routingId) |
56 | 0 | { |
57 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_Close__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY)); |
58 | 0 | } |
59 | | IPC::Message* |
60 | | Msg_PBackgroundIDBDatabaseFileConstructor(int32_t routingId) |
61 | 0 | { |
62 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_PBackgroundIDBDatabaseFileConstructor__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY)); |
63 | 0 | } |
64 | | IPC::Message* |
65 | | Reply_PBackgroundIDBDatabaseFileConstructor(int32_t routingId) |
66 | 0 | { |
67 | 0 | return IPC::Message::IPDLMessage(routingId, Reply_PBackgroundIDBDatabaseFileConstructor__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::REPLY)); |
68 | 0 | } |
69 | | IPC::Message* |
70 | | Msg_PBackgroundIDBDatabaseRequestConstructor(int32_t routingId) |
71 | 0 | { |
72 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_PBackgroundIDBDatabaseRequestConstructor__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY)); |
73 | 0 | } |
74 | | IPC::Message* |
75 | | Reply_PBackgroundIDBDatabaseRequestConstructor(int32_t routingId) |
76 | 0 | { |
77 | 0 | return IPC::Message::IPDLMessage(routingId, Reply_PBackgroundIDBDatabaseRequestConstructor__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::REPLY)); |
78 | 0 | } |
79 | | IPC::Message* |
80 | | Msg_PBackgroundIDBTransactionConstructor(int32_t routingId) |
81 | 0 | { |
82 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_PBackgroundIDBTransactionConstructor__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY)); |
83 | 0 | } |
84 | | IPC::Message* |
85 | | Reply_PBackgroundIDBTransactionConstructor(int32_t routingId) |
86 | 0 | { |
87 | 0 | return IPC::Message::IPDLMessage(routingId, Reply_PBackgroundIDBTransactionConstructor__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::REPLY)); |
88 | 0 | } |
89 | | IPC::Message* |
90 | | Msg___delete__(int32_t routingId) |
91 | 0 | { |
92 | 0 | return IPC::Message::IPDLMessage(routingId, Msg___delete____ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY)); |
93 | 0 | } |
94 | | IPC::Message* |
95 | | Reply___delete__(int32_t routingId) |
96 | 0 | { |
97 | 0 | return IPC::Message::IPDLMessage(routingId, Reply___delete____ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::REPLY)); |
98 | 0 | } |
99 | | IPC::Message* |
100 | | Msg_VersionChange(int32_t routingId) |
101 | 0 | { |
102 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_VersionChange__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY)); |
103 | 0 | } |
104 | | IPC::Message* |
105 | | Msg_Invalidate(int32_t routingId) |
106 | 0 | { |
107 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_Invalidate__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY)); |
108 | 0 | } |
109 | | IPC::Message* |
110 | | Msg_CloseAfterInvalidationComplete(int32_t routingId) |
111 | 0 | { |
112 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_CloseAfterInvalidationComplete__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY)); |
113 | 0 | } |
114 | | IPC::Message* |
115 | | Msg_PBackgroundIDBVersionChangeTransactionConstructor(int32_t routingId) |
116 | 0 | { |
117 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_PBackgroundIDBVersionChangeTransactionConstructor__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY)); |
118 | 0 | } |
119 | | IPC::Message* |
120 | | Reply_PBackgroundIDBVersionChangeTransactionConstructor(int32_t routingId) |
121 | 0 | { |
122 | 0 | return IPC::Message::IPDLMessage(routingId, Reply_PBackgroundIDBVersionChangeTransactionConstructor__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::REPLY)); |
123 | 0 | } |
124 | | IPC::Message* |
125 | | Msg_PBackgroundMutableFileConstructor(int32_t routingId) |
126 | 0 | { |
127 | 0 | return IPC::Message::IPDLMessage(routingId, Msg_PBackgroundMutableFileConstructor__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::NOT_REPLY)); |
128 | 0 | } |
129 | | IPC::Message* |
130 | | Reply_PBackgroundMutableFileConstructor(int32_t routingId) |
131 | 0 | { |
132 | 0 | return IPC::Message::IPDLMessage(routingId, Reply_PBackgroundMutableFileConstructor__ID, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_INTERRUPT, IPC::Message::REPLY)); |
133 | 0 | } |
134 | | |
135 | | } // namespace PBackgroundIDBDatabase |
136 | | } // namespace indexedDB |
137 | | } // namespace dom |
138 | | } // namespace mozilla |
139 | | |
140 | | //----------------------------------------------------------------------------- |
141 | | // Method definitions for the IPDL type |struct CreateFileParams| |
142 | | // |
143 | | namespace mozilla { |
144 | | namespace dom { |
145 | | namespace indexedDB { |
146 | | auto CreateFileParams::operator==(const CreateFileParams& _o) const -> bool |
147 | 0 | { |
148 | 0 | if ((!((name()) == ((_o).name())))) { |
149 | 0 | return false; |
150 | 0 | } |
151 | 0 | if ((!((type()) == ((_o).type())))) { |
152 | 0 | return false; |
153 | 0 | } |
154 | 0 | return true; |
155 | 0 | } |
156 | | |
157 | | auto CreateFileParams::operator!=(const CreateFileParams& _o) const -> bool |
158 | 0 | { |
159 | 0 | return (!(operator==(_o))); |
160 | 0 | } |
161 | | |
162 | | } // namespace indexedDB |
163 | | } // namespace dom |
164 | | } // namespace mozilla |
165 | | |
166 | | namespace mozilla { |
167 | | namespace ipc { |
168 | | auto IPDLParamTraits<mozilla::dom::indexedDB::CreateFileParams>::Write( |
169 | | IPC::Message* aMsg, |
170 | | mozilla::ipc::IProtocol* aActor, |
171 | | const paramType& aVar) -> void |
172 | 0 | { |
173 | 0 | WriteIPDLParam(aMsg, aActor, (aVar).name()); |
174 | 0 | // Sentinel = 'name' |
175 | 0 | (aMsg)->WriteSentinel(15034981); |
176 | 0 | WriteIPDLParam(aMsg, aActor, (aVar).type()); |
177 | 0 | // Sentinel = 'type' |
178 | 0 | (aMsg)->WriteSentinel(2982068540); |
179 | 0 | } |
180 | | |
181 | | auto IPDLParamTraits<mozilla::dom::indexedDB::CreateFileParams>::Read( |
182 | | const IPC::Message* aMsg, |
183 | | PickleIterator* aIter, |
184 | | mozilla::ipc::IProtocol* aActor, |
185 | | paramType* aVar) -> bool |
186 | 0 | { |
187 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->name())))))) { |
188 | 0 | (aActor)->FatalError("Error deserializing 'name' (nsString) member of 'CreateFileParams'"); |
189 | 0 | return false; |
190 | 0 | } |
191 | 0 | // Sentinel = 'name' |
192 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 15034981)))) { |
193 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'name' (nsString) member of 'CreateFileParams'"); |
194 | 0 | return false; |
195 | 0 | } |
196 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->type())))))) { |
197 | 0 | (aActor)->FatalError("Error deserializing 'type' (nsString) member of 'CreateFileParams'"); |
198 | 0 | return false; |
199 | 0 | } |
200 | 0 | // Sentinel = 'type' |
201 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 2982068540)))) { |
202 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'type' (nsString) member of 'CreateFileParams'"); |
203 | 0 | return false; |
204 | 0 | } |
205 | 0 | return true; |
206 | 0 | } |
207 | | |
208 | | } // namespace ipc |
209 | | } // namespace mozilla |
210 | | |
211 | | //----------------------------------------------------------------------------- |
212 | | // Method definitions for the IPDL type |union DatabaseRequestParams| |
213 | | // |
214 | | namespace mozilla { |
215 | | namespace dom { |
216 | | namespace indexedDB { |
217 | | auto DatabaseRequestParams::MaybeDestroy(Type aNewType) -> bool |
218 | 0 | { |
219 | 0 | if ((mType) == (T__None)) { |
220 | 0 | return true; |
221 | 0 | } |
222 | 0 | if ((mType) == (aNewType)) { |
223 | 0 | return false; |
224 | 0 | } |
225 | 0 | switch (mType) { |
226 | 0 | case TCreateFileParams: |
227 | 0 | { |
228 | 0 | (ptr_CreateFileParams())->~CreateFileParams__tdef(); |
229 | 0 | break; |
230 | 0 | } |
231 | 0 | default: |
232 | 0 | { |
233 | 0 | mozilla::ipc::LogicError("not reached"); |
234 | 0 | break; |
235 | 0 | } |
236 | 0 | } |
237 | 0 | return true; |
238 | 0 | } |
239 | | |
240 | | MOZ_IMPLICIT DatabaseRequestParams::DatabaseRequestParams(const CreateFileParams& aOther) |
241 | 0 | { |
242 | 0 | new (mozilla::KnownNotNull, ptr_CreateFileParams()) CreateFileParams(aOther); |
243 | 0 | mType = TCreateFileParams; |
244 | 0 | } |
245 | | |
246 | | MOZ_IMPLICIT DatabaseRequestParams::DatabaseRequestParams(CreateFileParams&& aOther) |
247 | 0 | { |
248 | 0 | new (mozilla::KnownNotNull, ptr_CreateFileParams()) CreateFileParams(std::move(aOther)); |
249 | 0 | mType = TCreateFileParams; |
250 | 0 | } |
251 | | |
252 | | MOZ_IMPLICIT DatabaseRequestParams::DatabaseRequestParams(const DatabaseRequestParams& aOther) |
253 | 0 | { |
254 | 0 | (aOther).AssertSanity(); |
255 | 0 | switch ((aOther).type()) { |
256 | 0 | case TCreateFileParams: |
257 | 0 | { |
258 | 0 | new (mozilla::KnownNotNull, ptr_CreateFileParams()) CreateFileParams((aOther).get_CreateFileParams()); |
259 | 0 | break; |
260 | 0 | } |
261 | 0 | case T__None: |
262 | 0 | { |
263 | 0 | break; |
264 | 0 | } |
265 | 0 | default: |
266 | 0 | { |
267 | 0 | mozilla::ipc::LogicError("unreached"); |
268 | 0 | return; |
269 | 0 | } |
270 | 0 | } |
271 | 0 | mType = (aOther).type(); |
272 | 0 | } |
273 | | |
274 | | MOZ_IMPLICIT DatabaseRequestParams::DatabaseRequestParams(DatabaseRequestParams&& aOther) |
275 | 0 | { |
276 | 0 | (aOther).AssertSanity(); |
277 | 0 | Type t = (aOther).type(); |
278 | 0 | switch (t) { |
279 | 0 | case TCreateFileParams: |
280 | 0 | { |
281 | 0 | new (mozilla::KnownNotNull, ptr_CreateFileParams()) CreateFileParams(std::move((aOther).get_CreateFileParams())); |
282 | 0 | static_cast<void>((aOther).MaybeDestroy(T__None)); |
283 | 0 | break; |
284 | 0 | } |
285 | 0 | case T__None: |
286 | 0 | { |
287 | 0 | break; |
288 | 0 | } |
289 | 0 | default: |
290 | 0 | { |
291 | 0 | mozilla::ipc::LogicError("unreached"); |
292 | 0 | return; |
293 | 0 | } |
294 | 0 | } |
295 | 0 | (aOther).mType = T__None; |
296 | 0 | mType = t; |
297 | 0 | } |
298 | | |
299 | | DatabaseRequestParams::~DatabaseRequestParams() |
300 | 0 | { |
301 | 0 | static_cast<void>(MaybeDestroy(T__None)); |
302 | 0 | } |
303 | | |
304 | | auto DatabaseRequestParams::operator=(const CreateFileParams& aRhs) -> DatabaseRequestParams& |
305 | 0 | { |
306 | 0 | if (MaybeDestroy(TCreateFileParams)) { |
307 | 0 | new (mozilla::KnownNotNull, ptr_CreateFileParams()) CreateFileParams; |
308 | 0 | } |
309 | 0 | (*(ptr_CreateFileParams())) = aRhs; |
310 | 0 | mType = TCreateFileParams; |
311 | 0 | return (*(this)); |
312 | 0 | } |
313 | | |
314 | | auto DatabaseRequestParams::operator=(CreateFileParams&& aRhs) -> DatabaseRequestParams& |
315 | 0 | { |
316 | 0 | if (MaybeDestroy(TCreateFileParams)) { |
317 | 0 | new (mozilla::KnownNotNull, ptr_CreateFileParams()) CreateFileParams; |
318 | 0 | } |
319 | 0 | (*(ptr_CreateFileParams())) = std::move(aRhs); |
320 | 0 | mType = TCreateFileParams; |
321 | 0 | return (*(this)); |
322 | 0 | } |
323 | | |
324 | | auto DatabaseRequestParams::operator=(const DatabaseRequestParams& aRhs) -> DatabaseRequestParams& |
325 | 0 | { |
326 | 0 | (aRhs).AssertSanity(); |
327 | 0 | Type t = (aRhs).type(); |
328 | 0 | switch (t) { |
329 | 0 | case TCreateFileParams: |
330 | 0 | { |
331 | 0 | if (MaybeDestroy(t)) { |
332 | 0 | new (mozilla::KnownNotNull, ptr_CreateFileParams()) CreateFileParams; |
333 | 0 | } |
334 | 0 | (*(ptr_CreateFileParams())) = (aRhs).get_CreateFileParams(); |
335 | 0 | break; |
336 | 0 | } |
337 | 0 | case T__None: |
338 | 0 | { |
339 | 0 | static_cast<void>(MaybeDestroy(t)); |
340 | 0 | break; |
341 | 0 | } |
342 | 0 | default: |
343 | 0 | { |
344 | 0 | mozilla::ipc::LogicError("unreached"); |
345 | 0 | break; |
346 | 0 | } |
347 | 0 | } |
348 | 0 | mType = t; |
349 | 0 | return (*(this)); |
350 | 0 | } |
351 | | |
352 | | auto DatabaseRequestParams::operator=(DatabaseRequestParams&& aRhs) -> DatabaseRequestParams& |
353 | 0 | { |
354 | 0 | (aRhs).AssertSanity(); |
355 | 0 | Type t = (aRhs).type(); |
356 | 0 | switch (t) { |
357 | 0 | case TCreateFileParams: |
358 | 0 | { |
359 | 0 | if (MaybeDestroy(t)) { |
360 | 0 | new (mozilla::KnownNotNull, ptr_CreateFileParams()) CreateFileParams; |
361 | 0 | } |
362 | 0 | (*(ptr_CreateFileParams())) = std::move((aRhs).get_CreateFileParams()); |
363 | 0 | static_cast<void>((aRhs).MaybeDestroy(T__None)); |
364 | 0 | break; |
365 | 0 | } |
366 | 0 | case T__None: |
367 | 0 | { |
368 | 0 | static_cast<void>(MaybeDestroy(t)); |
369 | 0 | break; |
370 | 0 | } |
371 | 0 | default: |
372 | 0 | { |
373 | 0 | mozilla::ipc::LogicError("unreached"); |
374 | 0 | break; |
375 | 0 | } |
376 | 0 | } |
377 | 0 | (aRhs).mType = T__None; |
378 | 0 | mType = t; |
379 | 0 | return (*(this)); |
380 | 0 | } |
381 | | |
382 | | auto DatabaseRequestParams::operator==(const CreateFileParams& aRhs) const -> bool |
383 | 0 | { |
384 | 0 | return (get_CreateFileParams()) == (aRhs); |
385 | 0 | } |
386 | | |
387 | | auto DatabaseRequestParams::operator==(const DatabaseRequestParams& aRhs) const -> bool |
388 | 0 | { |
389 | 0 | if ((type()) != ((aRhs).type())) { |
390 | 0 | return false; |
391 | 0 | } |
392 | 0 | |
393 | 0 | switch (type()) { |
394 | 0 | case TCreateFileParams: |
395 | 0 | { |
396 | 0 | return (get_CreateFileParams()) == ((aRhs).get_CreateFileParams()); |
397 | 0 | } |
398 | 0 | default: |
399 | 0 | { |
400 | 0 | mozilla::ipc::LogicError("unreached"); |
401 | 0 | return false; |
402 | 0 | } |
403 | 0 | } |
404 | 0 | } |
405 | | |
406 | | auto DatabaseRequestParams::get(CreateFileParams* aOutValue) const -> void |
407 | 0 | { |
408 | 0 | (*(aOutValue)) = get_CreateFileParams(); |
409 | 0 | } |
410 | | |
411 | | } // namespace indexedDB |
412 | | } // namespace dom |
413 | | } // namespace mozilla |
414 | | |
415 | | namespace mozilla { |
416 | | namespace ipc { |
417 | | auto IPDLParamTraits<mozilla::dom::indexedDB::DatabaseRequestParams>::Write( |
418 | | IPC::Message* aMsg, |
419 | | mozilla::ipc::IProtocol* aActor, |
420 | | const paramType& aVar) -> void |
421 | | { |
422 | | typedef mozilla::dom::indexedDB::DatabaseRequestParams union__; |
423 | | int type; |
424 | | type = (aVar).type(); |
425 | | WriteIPDLParam(aMsg, aActor, type); |
426 | | // Sentinel = 'DatabaseRequestParams' |
427 | | (aMsg)->WriteSentinel(564842685); |
428 | | |
429 | | switch (type) { |
430 | | case union__::TCreateFileParams: |
431 | | { |
432 | | WriteIPDLParam(aMsg, aActor, (aVar).get_CreateFileParams()); |
433 | | // Sentinel = 'TCreateFileParams' |
434 | | (aMsg)->WriteSentinel(1651067885); |
435 | | return; |
436 | | } |
437 | | default: |
438 | | { |
439 | | (aActor)->FatalError("unknown union type"); |
440 | | return; |
441 | | } |
442 | | } |
443 | | } |
444 | | |
445 | | auto IPDLParamTraits<mozilla::dom::indexedDB::DatabaseRequestParams>::Read( |
446 | | const IPC::Message* aMsg, |
447 | | PickleIterator* aIter, |
448 | | mozilla::ipc::IProtocol* aActor, |
449 | | paramType* aVar) -> bool |
450 | 0 | { |
451 | 0 | typedef mozilla::dom::indexedDB::DatabaseRequestParams union__; |
452 | 0 | int type; |
453 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&(type)))))) { |
454 | 0 | (aActor)->FatalError("Error deserializing type of union DatabaseRequestParams"); |
455 | 0 | return false; |
456 | 0 | } |
457 | 0 | // Sentinel = 'DatabaseRequestParams' |
458 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 564842685)))) { |
459 | 0 | mozilla::ipc::SentinelReadError("Error deserializing type of union DatabaseRequestParams"); |
460 | 0 | return false; |
461 | 0 | } |
462 | 0 | |
463 | 0 | switch (type) { |
464 | 0 | case union__::TCreateFileParams: |
465 | 0 | { |
466 | 0 | mozilla::dom::indexedDB::CreateFileParams tmp = mozilla::dom::indexedDB::CreateFileParams(); |
467 | 0 | (*(aVar)) = tmp; |
468 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_CreateFileParams())))))) { |
469 | 0 | (aActor)->FatalError("Error deserializing variant TCreateFileParams of union DatabaseRequestParams"); |
470 | 0 | return false; |
471 | 0 | } |
472 | 0 | // Sentinel = 'TCreateFileParams' |
473 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 1651067885)))) { |
474 | 0 | mozilla::ipc::SentinelReadError("Error deserializing variant TCreateFileParams of union DatabaseRequestParams"); |
475 | 0 | return false; |
476 | 0 | } |
477 | 0 | return true; |
478 | 0 | } |
479 | 0 | default: |
480 | 0 | { |
481 | 0 | (aActor)->FatalError("unknown union type"); |
482 | 0 | return false; |
483 | 0 | } |
484 | 0 | } |
485 | 0 | } |
486 | | |
487 | | } // namespace ipc |
488 | | } // namespace mozilla |
489 | | |
490 | | //----------------------------------------------------------------------------- |
491 | | // Method definitions for the IPDL type |union NullableVersion| |
492 | | // |
493 | | namespace mozilla { |
494 | | namespace dom { |
495 | | namespace indexedDB { |
496 | | auto NullableVersion::MaybeDestroy(Type aNewType) -> bool |
497 | 0 | { |
498 | 0 | if ((mType) == (T__None)) { |
499 | 0 | return true; |
500 | 0 | } |
501 | 0 | if ((mType) == (aNewType)) { |
502 | 0 | return false; |
503 | 0 | } |
504 | 0 | switch (mType) { |
505 | 0 | case Tnull_t: |
506 | 0 | { |
507 | 0 | (ptr_null_t())->~null_t__tdef(); |
508 | 0 | break; |
509 | 0 | } |
510 | 0 | case Tuint64_t: |
511 | 0 | { |
512 | 0 | (ptr_uint64_t())->~uint64_t__tdef(); |
513 | 0 | break; |
514 | 0 | } |
515 | 0 | default: |
516 | 0 | { |
517 | 0 | mozilla::ipc::LogicError("not reached"); |
518 | 0 | break; |
519 | 0 | } |
520 | 0 | } |
521 | 0 | return true; |
522 | 0 | } |
523 | | |
524 | | MOZ_IMPLICIT NullableVersion::NullableVersion(const null_t& aOther) |
525 | 0 | { |
526 | 0 | new (mozilla::KnownNotNull, ptr_null_t()) null_t(aOther); |
527 | 0 | mType = Tnull_t; |
528 | 0 | } |
529 | | |
530 | | MOZ_IMPLICIT NullableVersion::NullableVersion(null_t&& aOther) |
531 | 0 | { |
532 | 0 | new (mozilla::KnownNotNull, ptr_null_t()) null_t(std::move(aOther)); |
533 | 0 | mType = Tnull_t; |
534 | 0 | } |
535 | | |
536 | | MOZ_IMPLICIT NullableVersion::NullableVersion(const uint64_t& aOther) |
537 | 0 | { |
538 | 0 | new (mozilla::KnownNotNull, ptr_uint64_t()) uint64_t(aOther); |
539 | 0 | mType = Tuint64_t; |
540 | 0 | } |
541 | | |
542 | | MOZ_IMPLICIT NullableVersion::NullableVersion(uint64_t&& aOther) |
543 | 0 | { |
544 | 0 | new (mozilla::KnownNotNull, ptr_uint64_t()) uint64_t(std::move(aOther)); |
545 | 0 | mType = Tuint64_t; |
546 | 0 | } |
547 | | |
548 | | MOZ_IMPLICIT NullableVersion::NullableVersion(const NullableVersion& aOther) |
549 | 0 | { |
550 | 0 | (aOther).AssertSanity(); |
551 | 0 | switch ((aOther).type()) { |
552 | 0 | case Tnull_t: |
553 | 0 | { |
554 | 0 | new (mozilla::KnownNotNull, ptr_null_t()) null_t((aOther).get_null_t()); |
555 | 0 | break; |
556 | 0 | } |
557 | 0 | case Tuint64_t: |
558 | 0 | { |
559 | 0 | new (mozilla::KnownNotNull, ptr_uint64_t()) uint64_t((aOther).get_uint64_t()); |
560 | 0 | break; |
561 | 0 | } |
562 | 0 | case T__None: |
563 | 0 | { |
564 | 0 | break; |
565 | 0 | } |
566 | 0 | default: |
567 | 0 | { |
568 | 0 | mozilla::ipc::LogicError("unreached"); |
569 | 0 | return; |
570 | 0 | } |
571 | 0 | } |
572 | 0 | mType = (aOther).type(); |
573 | 0 | } |
574 | | |
575 | | MOZ_IMPLICIT NullableVersion::NullableVersion(NullableVersion&& aOther) |
576 | 0 | { |
577 | 0 | (aOther).AssertSanity(); |
578 | 0 | Type t = (aOther).type(); |
579 | 0 | switch (t) { |
580 | 0 | case Tnull_t: |
581 | 0 | { |
582 | 0 | new (mozilla::KnownNotNull, ptr_null_t()) null_t(std::move((aOther).get_null_t())); |
583 | 0 | static_cast<void>((aOther).MaybeDestroy(T__None)); |
584 | 0 | break; |
585 | 0 | } |
586 | 0 | case Tuint64_t: |
587 | 0 | { |
588 | 0 | new (mozilla::KnownNotNull, ptr_uint64_t()) uint64_t(std::move((aOther).get_uint64_t())); |
589 | 0 | static_cast<void>((aOther).MaybeDestroy(T__None)); |
590 | 0 | break; |
591 | 0 | } |
592 | 0 | case T__None: |
593 | 0 | { |
594 | 0 | break; |
595 | 0 | } |
596 | 0 | default: |
597 | 0 | { |
598 | 0 | mozilla::ipc::LogicError("unreached"); |
599 | 0 | return; |
600 | 0 | } |
601 | 0 | } |
602 | 0 | (aOther).mType = T__None; |
603 | 0 | mType = t; |
604 | 0 | } |
605 | | |
606 | | NullableVersion::~NullableVersion() |
607 | 0 | { |
608 | 0 | static_cast<void>(MaybeDestroy(T__None)); |
609 | 0 | } |
610 | | |
611 | | auto NullableVersion::operator=(const null_t& aRhs) -> NullableVersion& |
612 | 0 | { |
613 | 0 | if (MaybeDestroy(Tnull_t)) { |
614 | 0 | new (mozilla::KnownNotNull, ptr_null_t()) null_t; |
615 | 0 | } |
616 | 0 | (*(ptr_null_t())) = aRhs; |
617 | 0 | mType = Tnull_t; |
618 | 0 | return (*(this)); |
619 | 0 | } |
620 | | |
621 | | auto NullableVersion::operator=(null_t&& aRhs) -> NullableVersion& |
622 | 0 | { |
623 | 0 | if (MaybeDestroy(Tnull_t)) { |
624 | 0 | new (mozilla::KnownNotNull, ptr_null_t()) null_t; |
625 | 0 | } |
626 | 0 | (*(ptr_null_t())) = std::move(aRhs); |
627 | 0 | mType = Tnull_t; |
628 | 0 | return (*(this)); |
629 | 0 | } |
630 | | |
631 | | auto NullableVersion::operator=(const uint64_t& aRhs) -> NullableVersion& |
632 | 0 | { |
633 | 0 | if (MaybeDestroy(Tuint64_t)) { |
634 | 0 | new (mozilla::KnownNotNull, ptr_uint64_t()) uint64_t; |
635 | 0 | } |
636 | 0 | (*(ptr_uint64_t())) = aRhs; |
637 | 0 | mType = Tuint64_t; |
638 | 0 | return (*(this)); |
639 | 0 | } |
640 | | |
641 | | auto NullableVersion::operator=(uint64_t&& aRhs) -> NullableVersion& |
642 | 0 | { |
643 | 0 | if (MaybeDestroy(Tuint64_t)) { |
644 | 0 | new (mozilla::KnownNotNull, ptr_uint64_t()) uint64_t; |
645 | 0 | } |
646 | 0 | (*(ptr_uint64_t())) = std::move(aRhs); |
647 | 0 | mType = Tuint64_t; |
648 | 0 | return (*(this)); |
649 | 0 | } |
650 | | |
651 | | auto NullableVersion::operator=(const NullableVersion& aRhs) -> NullableVersion& |
652 | 0 | { |
653 | 0 | (aRhs).AssertSanity(); |
654 | 0 | Type t = (aRhs).type(); |
655 | 0 | switch (t) { |
656 | 0 | case Tnull_t: |
657 | 0 | { |
658 | 0 | if (MaybeDestroy(t)) { |
659 | 0 | new (mozilla::KnownNotNull, ptr_null_t()) null_t; |
660 | 0 | } |
661 | 0 | (*(ptr_null_t())) = (aRhs).get_null_t(); |
662 | 0 | break; |
663 | 0 | } |
664 | 0 | case Tuint64_t: |
665 | 0 | { |
666 | 0 | if (MaybeDestroy(t)) { |
667 | 0 | new (mozilla::KnownNotNull, ptr_uint64_t()) uint64_t; |
668 | 0 | } |
669 | 0 | (*(ptr_uint64_t())) = (aRhs).get_uint64_t(); |
670 | 0 | break; |
671 | 0 | } |
672 | 0 | case T__None: |
673 | 0 | { |
674 | 0 | static_cast<void>(MaybeDestroy(t)); |
675 | 0 | break; |
676 | 0 | } |
677 | 0 | default: |
678 | 0 | { |
679 | 0 | mozilla::ipc::LogicError("unreached"); |
680 | 0 | break; |
681 | 0 | } |
682 | 0 | } |
683 | 0 | mType = t; |
684 | 0 | return (*(this)); |
685 | 0 | } |
686 | | |
687 | | auto NullableVersion::operator=(NullableVersion&& aRhs) -> NullableVersion& |
688 | 0 | { |
689 | 0 | (aRhs).AssertSanity(); |
690 | 0 | Type t = (aRhs).type(); |
691 | 0 | switch (t) { |
692 | 0 | case Tnull_t: |
693 | 0 | { |
694 | 0 | if (MaybeDestroy(t)) { |
695 | 0 | new (mozilla::KnownNotNull, ptr_null_t()) null_t; |
696 | 0 | } |
697 | 0 | (*(ptr_null_t())) = std::move((aRhs).get_null_t()); |
698 | 0 | static_cast<void>((aRhs).MaybeDestroy(T__None)); |
699 | 0 | break; |
700 | 0 | } |
701 | 0 | case Tuint64_t: |
702 | 0 | { |
703 | 0 | if (MaybeDestroy(t)) { |
704 | 0 | new (mozilla::KnownNotNull, ptr_uint64_t()) uint64_t; |
705 | 0 | } |
706 | 0 | (*(ptr_uint64_t())) = std::move((aRhs).get_uint64_t()); |
707 | 0 | static_cast<void>((aRhs).MaybeDestroy(T__None)); |
708 | 0 | break; |
709 | 0 | } |
710 | 0 | case T__None: |
711 | 0 | { |
712 | 0 | static_cast<void>(MaybeDestroy(t)); |
713 | 0 | break; |
714 | 0 | } |
715 | 0 | default: |
716 | 0 | { |
717 | 0 | mozilla::ipc::LogicError("unreached"); |
718 | 0 | break; |
719 | 0 | } |
720 | 0 | } |
721 | 0 | (aRhs).mType = T__None; |
722 | 0 | mType = t; |
723 | 0 | return (*(this)); |
724 | 0 | } |
725 | | |
726 | | auto NullableVersion::operator==(const null_t& aRhs) const -> bool |
727 | 0 | { |
728 | 0 | return (get_null_t()) == (aRhs); |
729 | 0 | } |
730 | | |
731 | | auto NullableVersion::operator==(const uint64_t& aRhs) const -> bool |
732 | 0 | { |
733 | 0 | return (get_uint64_t()) == (aRhs); |
734 | 0 | } |
735 | | |
736 | | auto NullableVersion::operator==(const NullableVersion& aRhs) const -> bool |
737 | 0 | { |
738 | 0 | if ((type()) != ((aRhs).type())) { |
739 | 0 | return false; |
740 | 0 | } |
741 | 0 | |
742 | 0 | switch (type()) { |
743 | 0 | case Tnull_t: |
744 | 0 | { |
745 | 0 | return (get_null_t()) == ((aRhs).get_null_t()); |
746 | 0 | } |
747 | 0 | case Tuint64_t: |
748 | 0 | { |
749 | 0 | return (get_uint64_t()) == ((aRhs).get_uint64_t()); |
750 | 0 | } |
751 | 0 | default: |
752 | 0 | { |
753 | 0 | mozilla::ipc::LogicError("unreached"); |
754 | 0 | return false; |
755 | 0 | } |
756 | 0 | } |
757 | 0 | } |
758 | | |
759 | | auto NullableVersion::get(null_t* aOutValue) const -> void |
760 | 0 | { |
761 | 0 | (*(aOutValue)) = get_null_t(); |
762 | 0 | } |
763 | | |
764 | | auto NullableVersion::get(uint64_t* aOutValue) const -> void |
765 | 0 | { |
766 | 0 | (*(aOutValue)) = get_uint64_t(); |
767 | 0 | } |
768 | | |
769 | | } // namespace indexedDB |
770 | | } // namespace dom |
771 | | } // namespace mozilla |
772 | | |
773 | | namespace mozilla { |
774 | | namespace ipc { |
775 | | auto IPDLParamTraits<mozilla::dom::indexedDB::NullableVersion>::Write( |
776 | | IPC::Message* aMsg, |
777 | | mozilla::ipc::IProtocol* aActor, |
778 | | const paramType& aVar) -> void |
779 | | { |
780 | | typedef mozilla::dom::indexedDB::NullableVersion union__; |
781 | | int type; |
782 | | type = (aVar).type(); |
783 | | WriteIPDLParam(aMsg, aActor, type); |
784 | | // Sentinel = 'NullableVersion' |
785 | | (aMsg)->WriteSentinel(2984191162); |
786 | | |
787 | | switch (type) { |
788 | | case union__::Tnull_t: |
789 | | { |
790 | | WriteIPDLParam(aMsg, aActor, (aVar).get_null_t()); |
791 | | // Sentinel = 'Tnull_t' |
792 | | (aMsg)->WriteSentinel(3731137201); |
793 | | return; |
794 | | } |
795 | | case union__::Tuint64_t: |
796 | | { |
797 | | WriteIPDLParam(aMsg, aActor, (aVar).get_uint64_t()); |
798 | | // Sentinel = 'Tuint64_t' |
799 | | (aMsg)->WriteSentinel(1935076742); |
800 | | return; |
801 | | } |
802 | | default: |
803 | | { |
804 | | (aActor)->FatalError("unknown union type"); |
805 | | return; |
806 | | } |
807 | | } |
808 | | } |
809 | | |
810 | | auto IPDLParamTraits<mozilla::dom::indexedDB::NullableVersion>::Read( |
811 | | const IPC::Message* aMsg, |
812 | | PickleIterator* aIter, |
813 | | mozilla::ipc::IProtocol* aActor, |
814 | | paramType* aVar) -> bool |
815 | 0 | { |
816 | 0 | typedef mozilla::dom::indexedDB::NullableVersion union__; |
817 | 0 | int type; |
818 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&(type)))))) { |
819 | 0 | (aActor)->FatalError("Error deserializing type of union NullableVersion"); |
820 | 0 | return false; |
821 | 0 | } |
822 | 0 | // Sentinel = 'NullableVersion' |
823 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 2984191162)))) { |
824 | 0 | mozilla::ipc::SentinelReadError("Error deserializing type of union NullableVersion"); |
825 | 0 | return false; |
826 | 0 | } |
827 | 0 | |
828 | 0 | switch (type) { |
829 | 0 | case union__::Tnull_t: |
830 | 0 | { |
831 | 0 | mozilla::null_t tmp = mozilla::null_t(); |
832 | 0 | (*(aVar)) = tmp; |
833 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_null_t())))))) { |
834 | 0 | (aActor)->FatalError("Error deserializing variant Tnull_t of union NullableVersion"); |
835 | 0 | return false; |
836 | 0 | } |
837 | 0 | // Sentinel = 'Tnull_t' |
838 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 3731137201)))) { |
839 | 0 | mozilla::ipc::SentinelReadError("Error deserializing variant Tnull_t of union NullableVersion"); |
840 | 0 | return false; |
841 | 0 | } |
842 | 0 | return true; |
843 | 0 | } |
844 | 0 | case union__::Tuint64_t: |
845 | 0 | { |
846 | 0 | uint64_t tmp = uint64_t(); |
847 | 0 | (*(aVar)) = tmp; |
848 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_uint64_t())))))) { |
849 | 0 | (aActor)->FatalError("Error deserializing variant Tuint64_t of union NullableVersion"); |
850 | 0 | return false; |
851 | 0 | } |
852 | 0 | // Sentinel = 'Tuint64_t' |
853 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 1935076742)))) { |
854 | 0 | mozilla::ipc::SentinelReadError("Error deserializing variant Tuint64_t of union NullableVersion"); |
855 | 0 | return false; |
856 | 0 | } |
857 | 0 | return true; |
858 | 0 | } |
859 | 0 | default: |
860 | 0 | { |
861 | 0 | (aActor)->FatalError("unknown union type"); |
862 | 0 | return false; |
863 | 0 | } |
864 | 0 | } |
865 | 0 | } |
866 | | |
867 | | } // namespace ipc |
868 | | } // namespace mozilla |