Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/net/PTCPSocketChild.h"
8 : #include "ipc/IPCMessageUtils.h"
9 :
10 : #include "mozilla/net/PNeckoChild.h"
11 :
12 : #include "nsIFile.h"
13 : #include "GeckoProfiler.h"
14 :
15 : namespace mozilla {
16 : namespace net {
17 :
18 :
19 0 : auto PTCPSocketChild::Recv__delete__() -> mozilla::ipc::IPCResult
20 : {
21 0 : return IPC_OK();
22 : }
23 :
24 0 : auto PTCPSocketChild::ActorDestroy(ActorDestroyReason aWhy) -> void
25 : {
26 0 : }
27 :
28 0 : MOZ_IMPLICIT PTCPSocketChild::PTCPSocketChild() :
29 : mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
30 0 : mState(PTCPSocket::__Dead)
31 : {
32 0 : MOZ_COUNT_CTOR(PTCPSocketChild);
33 0 : }
34 :
35 0 : PTCPSocketChild::~PTCPSocketChild()
36 : {
37 0 : MOZ_COUNT_DTOR(PTCPSocketChild);
38 0 : }
39 :
40 0 : auto PTCPSocketChild::Manager() const -> PNeckoChild*
41 : {
42 0 : return static_cast<PNeckoChild*>(IProtocol::Manager());
43 : }
44 :
45 0 : auto PTCPSocketChild::SendOpen(
46 : const nsString& host,
47 : const uint16_t& port,
48 : const bool& useSSL,
49 : const bool& useArrayBuffers) -> bool
50 : {
51 0 : IPC::Message* msg__ = PTCPSocket::Msg_Open(Id());
52 :
53 0 : Write(host, msg__);
54 : // Sentinel = 'host'
55 0 : (msg__)->WriteSentinel(4070301394);
56 0 : Write(port, msg__);
57 : // Sentinel = 'port'
58 0 : (msg__)->WriteSentinel(3633211549);
59 0 : Write(useSSL, msg__);
60 : // Sentinel = 'useSSL'
61 0 : (msg__)->WriteSentinel(714252035);
62 0 : Write(useArrayBuffers, msg__);
63 : // Sentinel = 'useArrayBuffers'
64 0 : (msg__)->WriteSentinel(1444022734);
65 :
66 :
67 :
68 :
69 0 : if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) {
70 0 : mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
71 : }
72 0 : AUTO_PROFILER_LABEL("PTCPSocket::Msg_Open", OTHER);
73 0 : PTCPSocket::Transition(PTCPSocket::Msg_Open__ID, (&(mState)));
74 :
75 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
76 0 : return sendok__;
77 : }
78 :
79 0 : auto PTCPSocketChild::SendOpenBind(
80 : const nsCString& host,
81 : const uint16_t& port,
82 : const nsCString& localAddr,
83 : const uint16_t& localPort,
84 : const bool& useSSL,
85 : const bool& reuseAddrPort,
86 : const bool& aUseArrayBuffers,
87 : const nsCString& aFilter) -> bool
88 : {
89 0 : IPC::Message* msg__ = PTCPSocket::Msg_OpenBind(Id());
90 :
91 0 : Write(host, msg__);
92 : // Sentinel = 'host'
93 0 : (msg__)->WriteSentinel(4070301394);
94 0 : Write(port, msg__);
95 : // Sentinel = 'port'
96 0 : (msg__)->WriteSentinel(3633211549);
97 0 : Write(localAddr, msg__);
98 : // Sentinel = 'localAddr'
99 0 : (msg__)->WriteSentinel(986524165);
100 0 : Write(localPort, msg__);
101 : // Sentinel = 'localPort'
102 0 : (msg__)->WriteSentinel(2930268933);
103 0 : Write(useSSL, msg__);
104 : // Sentinel = 'useSSL'
105 0 : (msg__)->WriteSentinel(714252035);
106 0 : Write(reuseAddrPort, msg__);
107 : // Sentinel = 'reuseAddrPort'
108 0 : (msg__)->WriteSentinel(3461003689);
109 0 : Write(aUseArrayBuffers, msg__);
110 : // Sentinel = 'aUseArrayBuffers'
111 0 : (msg__)->WriteSentinel(1388383946);
112 0 : Write(aFilter, msg__);
113 : // Sentinel = 'aFilter'
114 0 : (msg__)->WriteSentinel(1227311512);
115 :
116 :
117 :
118 :
119 0 : if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) {
120 0 : mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
121 : }
122 0 : AUTO_PROFILER_LABEL("PTCPSocket::Msg_OpenBind", OTHER);
123 0 : PTCPSocket::Transition(PTCPSocket::Msg_OpenBind__ID, (&(mState)));
124 :
125 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
126 0 : return sendok__;
127 : }
128 :
129 0 : auto PTCPSocketChild::SendData(
130 : const SendableData& data,
131 : const uint32_t& trackingNumber) -> bool
132 : {
133 0 : IPC::Message* msg__ = PTCPSocket::Msg_Data(Id());
134 :
135 0 : Write(data, msg__);
136 : // Sentinel = 'data'
137 0 : (msg__)->WriteSentinel(843352540);
138 0 : Write(trackingNumber, msg__);
139 : // Sentinel = 'trackingNumber'
140 0 : (msg__)->WriteSentinel(272285434);
141 :
142 :
143 :
144 :
145 0 : if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) {
146 0 : mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
147 : }
148 0 : AUTO_PROFILER_LABEL("PTCPSocket::Msg_Data", OTHER);
149 0 : PTCPSocket::Transition(PTCPSocket::Msg_Data__ID, (&(mState)));
150 :
151 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
152 0 : return sendok__;
153 : }
154 :
155 0 : auto PTCPSocketChild::SendStartTLS() -> bool
156 : {
157 0 : IPC::Message* msg__ = PTCPSocket::Msg_StartTLS(Id());
158 :
159 :
160 :
161 :
162 :
163 0 : if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) {
164 0 : mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
165 : }
166 0 : AUTO_PROFILER_LABEL("PTCPSocket::Msg_StartTLS", OTHER);
167 0 : PTCPSocket::Transition(PTCPSocket::Msg_StartTLS__ID, (&(mState)));
168 :
169 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
170 0 : return sendok__;
171 : }
172 :
173 0 : auto PTCPSocketChild::SendSuspend() -> bool
174 : {
175 0 : IPC::Message* msg__ = PTCPSocket::Msg_Suspend(Id());
176 :
177 :
178 :
179 :
180 :
181 0 : if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) {
182 0 : mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
183 : }
184 0 : AUTO_PROFILER_LABEL("PTCPSocket::Msg_Suspend", OTHER);
185 0 : PTCPSocket::Transition(PTCPSocket::Msg_Suspend__ID, (&(mState)));
186 :
187 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
188 0 : return sendok__;
189 : }
190 :
191 0 : auto PTCPSocketChild::SendResume() -> bool
192 : {
193 0 : IPC::Message* msg__ = PTCPSocket::Msg_Resume(Id());
194 :
195 :
196 :
197 :
198 :
199 0 : if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) {
200 0 : mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
201 : }
202 0 : AUTO_PROFILER_LABEL("PTCPSocket::Msg_Resume", OTHER);
203 0 : PTCPSocket::Transition(PTCPSocket::Msg_Resume__ID, (&(mState)));
204 :
205 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
206 0 : return sendok__;
207 : }
208 :
209 0 : auto PTCPSocketChild::SendClose() -> bool
210 : {
211 0 : IPC::Message* msg__ = PTCPSocket::Msg_Close(Id());
212 :
213 :
214 :
215 :
216 :
217 0 : if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) {
218 0 : mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
219 : }
220 0 : AUTO_PROFILER_LABEL("PTCPSocket::Msg_Close", OTHER);
221 0 : PTCPSocket::Transition(PTCPSocket::Msg_Close__ID, (&(mState)));
222 :
223 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
224 0 : return sendok__;
225 : }
226 :
227 0 : auto PTCPSocketChild::SendRequestDelete() -> bool
228 : {
229 0 : IPC::Message* msg__ = PTCPSocket::Msg_RequestDelete(Id());
230 :
231 :
232 :
233 :
234 :
235 0 : if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) {
236 0 : mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
237 : }
238 0 : AUTO_PROFILER_LABEL("PTCPSocket::Msg_RequestDelete", OTHER);
239 0 : PTCPSocket::Transition(PTCPSocket::Msg_RequestDelete__ID, (&(mState)));
240 :
241 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
242 0 : return sendok__;
243 : }
244 :
245 0 : auto PTCPSocketChild::Send__delete__(PTCPSocketChild* actor) -> bool
246 : {
247 0 : if ((!(actor))) {
248 0 : return false;
249 : }
250 :
251 0 : IPC::Message* msg__ = PTCPSocket::Msg___delete__((actor)->Id());
252 :
253 0 : (actor)->Write(actor, msg__, false);
254 : // Sentinel = 'actor'
255 0 : (msg__)->WriteSentinel(875202478);
256 :
257 :
258 :
259 0 : if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) {
260 0 : mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
261 : }
262 0 : AUTO_PROFILER_LABEL("PTCPSocket::Msg___delete__", OTHER);
263 0 : PTCPSocket::Transition(PTCPSocket::Msg___delete____ID, (&((actor)->mState)));
264 :
265 0 : bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
266 :
267 0 : IProtocol* mgr = (actor)->Manager();
268 0 : (actor)->DestroySubtree(Deletion);
269 0 : (actor)->DeallocSubtree();
270 0 : (mgr)->RemoveManagee(PTCPSocketMsgStart, actor);
271 0 : return sendok__;
272 : }
273 :
274 0 : auto PTCPSocketChild::RemoveManagee(
275 : int32_t aProtocolId,
276 : ProtocolBase* aListener) -> void
277 : {
278 0 : FatalError("unreached");
279 0 : return;
280 : }
281 :
282 0 : auto PTCPSocketChild::OnMessageReceived(const Message& msg__) -> PTCPSocketChild::Result
283 : {
284 0 : switch ((msg__).type()) {
285 : case PTCPSocket::Msg_Callback__ID:
286 : {
287 0 : if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) {
288 0 : mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
289 : }
290 0 : AUTO_PROFILER_LABEL("PTCPSocket::Msg_Callback", OTHER);
291 :
292 0 : PickleIterator iter__(msg__);
293 0 : nsString type;
294 0 : CallbackData data;
295 : uint32_t readyState;
296 :
297 0 : if ((!(Read((&(type)), (&(msg__)), (&(iter__)))))) {
298 0 : FatalError("Error deserializing 'nsString'");
299 0 : return MsgValueError;
300 : }
301 : // Sentinel = 'type'
302 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2982068540)))) {
303 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
304 0 : return MsgValueError;
305 : }
306 0 : if ((!(Read((&(data)), (&(msg__)), (&(iter__)))))) {
307 0 : FatalError("Error deserializing 'CallbackData'");
308 0 : return MsgValueError;
309 : }
310 : // Sentinel = 'data'
311 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 843352540)))) {
312 0 : mozilla::ipc::SentinelReadError("Error deserializing 'CallbackData'");
313 0 : return MsgValueError;
314 : }
315 0 : if ((!(Read((&(readyState)), (&(msg__)), (&(iter__)))))) {
316 0 : FatalError("Error deserializing 'uint32_t'");
317 0 : return MsgValueError;
318 : }
319 : // Sentinel = 'readyState'
320 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 572411746)))) {
321 0 : mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
322 0 : return MsgValueError;
323 : }
324 0 : (msg__).EndRead(iter__, (msg__).type());
325 0 : PTCPSocket::Transition(PTCPSocket::Msg_Callback__ID, (&(mState)));
326 0 : if ((!(RecvCallback(mozilla::Move(type), mozilla::Move(data), mozilla::Move(readyState))))) {
327 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
328 : // Error handled in mozilla::ipc::IPCResult
329 0 : return MsgProcessingError;
330 : }
331 :
332 0 : return MsgProcessed;
333 : }
334 : case PTCPSocket::Msg_UpdateBufferedAmount__ID:
335 : {
336 0 : if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) {
337 0 : mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
338 : }
339 0 : AUTO_PROFILER_LABEL("PTCPSocket::Msg_UpdateBufferedAmount", OTHER);
340 :
341 0 : PickleIterator iter__(msg__);
342 : uint32_t bufferedAmount;
343 : uint32_t trackingNumber;
344 :
345 0 : if ((!(Read((&(bufferedAmount)), (&(msg__)), (&(iter__)))))) {
346 0 : FatalError("Error deserializing 'uint32_t'");
347 0 : return MsgValueError;
348 : }
349 : // Sentinel = 'bufferedAmount'
350 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 580364331)))) {
351 0 : mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
352 0 : return MsgValueError;
353 : }
354 0 : if ((!(Read((&(trackingNumber)), (&(msg__)), (&(iter__)))))) {
355 0 : FatalError("Error deserializing 'uint32_t'");
356 0 : return MsgValueError;
357 : }
358 : // Sentinel = 'trackingNumber'
359 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 272285434)))) {
360 0 : mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
361 0 : return MsgValueError;
362 : }
363 0 : (msg__).EndRead(iter__, (msg__).type());
364 0 : PTCPSocket::Transition(PTCPSocket::Msg_UpdateBufferedAmount__ID, (&(mState)));
365 0 : if ((!(RecvUpdateBufferedAmount(mozilla::Move(bufferedAmount), mozilla::Move(trackingNumber))))) {
366 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
367 : // Error handled in mozilla::ipc::IPCResult
368 0 : return MsgProcessingError;
369 : }
370 :
371 0 : return MsgProcessed;
372 : }
373 : case PTCPSocket::Msg_RequestDelete__ID:
374 : {
375 0 : if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) {
376 0 : mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
377 : }
378 0 : AUTO_PROFILER_LABEL("PTCPSocket::Msg_RequestDelete", OTHER);
379 :
380 0 : PTCPSocket::Transition(PTCPSocket::Msg_RequestDelete__ID, (&(mState)));
381 0 : if ((!(RecvRequestDelete()))) {
382 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
383 : // Error handled in mozilla::ipc::IPCResult
384 0 : return MsgProcessingError;
385 : }
386 :
387 0 : return MsgProcessed;
388 : }
389 : case PTCPSocket::Reply___delete____ID:
390 : {
391 0 : return MsgProcessed;
392 : }
393 : case PTCPSocket::Msg___delete____ID:
394 : {
395 0 : if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) {
396 0 : mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
397 : }
398 0 : AUTO_PROFILER_LABEL("PTCPSocket::Msg___delete__", OTHER);
399 :
400 0 : PickleIterator iter__(msg__);
401 : PTCPSocketChild* actor;
402 :
403 0 : if ((!(Read((&(actor)), (&(msg__)), (&(iter__)), false)))) {
404 0 : FatalError("Error deserializing 'PTCPSocketChild'");
405 0 : return MsgValueError;
406 : }
407 : // Sentinel = 'actor'
408 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
409 0 : mozilla::ipc::SentinelReadError("Error deserializing 'PTCPSocketChild'");
410 0 : return MsgValueError;
411 : }
412 0 : (msg__).EndRead(iter__, (msg__).type());
413 0 : PTCPSocket::Transition(PTCPSocket::Msg___delete____ID, (&(mState)));
414 0 : if ((!(Recv__delete__()))) {
415 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
416 : // Error handled in mozilla::ipc::IPCResult
417 0 : return MsgProcessingError;
418 : }
419 :
420 :
421 0 : IProtocol* mgr = (actor)->Manager();
422 0 : (actor)->DestroySubtree(Deletion);
423 0 : (actor)->DeallocSubtree();
424 0 : (mgr)->RemoveManagee(PTCPSocketMsgStart, actor);
425 :
426 0 : return MsgProcessed;
427 : }
428 : default:
429 : {
430 0 : return MsgNotKnown;
431 : }
432 : }
433 : }
434 :
435 0 : auto PTCPSocketChild::OnMessageReceived(
436 : const Message& msg__,
437 : Message*& reply__) -> PTCPSocketChild::Result
438 : {
439 0 : return MsgNotKnown;
440 : }
441 :
442 0 : auto PTCPSocketChild::OnCallReceived(
443 : const Message& msg__,
444 : Message*& reply__) -> PTCPSocketChild::Result
445 : {
446 0 : MOZ_ASSERT_UNREACHABLE("message protocol not supported");
447 : return MsgNotKnown;
448 : }
449 :
450 0 : auto PTCPSocketChild::GetProtocolTypeId() -> int32_t
451 : {
452 0 : return PTCPSocketMsgStart;
453 : }
454 :
455 0 : auto PTCPSocketChild::ProtocolName() const -> const char*
456 : {
457 0 : return "PTCPSocketChild";
458 : }
459 :
460 0 : auto PTCPSocketChild::DestroySubtree(ActorDestroyReason why) -> void
461 : {
462 : // Unregister from our manager.
463 0 : Unregister(Id());
464 :
465 : // Reject owning pending promises.
466 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
467 :
468 : // Finally, destroy "us".
469 0 : ActorDestroy(why);
470 0 : }
471 :
472 0 : auto PTCPSocketChild::DeallocSubtree() -> void
473 : {
474 0 : }
475 :
476 0 : auto PTCPSocketChild::Write(
477 : const SendableData& v__,
478 : Message* msg__) -> void
479 : {
480 : typedef SendableData type__;
481 0 : Write(int((v__).type()), msg__);
482 : // Sentinel = 'SendableData'
483 0 : (msg__)->WriteSentinel(1792235082);
484 :
485 0 : switch ((v__).type()) {
486 : case type__::TArrayOfuint8_t:
487 : {
488 0 : Write((v__).get_ArrayOfuint8_t(), msg__);
489 : // Sentinel = 'TArrayOfuint8_t'
490 0 : (msg__)->WriteSentinel(430000978);
491 0 : return;
492 : }
493 : case type__::TnsCString:
494 : {
495 0 : Write((v__).get_nsCString(), msg__);
496 : // Sentinel = 'TnsCString'
497 0 : (msg__)->WriteSentinel(2427411293);
498 0 : return;
499 : }
500 : default:
501 : {
502 0 : FatalError("unknown union type");
503 0 : return;
504 : }
505 : }
506 : }
507 :
508 0 : auto PTCPSocketChild::Read(
509 : SendableData* v__,
510 : const Message* msg__,
511 : PickleIterator* iter__) -> bool
512 : {
513 : typedef SendableData type__;
514 : int type;
515 0 : if ((!(Read((&(type)), msg__, iter__)))) {
516 0 : mozilla::ipc::UnionTypeReadError("SendableData");
517 0 : return false;
518 : }
519 : // Sentinel = 'SendableData'
520 0 : if ((!((msg__)->ReadSentinel(iter__, 1792235082)))) {
521 0 : mozilla::ipc::SentinelReadError("SendableData");
522 0 : return false;
523 : }
524 :
525 0 : switch (type) {
526 : case type__::TArrayOfuint8_t:
527 : {
528 0 : nsTArray<uint8_t> tmp;
529 0 : (*(v__)) = tmp;
530 0 : if ((!(Read((&((v__)->get_ArrayOfuint8_t())), msg__, iter__)))) {
531 0 : FatalError("Error deserializing Union type");
532 0 : return false;
533 : }
534 : // Sentinel = 'TArrayOfuint8_t'
535 0 : if ((!((msg__)->ReadSentinel(iter__, 430000978)))) {
536 0 : mozilla::ipc::SentinelReadError("Error deserializing Union type");
537 0 : return false;
538 : }
539 0 : return true;
540 : }
541 : case type__::TnsCString:
542 : {
543 0 : nsCString tmp = nsCString();
544 0 : (*(v__)) = tmp;
545 0 : if ((!(Read((&((v__)->get_nsCString())), msg__, iter__)))) {
546 0 : FatalError("Error deserializing Union type");
547 0 : return false;
548 : }
549 : // Sentinel = 'TnsCString'
550 0 : if ((!((msg__)->ReadSentinel(iter__, 2427411293)))) {
551 0 : mozilla::ipc::SentinelReadError("Error deserializing Union type");
552 0 : return false;
553 : }
554 0 : return true;
555 : }
556 : default:
557 : {
558 0 : FatalError("unknown union type");
559 0 : return false;
560 : }
561 : }
562 : }
563 :
564 0 : auto PTCPSocketChild::Write(
565 : const PTCPSocketChild* v__,
566 : Message* msg__,
567 : bool nullable__) -> void
568 : {
569 : int32_t id;
570 0 : if ((!(v__))) {
571 0 : if ((!(nullable__))) {
572 0 : FatalError("NULL actor value passed to non-nullable param");
573 : }
574 0 : id = 0;
575 : }
576 : else {
577 0 : id = (v__)->Id();
578 0 : if ((1) == (id)) {
579 0 : FatalError("actor has been |delete|d");
580 : }
581 : }
582 :
583 0 : Write(id, msg__);
584 0 : }
585 :
586 0 : auto PTCPSocketChild::Read(
587 : PTCPSocketChild** v__,
588 : const Message* msg__,
589 : PickleIterator* iter__,
590 : bool nullable__) -> bool
591 : {
592 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PTCPSocket", PTCPSocketMsgStart);
593 0 : if ((actor).isNothing()) {
594 0 : return false;
595 : }
596 :
597 0 : (*(v__)) = static_cast<PTCPSocketChild*>((actor).value());
598 0 : return true;
599 : }
600 :
601 0 : auto PTCPSocketChild::Write(
602 : const CallbackData& v__,
603 : Message* msg__) -> void
604 : {
605 : typedef CallbackData type__;
606 0 : Write(int((v__).type()), msg__);
607 : // Sentinel = 'CallbackData'
608 0 : (msg__)->WriteSentinel(3715623197);
609 :
610 0 : switch ((v__).type()) {
611 : case type__::Tvoid_t:
612 : {
613 0 : Write((v__).get_void_t(), msg__);
614 : // Sentinel = 'Tvoid_t'
615 0 : (msg__)->WriteSentinel(3041273328);
616 0 : return;
617 : }
618 : case type__::TSendableData:
619 : {
620 0 : Write((v__).get_SendableData(), msg__);
621 : // Sentinel = 'TSendableData'
622 0 : (msg__)->WriteSentinel(1253583583);
623 0 : return;
624 : }
625 : case type__::TTCPError:
626 : {
627 0 : Write((v__).get_TCPError(), msg__);
628 : // Sentinel = 'TTCPError'
629 0 : (msg__)->WriteSentinel(2275116752);
630 0 : return;
631 : }
632 : default:
633 : {
634 0 : FatalError("unknown union type");
635 0 : return;
636 : }
637 : }
638 : }
639 :
640 0 : auto PTCPSocketChild::Read(
641 : CallbackData* v__,
642 : const Message* msg__,
643 : PickleIterator* iter__) -> bool
644 : {
645 : typedef CallbackData type__;
646 : int type;
647 0 : if ((!(Read((&(type)), msg__, iter__)))) {
648 0 : mozilla::ipc::UnionTypeReadError("CallbackData");
649 0 : return false;
650 : }
651 : // Sentinel = 'CallbackData'
652 0 : if ((!((msg__)->ReadSentinel(iter__, 3715623197)))) {
653 0 : mozilla::ipc::SentinelReadError("CallbackData");
654 0 : return false;
655 : }
656 :
657 0 : switch (type) {
658 : case type__::Tvoid_t:
659 : {
660 : void_t tmp = void_t();
661 0 : (*(v__)) = tmp;
662 0 : if ((!(Read((&((v__)->get_void_t())), msg__, iter__)))) {
663 0 : FatalError("Error deserializing Union type");
664 0 : return false;
665 : }
666 : // Sentinel = 'Tvoid_t'
667 0 : if ((!((msg__)->ReadSentinel(iter__, 3041273328)))) {
668 0 : mozilla::ipc::SentinelReadError("Error deserializing Union type");
669 0 : return false;
670 : }
671 0 : return true;
672 : }
673 : case type__::TSendableData:
674 : {
675 0 : SendableData tmp = SendableData();
676 0 : (*(v__)) = tmp;
677 0 : if ((!(Read((&((v__)->get_SendableData())), msg__, iter__)))) {
678 0 : FatalError("Error deserializing Union type");
679 0 : return false;
680 : }
681 : // Sentinel = 'TSendableData'
682 0 : if ((!((msg__)->ReadSentinel(iter__, 1253583583)))) {
683 0 : mozilla::ipc::SentinelReadError("Error deserializing Union type");
684 0 : return false;
685 : }
686 0 : return true;
687 : }
688 : case type__::TTCPError:
689 : {
690 0 : TCPError tmp = TCPError();
691 0 : (*(v__)) = tmp;
692 0 : if ((!(Read((&((v__)->get_TCPError())), msg__, iter__)))) {
693 0 : FatalError("Error deserializing Union type");
694 0 : return false;
695 : }
696 : // Sentinel = 'TTCPError'
697 0 : if ((!((msg__)->ReadSentinel(iter__, 2275116752)))) {
698 0 : mozilla::ipc::SentinelReadError("Error deserializing Union type");
699 0 : return false;
700 : }
701 0 : return true;
702 : }
703 : default:
704 : {
705 0 : FatalError("unknown union type");
706 0 : return false;
707 : }
708 : }
709 : }
710 :
711 0 : auto PTCPSocketChild::Write(
712 : const TCPError& v__,
713 : Message* msg__) -> void
714 : {
715 0 : Write((v__).name(), msg__);
716 : // Sentinel = 'name'
717 0 : (msg__)->WriteSentinel(15034981);
718 0 : Write((v__).message(), msg__);
719 : // Sentinel = 'message'
720 0 : (msg__)->WriteSentinel(1366108954);
721 0 : }
722 :
723 0 : auto PTCPSocketChild::Read(
724 : TCPError* v__,
725 : const Message* msg__,
726 : PickleIterator* iter__) -> bool
727 : {
728 0 : if ((!(Read((&((v__)->name())), msg__, iter__)))) {
729 0 : FatalError("Error deserializing 'name' (nsString) member of 'TCPError'");
730 0 : return false;
731 : }
732 : // Sentinel = 'name'
733 0 : if ((!((msg__)->ReadSentinel(iter__, 15034981)))) {
734 0 : mozilla::ipc::SentinelReadError("Error deserializing 'name' (nsString) member of 'TCPError'");
735 0 : return false;
736 : }
737 0 : if ((!(Read((&((v__)->message())), msg__, iter__)))) {
738 0 : FatalError("Error deserializing 'message' (nsString) member of 'TCPError'");
739 0 : return false;
740 : }
741 : // Sentinel = 'message'
742 0 : if ((!((msg__)->ReadSentinel(iter__, 1366108954)))) {
743 0 : mozilla::ipc::SentinelReadError("Error deserializing 'message' (nsString) member of 'TCPError'");
744 0 : return false;
745 : }
746 0 : return true;
747 : }
748 :
749 :
750 :
751 : } // namespace net
752 : } // namespace mozilla
|