/work/obj-fuzz/ipc/ipdl/PURLClassifierInfo.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/PURLClassifierInfo.h" |
8 | | |
9 | | |
10 | | //----------------------------------------------------------------------------- |
11 | | // Method definitions for the IPDL type |struct ClassifierInfo| |
12 | | // |
13 | | namespace mozilla { |
14 | | namespace dom { |
15 | | auto ClassifierInfo::operator==(const ClassifierInfo& _o) const -> bool |
16 | 0 | { |
17 | 0 | if ((!((list()) == ((_o).list())))) { |
18 | 0 | return false; |
19 | 0 | } |
20 | 0 | if ((!((provider()) == ((_o).provider())))) { |
21 | 0 | return false; |
22 | 0 | } |
23 | 0 | if ((!((fullhash()) == ((_o).fullhash())))) { |
24 | 0 | return false; |
25 | 0 | } |
26 | 0 | return true; |
27 | 0 | } |
28 | | |
29 | | auto ClassifierInfo::operator!=(const ClassifierInfo& _o) const -> bool |
30 | 0 | { |
31 | 0 | return (!(operator==(_o))); |
32 | 0 | } |
33 | | |
34 | | } // namespace dom |
35 | | } // namespace mozilla |
36 | | |
37 | | namespace mozilla { |
38 | | namespace ipc { |
39 | | auto IPDLParamTraits<mozilla::dom::ClassifierInfo>::Write( |
40 | | IPC::Message* aMsg, |
41 | | mozilla::ipc::IProtocol* aActor, |
42 | | const paramType& aVar) -> void |
43 | 0 | { |
44 | 0 | WriteIPDLParam(aMsg, aActor, (aVar).list()); |
45 | 0 | // Sentinel = 'list' |
46 | 0 | (aMsg)->WriteSentinel(1914335340); |
47 | 0 | WriteIPDLParam(aMsg, aActor, (aVar).provider()); |
48 | 0 | // Sentinel = 'provider' |
49 | 0 | (aMsg)->WriteSentinel(3034771127); |
50 | 0 | WriteIPDLParam(aMsg, aActor, (aVar).fullhash()); |
51 | 0 | // Sentinel = 'fullhash' |
52 | 0 | (aMsg)->WriteSentinel(2065751027); |
53 | 0 | } |
54 | | |
55 | | auto IPDLParamTraits<mozilla::dom::ClassifierInfo>::Read( |
56 | | const IPC::Message* aMsg, |
57 | | PickleIterator* aIter, |
58 | | mozilla::ipc::IProtocol* aActor, |
59 | | paramType* aVar) -> bool |
60 | 0 | { |
61 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->list())))))) { |
62 | 0 | (aActor)->FatalError("Error deserializing 'list' (nsCString) member of 'ClassifierInfo'"); |
63 | 0 | return false; |
64 | 0 | } |
65 | 0 | // Sentinel = 'list' |
66 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 1914335340)))) { |
67 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'list' (nsCString) member of 'ClassifierInfo'"); |
68 | 0 | return false; |
69 | 0 | } |
70 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->provider())))))) { |
71 | 0 | (aActor)->FatalError("Error deserializing 'provider' (nsCString) member of 'ClassifierInfo'"); |
72 | 0 | return false; |
73 | 0 | } |
74 | 0 | // Sentinel = 'provider' |
75 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 3034771127)))) { |
76 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'provider' (nsCString) member of 'ClassifierInfo'"); |
77 | 0 | return false; |
78 | 0 | } |
79 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->fullhash())))))) { |
80 | 0 | (aActor)->FatalError("Error deserializing 'fullhash' (nsCString) member of 'ClassifierInfo'"); |
81 | 0 | return false; |
82 | 0 | } |
83 | 0 | // Sentinel = 'fullhash' |
84 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 2065751027)))) { |
85 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'fullhash' (nsCString) member of 'ClassifierInfo'"); |
86 | 0 | return false; |
87 | 0 | } |
88 | 0 | return true; |
89 | 0 | } |
90 | | |
91 | | } // namespace ipc |
92 | | } // namespace mozilla |
93 | | |
94 | | //----------------------------------------------------------------------------- |
95 | | // Method definitions for the IPDL type |union MaybeInfo| |
96 | | // |
97 | | namespace mozilla { |
98 | | namespace dom { |
99 | | auto MaybeInfo::MaybeDestroy(Type aNewType) -> bool |
100 | 0 | { |
101 | 0 | if ((mType) == (T__None)) { |
102 | 0 | return true; |
103 | 0 | } |
104 | 0 | if ((mType) == (aNewType)) { |
105 | 0 | return false; |
106 | 0 | } |
107 | 0 | switch (mType) { |
108 | 0 | case TClassifierInfo: |
109 | 0 | { |
110 | 0 | (ptr_ClassifierInfo())->~ClassifierInfo__tdef(); |
111 | 0 | break; |
112 | 0 | } |
113 | 0 | case Tvoid_t: |
114 | 0 | { |
115 | 0 | (ptr_void_t())->~void_t__tdef(); |
116 | 0 | break; |
117 | 0 | } |
118 | 0 | default: |
119 | 0 | { |
120 | 0 | mozilla::ipc::LogicError("not reached"); |
121 | 0 | break; |
122 | 0 | } |
123 | 0 | } |
124 | 0 | return true; |
125 | 0 | } |
126 | | |
127 | | MOZ_IMPLICIT MaybeInfo::MaybeInfo(const ClassifierInfo& aOther) |
128 | 0 | { |
129 | 0 | new (mozilla::KnownNotNull, ptr_ClassifierInfo()) ClassifierInfo(aOther); |
130 | 0 | mType = TClassifierInfo; |
131 | 0 | } |
132 | | |
133 | | MOZ_IMPLICIT MaybeInfo::MaybeInfo(ClassifierInfo&& aOther) |
134 | 0 | { |
135 | 0 | new (mozilla::KnownNotNull, ptr_ClassifierInfo()) ClassifierInfo(std::move(aOther)); |
136 | 0 | mType = TClassifierInfo; |
137 | 0 | } |
138 | | |
139 | | MOZ_IMPLICIT MaybeInfo::MaybeInfo(const void_t& aOther) |
140 | 0 | { |
141 | 0 | new (mozilla::KnownNotNull, ptr_void_t()) void_t(aOther); |
142 | 0 | mType = Tvoid_t; |
143 | 0 | } |
144 | | |
145 | | MOZ_IMPLICIT MaybeInfo::MaybeInfo(void_t&& aOther) |
146 | 0 | { |
147 | 0 | new (mozilla::KnownNotNull, ptr_void_t()) void_t(std::move(aOther)); |
148 | 0 | mType = Tvoid_t; |
149 | 0 | } |
150 | | |
151 | | MOZ_IMPLICIT MaybeInfo::MaybeInfo(const MaybeInfo& aOther) |
152 | 0 | { |
153 | 0 | (aOther).AssertSanity(); |
154 | 0 | switch ((aOther).type()) { |
155 | 0 | case TClassifierInfo: |
156 | 0 | { |
157 | 0 | new (mozilla::KnownNotNull, ptr_ClassifierInfo()) ClassifierInfo((aOther).get_ClassifierInfo()); |
158 | 0 | break; |
159 | 0 | } |
160 | 0 | case Tvoid_t: |
161 | 0 | { |
162 | 0 | new (mozilla::KnownNotNull, ptr_void_t()) void_t((aOther).get_void_t()); |
163 | 0 | break; |
164 | 0 | } |
165 | 0 | case T__None: |
166 | 0 | { |
167 | 0 | break; |
168 | 0 | } |
169 | 0 | default: |
170 | 0 | { |
171 | 0 | mozilla::ipc::LogicError("unreached"); |
172 | 0 | return; |
173 | 0 | } |
174 | 0 | } |
175 | 0 | mType = (aOther).type(); |
176 | 0 | } |
177 | | |
178 | | MOZ_IMPLICIT MaybeInfo::MaybeInfo(MaybeInfo&& aOther) |
179 | 0 | { |
180 | 0 | (aOther).AssertSanity(); |
181 | 0 | Type t = (aOther).type(); |
182 | 0 | switch (t) { |
183 | 0 | case TClassifierInfo: |
184 | 0 | { |
185 | 0 | new (mozilla::KnownNotNull, ptr_ClassifierInfo()) ClassifierInfo(std::move((aOther).get_ClassifierInfo())); |
186 | 0 | static_cast<void>((aOther).MaybeDestroy(T__None)); |
187 | 0 | break; |
188 | 0 | } |
189 | 0 | case Tvoid_t: |
190 | 0 | { |
191 | 0 | new (mozilla::KnownNotNull, ptr_void_t()) void_t(std::move((aOther).get_void_t())); |
192 | 0 | static_cast<void>((aOther).MaybeDestroy(T__None)); |
193 | 0 | break; |
194 | 0 | } |
195 | 0 | case T__None: |
196 | 0 | { |
197 | 0 | break; |
198 | 0 | } |
199 | 0 | default: |
200 | 0 | { |
201 | 0 | mozilla::ipc::LogicError("unreached"); |
202 | 0 | return; |
203 | 0 | } |
204 | 0 | } |
205 | 0 | (aOther).mType = T__None; |
206 | 0 | mType = t; |
207 | 0 | } |
208 | | |
209 | | MaybeInfo::~MaybeInfo() |
210 | 0 | { |
211 | 0 | static_cast<void>(MaybeDestroy(T__None)); |
212 | 0 | } |
213 | | |
214 | | auto MaybeInfo::operator=(const ClassifierInfo& aRhs) -> MaybeInfo& |
215 | 0 | { |
216 | 0 | if (MaybeDestroy(TClassifierInfo)) { |
217 | 0 | new (mozilla::KnownNotNull, ptr_ClassifierInfo()) ClassifierInfo; |
218 | 0 | } |
219 | 0 | (*(ptr_ClassifierInfo())) = aRhs; |
220 | 0 | mType = TClassifierInfo; |
221 | 0 | return (*(this)); |
222 | 0 | } |
223 | | |
224 | | auto MaybeInfo::operator=(ClassifierInfo&& aRhs) -> MaybeInfo& |
225 | 0 | { |
226 | 0 | if (MaybeDestroy(TClassifierInfo)) { |
227 | 0 | new (mozilla::KnownNotNull, ptr_ClassifierInfo()) ClassifierInfo; |
228 | 0 | } |
229 | 0 | (*(ptr_ClassifierInfo())) = std::move(aRhs); |
230 | 0 | mType = TClassifierInfo; |
231 | 0 | return (*(this)); |
232 | 0 | } |
233 | | |
234 | | auto MaybeInfo::operator=(const void_t& aRhs) -> MaybeInfo& |
235 | 0 | { |
236 | 0 | if (MaybeDestroy(Tvoid_t)) { |
237 | 0 | new (mozilla::KnownNotNull, ptr_void_t()) void_t; |
238 | 0 | } |
239 | 0 | (*(ptr_void_t())) = aRhs; |
240 | 0 | mType = Tvoid_t; |
241 | 0 | return (*(this)); |
242 | 0 | } |
243 | | |
244 | | auto MaybeInfo::operator=(void_t&& aRhs) -> MaybeInfo& |
245 | 0 | { |
246 | 0 | if (MaybeDestroy(Tvoid_t)) { |
247 | 0 | new (mozilla::KnownNotNull, ptr_void_t()) void_t; |
248 | 0 | } |
249 | 0 | (*(ptr_void_t())) = std::move(aRhs); |
250 | 0 | mType = Tvoid_t; |
251 | 0 | return (*(this)); |
252 | 0 | } |
253 | | |
254 | | auto MaybeInfo::operator=(const MaybeInfo& aRhs) -> MaybeInfo& |
255 | 0 | { |
256 | 0 | (aRhs).AssertSanity(); |
257 | 0 | Type t = (aRhs).type(); |
258 | 0 | switch (t) { |
259 | 0 | case TClassifierInfo: |
260 | 0 | { |
261 | 0 | if (MaybeDestroy(t)) { |
262 | 0 | new (mozilla::KnownNotNull, ptr_ClassifierInfo()) ClassifierInfo; |
263 | 0 | } |
264 | 0 | (*(ptr_ClassifierInfo())) = (aRhs).get_ClassifierInfo(); |
265 | 0 | break; |
266 | 0 | } |
267 | 0 | case Tvoid_t: |
268 | 0 | { |
269 | 0 | if (MaybeDestroy(t)) { |
270 | 0 | new (mozilla::KnownNotNull, ptr_void_t()) void_t; |
271 | 0 | } |
272 | 0 | (*(ptr_void_t())) = (aRhs).get_void_t(); |
273 | 0 | break; |
274 | 0 | } |
275 | 0 | case T__None: |
276 | 0 | { |
277 | 0 | static_cast<void>(MaybeDestroy(t)); |
278 | 0 | break; |
279 | 0 | } |
280 | 0 | default: |
281 | 0 | { |
282 | 0 | mozilla::ipc::LogicError("unreached"); |
283 | 0 | break; |
284 | 0 | } |
285 | 0 | } |
286 | 0 | mType = t; |
287 | 0 | return (*(this)); |
288 | 0 | } |
289 | | |
290 | | auto MaybeInfo::operator=(MaybeInfo&& aRhs) -> MaybeInfo& |
291 | 0 | { |
292 | 0 | (aRhs).AssertSanity(); |
293 | 0 | Type t = (aRhs).type(); |
294 | 0 | switch (t) { |
295 | 0 | case TClassifierInfo: |
296 | 0 | { |
297 | 0 | if (MaybeDestroy(t)) { |
298 | 0 | new (mozilla::KnownNotNull, ptr_ClassifierInfo()) ClassifierInfo; |
299 | 0 | } |
300 | 0 | (*(ptr_ClassifierInfo())) = std::move((aRhs).get_ClassifierInfo()); |
301 | 0 | static_cast<void>((aRhs).MaybeDestroy(T__None)); |
302 | 0 | break; |
303 | 0 | } |
304 | 0 | case Tvoid_t: |
305 | 0 | { |
306 | 0 | if (MaybeDestroy(t)) { |
307 | 0 | new (mozilla::KnownNotNull, ptr_void_t()) void_t; |
308 | 0 | } |
309 | 0 | (*(ptr_void_t())) = std::move((aRhs).get_void_t()); |
310 | 0 | static_cast<void>((aRhs).MaybeDestroy(T__None)); |
311 | 0 | break; |
312 | 0 | } |
313 | 0 | case T__None: |
314 | 0 | { |
315 | 0 | static_cast<void>(MaybeDestroy(t)); |
316 | 0 | break; |
317 | 0 | } |
318 | 0 | default: |
319 | 0 | { |
320 | 0 | mozilla::ipc::LogicError("unreached"); |
321 | 0 | break; |
322 | 0 | } |
323 | 0 | } |
324 | 0 | (aRhs).mType = T__None; |
325 | 0 | mType = t; |
326 | 0 | return (*(this)); |
327 | 0 | } |
328 | | |
329 | | auto MaybeInfo::operator==(const ClassifierInfo& aRhs) const -> bool |
330 | 0 | { |
331 | 0 | return (get_ClassifierInfo()) == (aRhs); |
332 | 0 | } |
333 | | |
334 | | auto MaybeInfo::operator==(const void_t& aRhs) const -> bool |
335 | 0 | { |
336 | 0 | return (get_void_t()) == (aRhs); |
337 | 0 | } |
338 | | |
339 | | auto MaybeInfo::operator==(const MaybeInfo& aRhs) const -> bool |
340 | 0 | { |
341 | 0 | if ((type()) != ((aRhs).type())) { |
342 | 0 | return false; |
343 | 0 | } |
344 | 0 | |
345 | 0 | switch (type()) { |
346 | 0 | case TClassifierInfo: |
347 | 0 | { |
348 | 0 | return (get_ClassifierInfo()) == ((aRhs).get_ClassifierInfo()); |
349 | 0 | } |
350 | 0 | case Tvoid_t: |
351 | 0 | { |
352 | 0 | return (get_void_t()) == ((aRhs).get_void_t()); |
353 | 0 | } |
354 | 0 | default: |
355 | 0 | { |
356 | 0 | mozilla::ipc::LogicError("unreached"); |
357 | 0 | return false; |
358 | 0 | } |
359 | 0 | } |
360 | 0 | } |
361 | | |
362 | | auto MaybeInfo::get(ClassifierInfo* aOutValue) const -> void |
363 | 0 | { |
364 | 0 | (*(aOutValue)) = get_ClassifierInfo(); |
365 | 0 | } |
366 | | |
367 | | auto MaybeInfo::get(void_t* aOutValue) const -> void |
368 | 0 | { |
369 | 0 | (*(aOutValue)) = get_void_t(); |
370 | 0 | } |
371 | | |
372 | | } // namespace dom |
373 | | } // namespace mozilla |
374 | | |
375 | | namespace mozilla { |
376 | | namespace ipc { |
377 | | auto IPDLParamTraits<mozilla::dom::MaybeInfo>::Write( |
378 | | IPC::Message* aMsg, |
379 | | mozilla::ipc::IProtocol* aActor, |
380 | | const paramType& aVar) -> void |
381 | | { |
382 | | typedef mozilla::dom::MaybeInfo union__; |
383 | | int type; |
384 | | type = (aVar).type(); |
385 | | WriteIPDLParam(aMsg, aActor, type); |
386 | | // Sentinel = 'MaybeInfo' |
387 | | (aMsg)->WriteSentinel(3293711665); |
388 | | |
389 | | switch (type) { |
390 | | case union__::TClassifierInfo: |
391 | | { |
392 | | WriteIPDLParam(aMsg, aActor, (aVar).get_ClassifierInfo()); |
393 | | // Sentinel = 'TClassifierInfo' |
394 | | (aMsg)->WriteSentinel(1454833332); |
395 | | return; |
396 | | } |
397 | | case union__::Tvoid_t: |
398 | | { |
399 | | WriteIPDLParam(aMsg, aActor, (aVar).get_void_t()); |
400 | | // Sentinel = 'Tvoid_t' |
401 | | (aMsg)->WriteSentinel(3041273328); |
402 | | return; |
403 | | } |
404 | | default: |
405 | | { |
406 | | (aActor)->FatalError("unknown union type"); |
407 | | return; |
408 | | } |
409 | | } |
410 | | } |
411 | | |
412 | | auto IPDLParamTraits<mozilla::dom::MaybeInfo>::Read( |
413 | | const IPC::Message* aMsg, |
414 | | PickleIterator* aIter, |
415 | | mozilla::ipc::IProtocol* aActor, |
416 | | paramType* aVar) -> bool |
417 | 0 | { |
418 | 0 | typedef mozilla::dom::MaybeInfo union__; |
419 | 0 | int type; |
420 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&(type)))))) { |
421 | 0 | (aActor)->FatalError("Error deserializing type of union MaybeInfo"); |
422 | 0 | return false; |
423 | 0 | } |
424 | 0 | // Sentinel = 'MaybeInfo' |
425 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 3293711665)))) { |
426 | 0 | mozilla::ipc::SentinelReadError("Error deserializing type of union MaybeInfo"); |
427 | 0 | return false; |
428 | 0 | } |
429 | 0 | |
430 | 0 | switch (type) { |
431 | 0 | case union__::TClassifierInfo: |
432 | 0 | { |
433 | 0 | mozilla::dom::ClassifierInfo tmp = mozilla::dom::ClassifierInfo(); |
434 | 0 | (*(aVar)) = tmp; |
435 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_ClassifierInfo())))))) { |
436 | 0 | (aActor)->FatalError("Error deserializing variant TClassifierInfo of union MaybeInfo"); |
437 | 0 | return false; |
438 | 0 | } |
439 | 0 | // Sentinel = 'TClassifierInfo' |
440 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 1454833332)))) { |
441 | 0 | mozilla::ipc::SentinelReadError("Error deserializing variant TClassifierInfo of union MaybeInfo"); |
442 | 0 | return false; |
443 | 0 | } |
444 | 0 | return true; |
445 | 0 | } |
446 | 0 | case union__::Tvoid_t: |
447 | 0 | { |
448 | 0 | mozilla::void_t tmp = mozilla::void_t(); |
449 | 0 | (*(aVar)) = tmp; |
450 | 0 | if ((!(ReadIPDLParam(aMsg, aIter, aActor, (&((aVar)->get_void_t())))))) { |
451 | 0 | (aActor)->FatalError("Error deserializing variant Tvoid_t of union MaybeInfo"); |
452 | 0 | return false; |
453 | 0 | } |
454 | 0 | // Sentinel = 'Tvoid_t' |
455 | 0 | if ((!((aMsg)->ReadSentinel(aIter, 3041273328)))) { |
456 | 0 | mozilla::ipc::SentinelReadError("Error deserializing variant Tvoid_t of union MaybeInfo"); |
457 | 0 | return false; |
458 | 0 | } |
459 | 0 | return true; |
460 | 0 | } |
461 | 0 | default: |
462 | 0 | { |
463 | 0 | (aActor)->FatalError("unknown union type"); |
464 | 0 | return false; |
465 | 0 | } |
466 | 0 | } |
467 | 0 | } |
468 | | |
469 | | } // namespace ipc |
470 | | } // namespace mozilla |