Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/ipc/PBackgroundSharedTypes.h"
8 :
9 :
10 : //-----------------------------------------------------------------------------
11 : // Method definitions for the IPDL type |union ContentPrincipalInfoOriginNoSuffix|
12 : //
13 : namespace mozilla {
14 : namespace ipc {
15 87 : auto ContentPrincipalInfoOriginNoSuffix::MaybeDestroy(Type aNewType) -> bool
16 : {
17 87 : if ((mType) == (T__None)) {
18 47 : return true;
19 : }
20 40 : if ((mType) == (aNewType)) {
21 0 : return false;
22 : }
23 40 : switch (mType) {
24 : case TnsCString:
25 : {
26 37 : (ptr_nsCString())->~nsCString__tdef();
27 37 : break;
28 : }
29 : case Tvoid_t:
30 : {
31 3 : (ptr_void_t())->~void_t__tdef();
32 3 : break;
33 : }
34 : default:
35 : {
36 0 : mozilla::ipc::LogicError("not reached");
37 0 : break;
38 : }
39 : }
40 40 : return true;
41 : }
42 :
43 0 : MOZ_IMPLICIT ContentPrincipalInfoOriginNoSuffix::ContentPrincipalInfoOriginNoSuffix(const nsCString& aOther)
44 : {
45 0 : new (mozilla::KnownNotNull, ptr_nsCString()) nsCString(aOther);
46 0 : mType = TnsCString;
47 0 : }
48 :
49 1 : MOZ_IMPLICIT ContentPrincipalInfoOriginNoSuffix::ContentPrincipalInfoOriginNoSuffix(const void_t& aOther)
50 : {
51 1 : new (mozilla::KnownNotNull, ptr_void_t()) void_t(aOther);
52 1 : mType = Tvoid_t;
53 1 : }
54 :
55 0 : MOZ_IMPLICIT ContentPrincipalInfoOriginNoSuffix::ContentPrincipalInfoOriginNoSuffix(const ContentPrincipalInfoOriginNoSuffix& aOther)
56 : {
57 0 : (aOther).AssertSanity();
58 0 : switch ((aOther).type()) {
59 : case TnsCString:
60 : {
61 0 : new (mozilla::KnownNotNull, ptr_nsCString()) nsCString((aOther).get_nsCString());
62 0 : break;
63 : }
64 : case Tvoid_t:
65 : {
66 0 : new (mozilla::KnownNotNull, ptr_void_t()) void_t((aOther).get_void_t());
67 0 : break;
68 : }
69 : case T__None:
70 : {
71 0 : break;
72 : }
73 : default:
74 : {
75 0 : mozilla::ipc::LogicError("unreached");
76 0 : return;
77 : }
78 : }
79 0 : mType = (aOther).type();
80 : }
81 :
82 88 : ContentPrincipalInfoOriginNoSuffix::~ContentPrincipalInfoOriginNoSuffix()
83 : {
84 44 : static_cast<void>(MaybeDestroy(T__None));
85 44 : }
86 :
87 9 : auto ContentPrincipalInfoOriginNoSuffix::operator=(const nsCString& aRhs) -> ContentPrincipalInfoOriginNoSuffix&
88 : {
89 9 : if (MaybeDestroy(TnsCString)) {
90 9 : new (mozilla::KnownNotNull, ptr_nsCString()) nsCString;
91 : }
92 9 : (*(ptr_nsCString())) = aRhs;
93 9 : mType = TnsCString;
94 9 : return (*(this));
95 : }
96 :
97 0 : auto ContentPrincipalInfoOriginNoSuffix::operator=(const void_t& aRhs) -> ContentPrincipalInfoOriginNoSuffix&
98 : {
99 0 : if (MaybeDestroy(Tvoid_t)) {
100 0 : new (mozilla::KnownNotNull, ptr_void_t()) void_t;
101 : }
102 0 : (*(ptr_void_t())) = aRhs;
103 0 : mType = Tvoid_t;
104 0 : return (*(this));
105 : }
106 :
107 34 : auto ContentPrincipalInfoOriginNoSuffix::operator=(const ContentPrincipalInfoOriginNoSuffix& aRhs) -> ContentPrincipalInfoOriginNoSuffix&
108 : {
109 34 : (aRhs).AssertSanity();
110 34 : Type t = (aRhs).type();
111 34 : switch (t) {
112 : case TnsCString:
113 : {
114 28 : if (MaybeDestroy(t)) {
115 28 : new (mozilla::KnownNotNull, ptr_nsCString()) nsCString;
116 : }
117 28 : (*(ptr_nsCString())) = (aRhs).get_nsCString();
118 28 : break;
119 : }
120 : case Tvoid_t:
121 : {
122 2 : if (MaybeDestroy(t)) {
123 2 : new (mozilla::KnownNotNull, ptr_void_t()) void_t;
124 : }
125 2 : (*(ptr_void_t())) = (aRhs).get_void_t();
126 2 : break;
127 : }
128 : case T__None:
129 : {
130 4 : static_cast<void>(MaybeDestroy(t));
131 4 : break;
132 : }
133 : default:
134 : {
135 0 : mozilla::ipc::LogicError("unreached");
136 0 : break;
137 : }
138 : }
139 34 : mType = t;
140 34 : return (*(this));
141 : }
142 :
143 0 : auto ContentPrincipalInfoOriginNoSuffix::operator==(const nsCString& aRhs) const -> bool
144 : {
145 0 : return (get_nsCString()) == (aRhs);
146 : }
147 :
148 0 : auto ContentPrincipalInfoOriginNoSuffix::operator==(const void_t& aRhs) const -> bool
149 : {
150 0 : return (get_void_t()) == (aRhs);
151 : }
152 :
153 0 : auto ContentPrincipalInfoOriginNoSuffix::operator==(const ContentPrincipalInfoOriginNoSuffix& aRhs) const -> bool
154 : {
155 0 : if ((type()) != ((aRhs).type())) {
156 0 : return false;
157 : }
158 :
159 0 : switch (type()) {
160 : case TnsCString:
161 : {
162 0 : return (get_nsCString()) == ((aRhs).get_nsCString());
163 : }
164 : case Tvoid_t:
165 : {
166 0 : return (get_void_t()) == ((aRhs).get_void_t());
167 : }
168 : default:
169 : {
170 0 : mozilla::ipc::LogicError("unreached");
171 0 : return false;
172 : }
173 : }
174 : }
175 :
176 0 : auto ContentPrincipalInfoOriginNoSuffix::get(nsCString* aOutValue) const -> void
177 : {
178 0 : (*(aOutValue)) = get_nsCString();
179 0 : }
180 :
181 0 : auto ContentPrincipalInfoOriginNoSuffix::get(void_t* aOutValue) const -> void
182 : {
183 0 : (*(aOutValue)) = get_void_t();
184 0 : }
185 :
186 : } // namespace ipc
187 : } // namespace mozilla
188 :
189 : //-----------------------------------------------------------------------------
190 : // Method definitions for the IPDL type |struct ContentPrincipalInfo|
191 : //
192 : namespace mozilla {
193 : namespace ipc {
194 32 : MOZ_IMPLICIT ContentPrincipalInfo::ContentPrincipalInfo() :
195 : attrs_(),
196 32 : spec_()
197 : {
198 32 : Init();
199 32 : }
200 :
201 38 : ContentPrincipalInfo::~ContentPrincipalInfo()
202 : {
203 38 : }
204 :
205 0 : auto ContentPrincipalInfo::operator==(const ContentPrincipalInfo& _o) const -> bool
206 : {
207 0 : if ((!((attrs()) == ((_o).attrs())))) {
208 0 : return false;
209 : }
210 0 : if ((!((originNoSuffix()) == ((_o).originNoSuffix())))) {
211 0 : return false;
212 : }
213 0 : if ((!((spec()) == ((_o).spec())))) {
214 0 : return false;
215 : }
216 0 : return true;
217 : }
218 :
219 0 : auto ContentPrincipalInfo::operator!=(const ContentPrincipalInfo& _o) const -> bool
220 : {
221 0 : return (!(operator==(_o)));
222 : }
223 :
224 38 : auto ContentPrincipalInfo::Init() -> void
225 : {
226 38 : }
227 :
228 34 : auto ContentPrincipalInfo::Assign(
229 : const OriginAttributes& _attrs,
230 : const ContentPrincipalInfoOriginNoSuffix& _originNoSuffix,
231 : const nsCString& _spec) -> void
232 : {
233 34 : attrs_ = _attrs;
234 34 : originNoSuffix_ = _originNoSuffix;
235 34 : spec_ = _spec;
236 34 : }
237 :
238 : } // namespace ipc
239 : } // namespace mozilla
240 :
241 : //-----------------------------------------------------------------------------
242 : // Method definitions for the IPDL type |struct SystemPrincipalInfo|
243 : //
244 : namespace mozilla {
245 : namespace ipc {
246 27 : SystemPrincipalInfo::~SystemPrincipalInfo()
247 : {
248 27 : }
249 :
250 0 : auto SystemPrincipalInfo::operator==(const SystemPrincipalInfo& _o) const -> bool
251 : {
252 0 : return true;
253 : }
254 :
255 0 : auto SystemPrincipalInfo::operator!=(const SystemPrincipalInfo& _o) const -> bool
256 : {
257 0 : return (!(operator==(_o)));
258 : }
259 :
260 42 : auto SystemPrincipalInfo::Init() -> void
261 : {
262 42 : }
263 :
264 65 : auto SystemPrincipalInfo::Assign() -> void
265 : {
266 65 : }
267 :
268 : } // namespace ipc
269 : } // namespace mozilla
270 :
271 : //-----------------------------------------------------------------------------
272 : // Method definitions for the IPDL type |struct NullPrincipalInfo|
273 : //
274 : namespace mozilla {
275 : namespace ipc {
276 0 : MOZ_IMPLICIT NullPrincipalInfo::NullPrincipalInfo() :
277 : attrs_(),
278 0 : spec_()
279 : {
280 0 : Init();
281 0 : }
282 :
283 0 : NullPrincipalInfo::~NullPrincipalInfo()
284 : {
285 0 : }
286 :
287 0 : auto NullPrincipalInfo::operator==(const NullPrincipalInfo& _o) const -> bool
288 : {
289 0 : if ((!((attrs()) == ((_o).attrs())))) {
290 0 : return false;
291 : }
292 0 : if ((!((spec()) == ((_o).spec())))) {
293 0 : return false;
294 : }
295 0 : return true;
296 : }
297 :
298 0 : auto NullPrincipalInfo::operator!=(const NullPrincipalInfo& _o) const -> bool
299 : {
300 0 : return (!(operator==(_o)));
301 : }
302 :
303 0 : auto NullPrincipalInfo::Init() -> void
304 : {
305 0 : }
306 :
307 0 : auto NullPrincipalInfo::Assign(
308 : const OriginAttributes& _attrs,
309 : const nsCString& _spec) -> void
310 : {
311 0 : attrs_ = _attrs;
312 0 : spec_ = _spec;
313 0 : }
314 :
315 : } // namespace ipc
316 : } // namespace mozilla
317 :
318 : //-----------------------------------------------------------------------------
319 : // Method definitions for the IPDL type |struct ExpandedPrincipalInfo|
320 : //
321 : namespace mozilla {
322 : namespace ipc {
323 0 : MOZ_IMPLICIT ExpandedPrincipalInfo::ExpandedPrincipalInfo() :
324 0 : attrs_()
325 : {
326 0 : Init();
327 0 : }
328 :
329 0 : ExpandedPrincipalInfo::~ExpandedPrincipalInfo()
330 : {
331 0 : delete whitelist_;
332 0 : }
333 :
334 0 : auto ExpandedPrincipalInfo::operator==(const ExpandedPrincipalInfo& _o) const -> bool
335 : {
336 0 : if ((!((attrs()) == ((_o).attrs())))) {
337 0 : return false;
338 : }
339 0 : if ((!((whitelist()) == ((_o).whitelist())))) {
340 0 : return false;
341 : }
342 0 : return true;
343 : }
344 :
345 0 : auto ExpandedPrincipalInfo::operator!=(const ExpandedPrincipalInfo& _o) const -> bool
346 : {
347 0 : return (!(operator==(_o)));
348 : }
349 :
350 0 : auto ExpandedPrincipalInfo::Init() -> void
351 : {
352 0 : whitelist_ = new nsTArray<PrincipalInfo>();
353 0 : }
354 :
355 0 : auto ExpandedPrincipalInfo::Assign(
356 : const OriginAttributes& _attrs,
357 : const nsTArray<PrincipalInfo>& _whitelist) -> void
358 : {
359 0 : attrs_ = _attrs;
360 0 : (*(whitelist_)) = _whitelist;
361 0 : }
362 :
363 : } // namespace ipc
364 : } // namespace mozilla
365 :
366 : //-----------------------------------------------------------------------------
367 : // Method definitions for the IPDL type |union PrincipalInfo|
368 : //
369 : namespace mozilla {
370 : namespace ipc {
371 97 : auto PrincipalInfo::MaybeDestroy(Type aNewType) -> bool
372 : {
373 97 : if ((mType) == (T__None)) {
374 61 : return true;
375 : }
376 36 : if ((mType) == (aNewType)) {
377 0 : return false;
378 : }
379 36 : switch (mType) {
380 : case TContentPrincipalInfo:
381 : {
382 28 : (ptr_ContentPrincipalInfo())->~ContentPrincipalInfo__tdef();
383 28 : break;
384 : }
385 : case TSystemPrincipalInfo:
386 : {
387 8 : (ptr_SystemPrincipalInfo())->~SystemPrincipalInfo__tdef();
388 8 : break;
389 : }
390 : case TNullPrincipalInfo:
391 : {
392 0 : (ptr_NullPrincipalInfo())->~NullPrincipalInfo__tdef();
393 0 : break;
394 : }
395 : case TExpandedPrincipalInfo:
396 : {
397 0 : delete ptr_ExpandedPrincipalInfo();
398 0 : break;
399 : }
400 : default:
401 : {
402 0 : mozilla::ipc::LogicError("not reached");
403 0 : break;
404 : }
405 : }
406 36 : return true;
407 : }
408 :
409 0 : MOZ_IMPLICIT PrincipalInfo::PrincipalInfo(const ContentPrincipalInfo& aOther)
410 : {
411 0 : new (mozilla::KnownNotNull, ptr_ContentPrincipalInfo()) ContentPrincipalInfo(aOther);
412 0 : mType = TContentPrincipalInfo;
413 0 : }
414 :
415 0 : MOZ_IMPLICIT PrincipalInfo::PrincipalInfo(const SystemPrincipalInfo& aOther)
416 : {
417 0 : new (mozilla::KnownNotNull, ptr_SystemPrincipalInfo()) SystemPrincipalInfo(aOther);
418 0 : mType = TSystemPrincipalInfo;
419 0 : }
420 :
421 0 : MOZ_IMPLICIT PrincipalInfo::PrincipalInfo(const NullPrincipalInfo& aOther)
422 : {
423 0 : new (mozilla::KnownNotNull, ptr_NullPrincipalInfo()) NullPrincipalInfo(aOther);
424 0 : mType = TNullPrincipalInfo;
425 0 : }
426 :
427 0 : MOZ_IMPLICIT PrincipalInfo::PrincipalInfo(const ExpandedPrincipalInfo& aOther)
428 : {
429 0 : ptr_ExpandedPrincipalInfo() = new ExpandedPrincipalInfo(aOther);
430 0 : mType = TExpandedPrincipalInfo;
431 0 : }
432 :
433 0 : MOZ_IMPLICIT PrincipalInfo::PrincipalInfo(const PrincipalInfo& aOther)
434 : {
435 0 : (aOther).AssertSanity();
436 0 : switch ((aOther).type()) {
437 : case TContentPrincipalInfo:
438 : {
439 0 : new (mozilla::KnownNotNull, ptr_ContentPrincipalInfo()) ContentPrincipalInfo((aOther).get_ContentPrincipalInfo());
440 0 : break;
441 : }
442 : case TSystemPrincipalInfo:
443 : {
444 0 : new (mozilla::KnownNotNull, ptr_SystemPrincipalInfo()) SystemPrincipalInfo((aOther).get_SystemPrincipalInfo());
445 0 : break;
446 : }
447 : case TNullPrincipalInfo:
448 : {
449 0 : new (mozilla::KnownNotNull, ptr_NullPrincipalInfo()) NullPrincipalInfo((aOther).get_NullPrincipalInfo());
450 0 : break;
451 : }
452 : case TExpandedPrincipalInfo:
453 : {
454 0 : ptr_ExpandedPrincipalInfo() = new ExpandedPrincipalInfo((aOther).get_ExpandedPrincipalInfo());
455 0 : break;
456 : }
457 : case T__None:
458 : {
459 0 : break;
460 : }
461 : default:
462 : {
463 0 : mozilla::ipc::LogicError("unreached");
464 0 : return;
465 : }
466 : }
467 0 : mType = (aOther).type();
468 : }
469 :
470 82 : PrincipalInfo::~PrincipalInfo()
471 : {
472 41 : static_cast<void>(MaybeDestroy(T__None));
473 41 : }
474 :
475 10 : auto PrincipalInfo::operator=(const ContentPrincipalInfo& aRhs) -> PrincipalInfo&
476 : {
477 10 : if (MaybeDestroy(TContentPrincipalInfo)) {
478 10 : new (mozilla::KnownNotNull, ptr_ContentPrincipalInfo()) ContentPrincipalInfo;
479 : }
480 10 : (*(ptr_ContentPrincipalInfo())) = aRhs;
481 10 : mType = TContentPrincipalInfo;
482 10 : return (*(this));
483 : }
484 :
485 19 : auto PrincipalInfo::operator=(const SystemPrincipalInfo& aRhs) -> PrincipalInfo&
486 : {
487 19 : if (MaybeDestroy(TSystemPrincipalInfo)) {
488 19 : new (mozilla::KnownNotNull, ptr_SystemPrincipalInfo()) SystemPrincipalInfo;
489 : }
490 19 : (*(ptr_SystemPrincipalInfo())) = aRhs;
491 19 : mType = TSystemPrincipalInfo;
492 19 : return (*(this));
493 : }
494 :
495 0 : auto PrincipalInfo::operator=(const NullPrincipalInfo& aRhs) -> PrincipalInfo&
496 : {
497 0 : if (MaybeDestroy(TNullPrincipalInfo)) {
498 0 : new (mozilla::KnownNotNull, ptr_NullPrincipalInfo()) NullPrincipalInfo;
499 : }
500 0 : (*(ptr_NullPrincipalInfo())) = aRhs;
501 0 : mType = TNullPrincipalInfo;
502 0 : return (*(this));
503 : }
504 :
505 0 : auto PrincipalInfo::operator=(const ExpandedPrincipalInfo& aRhs) -> PrincipalInfo&
506 : {
507 0 : if (MaybeDestroy(TExpandedPrincipalInfo)) {
508 0 : ptr_ExpandedPrincipalInfo() = new ExpandedPrincipalInfo;
509 : }
510 0 : (*(ptr_ExpandedPrincipalInfo())) = aRhs;
511 0 : mType = TExpandedPrincipalInfo;
512 0 : return (*(this));
513 : }
514 :
515 27 : auto PrincipalInfo::operator=(const PrincipalInfo& aRhs) -> PrincipalInfo&
516 : {
517 27 : (aRhs).AssertSanity();
518 27 : Type t = (aRhs).type();
519 27 : switch (t) {
520 : case TContentPrincipalInfo:
521 : {
522 18 : if (MaybeDestroy(t)) {
523 18 : new (mozilla::KnownNotNull, ptr_ContentPrincipalInfo()) ContentPrincipalInfo;
524 : }
525 18 : (*(ptr_ContentPrincipalInfo())) = (aRhs).get_ContentPrincipalInfo();
526 18 : break;
527 : }
528 : case TSystemPrincipalInfo:
529 : {
530 4 : if (MaybeDestroy(t)) {
531 4 : new (mozilla::KnownNotNull, ptr_SystemPrincipalInfo()) SystemPrincipalInfo;
532 : }
533 4 : (*(ptr_SystemPrincipalInfo())) = (aRhs).get_SystemPrincipalInfo();
534 4 : break;
535 : }
536 : case TNullPrincipalInfo:
537 : {
538 0 : if (MaybeDestroy(t)) {
539 0 : new (mozilla::KnownNotNull, ptr_NullPrincipalInfo()) NullPrincipalInfo;
540 : }
541 0 : (*(ptr_NullPrincipalInfo())) = (aRhs).get_NullPrincipalInfo();
542 0 : break;
543 : }
544 : case TExpandedPrincipalInfo:
545 : {
546 0 : if (MaybeDestroy(t)) {
547 0 : ptr_ExpandedPrincipalInfo() = new ExpandedPrincipalInfo;
548 : }
549 0 : (*(ptr_ExpandedPrincipalInfo())) = (aRhs).get_ExpandedPrincipalInfo();
550 0 : break;
551 : }
552 : case T__None:
553 : {
554 5 : static_cast<void>(MaybeDestroy(t));
555 5 : break;
556 : }
557 : default:
558 : {
559 0 : mozilla::ipc::LogicError("unreached");
560 0 : break;
561 : }
562 : }
563 27 : mType = t;
564 27 : return (*(this));
565 : }
566 :
567 0 : auto PrincipalInfo::operator==(const ContentPrincipalInfo& aRhs) const -> bool
568 : {
569 0 : return (get_ContentPrincipalInfo()) == (aRhs);
570 : }
571 :
572 0 : auto PrincipalInfo::operator==(const SystemPrincipalInfo& aRhs) const -> bool
573 : {
574 0 : return (get_SystemPrincipalInfo()) == (aRhs);
575 : }
576 :
577 0 : auto PrincipalInfo::operator==(const NullPrincipalInfo& aRhs) const -> bool
578 : {
579 0 : return (get_NullPrincipalInfo()) == (aRhs);
580 : }
581 :
582 0 : auto PrincipalInfo::operator==(const ExpandedPrincipalInfo& aRhs) const -> bool
583 : {
584 0 : return (get_ExpandedPrincipalInfo()) == (aRhs);
585 : }
586 :
587 0 : auto PrincipalInfo::operator==(const PrincipalInfo& aRhs) const -> bool
588 : {
589 0 : if ((type()) != ((aRhs).type())) {
590 0 : return false;
591 : }
592 :
593 0 : switch (type()) {
594 : case TContentPrincipalInfo:
595 : {
596 0 : return (get_ContentPrincipalInfo()) == ((aRhs).get_ContentPrincipalInfo());
597 : }
598 : case TSystemPrincipalInfo:
599 : {
600 0 : return (get_SystemPrincipalInfo()) == ((aRhs).get_SystemPrincipalInfo());
601 : }
602 : case TNullPrincipalInfo:
603 : {
604 0 : return (get_NullPrincipalInfo()) == ((aRhs).get_NullPrincipalInfo());
605 : }
606 : case TExpandedPrincipalInfo:
607 : {
608 0 : return (get_ExpandedPrincipalInfo()) == ((aRhs).get_ExpandedPrincipalInfo());
609 : }
610 : default:
611 : {
612 0 : mozilla::ipc::LogicError("unreached");
613 0 : return false;
614 : }
615 : }
616 : }
617 :
618 0 : auto PrincipalInfo::get(ContentPrincipalInfo* aOutValue) const -> void
619 : {
620 0 : (*(aOutValue)) = get_ContentPrincipalInfo();
621 0 : }
622 :
623 0 : auto PrincipalInfo::get(SystemPrincipalInfo* aOutValue) const -> void
624 : {
625 0 : (*(aOutValue)) = get_SystemPrincipalInfo();
626 0 : }
627 :
628 0 : auto PrincipalInfo::get(NullPrincipalInfo* aOutValue) const -> void
629 : {
630 0 : (*(aOutValue)) = get_NullPrincipalInfo();
631 0 : }
632 :
633 0 : auto PrincipalInfo::get(ExpandedPrincipalInfo* aOutValue) const -> void
634 : {
635 0 : (*(aOutValue)) = get_ExpandedPrincipalInfo();
636 0 : }
637 :
638 : } // namespace ipc
639 : } // namespace mozilla
640 :
641 : //-----------------------------------------------------------------------------
642 : // Method definitions for the IPDL type |union OptionalPrincipalInfo|
643 : //
644 : namespace mozilla {
645 : namespace ipc {
646 119 : auto OptionalPrincipalInfo::MaybeDestroy(Type aNewType) -> bool
647 : {
648 119 : if ((mType) == (T__None)) {
649 63 : return true;
650 : }
651 56 : if ((mType) == (aNewType)) {
652 0 : return false;
653 : }
654 56 : switch (mType) {
655 : case Tvoid_t:
656 : {
657 44 : (ptr_void_t())->~void_t__tdef();
658 44 : break;
659 : }
660 : case TPrincipalInfo:
661 : {
662 12 : (ptr_PrincipalInfo())->~PrincipalInfo__tdef();
663 12 : break;
664 : }
665 : default:
666 : {
667 0 : mozilla::ipc::LogicError("not reached");
668 0 : break;
669 : }
670 : }
671 56 : return true;
672 : }
673 :
674 9 : MOZ_IMPLICIT OptionalPrincipalInfo::OptionalPrincipalInfo(const void_t& aOther)
675 : {
676 9 : new (mozilla::KnownNotNull, ptr_void_t()) void_t(aOther);
677 9 : mType = Tvoid_t;
678 9 : }
679 :
680 0 : MOZ_IMPLICIT OptionalPrincipalInfo::OptionalPrincipalInfo(const PrincipalInfo& aOther)
681 : {
682 0 : new (mozilla::KnownNotNull, ptr_PrincipalInfo()) PrincipalInfo(aOther);
683 0 : mType = TPrincipalInfo;
684 0 : }
685 :
686 0 : MOZ_IMPLICIT OptionalPrincipalInfo::OptionalPrincipalInfo(const OptionalPrincipalInfo& aOther)
687 : {
688 0 : (aOther).AssertSanity();
689 0 : switch ((aOther).type()) {
690 : case Tvoid_t:
691 : {
692 0 : new (mozilla::KnownNotNull, ptr_void_t()) void_t((aOther).get_void_t());
693 0 : break;
694 : }
695 : case TPrincipalInfo:
696 : {
697 0 : new (mozilla::KnownNotNull, ptr_PrincipalInfo()) PrincipalInfo((aOther).get_PrincipalInfo());
698 0 : break;
699 : }
700 : case T__None:
701 : {
702 0 : break;
703 : }
704 : default:
705 : {
706 0 : mozilla::ipc::LogicError("unreached");
707 0 : return;
708 : }
709 : }
710 0 : mType = (aOther).type();
711 : }
712 :
713 126 : OptionalPrincipalInfo::~OptionalPrincipalInfo()
714 : {
715 63 : static_cast<void>(MaybeDestroy(T__None));
716 63 : }
717 :
718 7 : auto OptionalPrincipalInfo::operator=(const void_t& aRhs) -> OptionalPrincipalInfo&
719 : {
720 7 : if (MaybeDestroy(Tvoid_t)) {
721 7 : new (mozilla::KnownNotNull, ptr_void_t()) void_t;
722 : }
723 7 : (*(ptr_void_t())) = aRhs;
724 7 : mType = Tvoid_t;
725 7 : return (*(this));
726 : }
727 :
728 4 : auto OptionalPrincipalInfo::operator=(const PrincipalInfo& aRhs) -> OptionalPrincipalInfo&
729 : {
730 4 : if (MaybeDestroy(TPrincipalInfo)) {
731 4 : new (mozilla::KnownNotNull, ptr_PrincipalInfo()) PrincipalInfo;
732 : }
733 4 : (*(ptr_PrincipalInfo())) = aRhs;
734 4 : mType = TPrincipalInfo;
735 4 : return (*(this));
736 : }
737 :
738 45 : auto OptionalPrincipalInfo::operator=(const OptionalPrincipalInfo& aRhs) -> OptionalPrincipalInfo&
739 : {
740 45 : (aRhs).AssertSanity();
741 45 : Type t = (aRhs).type();
742 45 : switch (t) {
743 : case Tvoid_t:
744 : {
745 28 : if (MaybeDestroy(t)) {
746 28 : new (mozilla::KnownNotNull, ptr_void_t()) void_t;
747 : }
748 28 : (*(ptr_void_t())) = (aRhs).get_void_t();
749 28 : break;
750 : }
751 : case TPrincipalInfo:
752 : {
753 8 : if (MaybeDestroy(t)) {
754 8 : new (mozilla::KnownNotNull, ptr_PrincipalInfo()) PrincipalInfo;
755 : }
756 8 : (*(ptr_PrincipalInfo())) = (aRhs).get_PrincipalInfo();
757 8 : break;
758 : }
759 : case T__None:
760 : {
761 9 : static_cast<void>(MaybeDestroy(t));
762 9 : break;
763 : }
764 : default:
765 : {
766 0 : mozilla::ipc::LogicError("unreached");
767 0 : break;
768 : }
769 : }
770 45 : mType = t;
771 45 : return (*(this));
772 : }
773 :
774 0 : auto OptionalPrincipalInfo::operator==(const void_t& aRhs) const -> bool
775 : {
776 0 : return (get_void_t()) == (aRhs);
777 : }
778 :
779 0 : auto OptionalPrincipalInfo::operator==(const PrincipalInfo& aRhs) const -> bool
780 : {
781 0 : return (get_PrincipalInfo()) == (aRhs);
782 : }
783 :
784 0 : auto OptionalPrincipalInfo::operator==(const OptionalPrincipalInfo& aRhs) const -> bool
785 : {
786 0 : if ((type()) != ((aRhs).type())) {
787 0 : return false;
788 : }
789 :
790 0 : switch (type()) {
791 : case Tvoid_t:
792 : {
793 0 : return (get_void_t()) == ((aRhs).get_void_t());
794 : }
795 : case TPrincipalInfo:
796 : {
797 0 : return (get_PrincipalInfo()) == ((aRhs).get_PrincipalInfo());
798 : }
799 : default:
800 : {
801 0 : mozilla::ipc::LogicError("unreached");
802 0 : return false;
803 : }
804 : }
805 : }
806 :
807 0 : auto OptionalPrincipalInfo::get(void_t* aOutValue) const -> void
808 : {
809 0 : (*(aOutValue)) = get_void_t();
810 0 : }
811 :
812 0 : auto OptionalPrincipalInfo::get(PrincipalInfo* aOutValue) const -> void
813 : {
814 0 : (*(aOutValue)) = get_PrincipalInfo();
815 0 : }
816 :
817 : } // namespace ipc
818 : } // namespace mozilla
|