Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/net/PTCPSocket.h"
8 :
9 : namespace mozilla {
10 : namespace net {
11 : namespace PTCPSocket {
12 :
13 : nsresult
14 0 : CreateEndpoints(
15 : base::ProcessId aParentDestPid,
16 : base::ProcessId aChildDestPid,
17 : mozilla::ipc::Endpoint<mozilla::net::PTCPSocketParent>* aParent,
18 : mozilla::ipc::Endpoint<mozilla::net::PTCPSocketChild>* aChild)
19 : {
20 0 : return mozilla::ipc::CreateEndpoints(mozilla::ipc::PrivateIPDLInterface(), aParentDestPid, aChildDestPid, PTCPSocketMsgStart, PTCPSocketMsgStartChild, aParent, aChild);
21 : }
22 : void
23 0 : Transition(
24 : MessageType msg,
25 : State* next)
26 : {
27 0 : switch ((*(next))) {
28 : case __Null:
29 0 : if ((Msg___delete____ID) == (msg)) {
30 0 : (*(next)) = __Dead;
31 : }
32 0 : break;
33 : case __Dead:
34 0 : mozilla::ipc::LogicError("__delete__()d actor");
35 0 : break;
36 : default:
37 0 : mozilla::ipc::LogicError("corrupted actor state");
38 0 : break;
39 : }
40 0 : }
41 : IPC::Message*
42 0 : Msg_Open(int32_t routingId)
43 : {
44 0 : return new IPC::Message(routingId, Msg_Open__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PTCPSocket::Msg_Open", true);
45 : }
46 : IPC::Message*
47 0 : Msg_OpenBind(int32_t routingId)
48 : {
49 0 : return new IPC::Message(routingId, Msg_OpenBind__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PTCPSocket::Msg_OpenBind", true);
50 : }
51 : IPC::Message*
52 0 : Msg_Data(int32_t routingId)
53 : {
54 0 : return new IPC::Message(routingId, Msg_Data__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PTCPSocket::Msg_Data", true);
55 : }
56 : IPC::Message*
57 0 : Msg_StartTLS(int32_t routingId)
58 : {
59 0 : return new IPC::Message(routingId, Msg_StartTLS__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PTCPSocket::Msg_StartTLS", true);
60 : }
61 : IPC::Message*
62 0 : Msg_Suspend(int32_t routingId)
63 : {
64 0 : return new IPC::Message(routingId, Msg_Suspend__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PTCPSocket::Msg_Suspend", true);
65 : }
66 : IPC::Message*
67 0 : Msg_Resume(int32_t routingId)
68 : {
69 0 : return new IPC::Message(routingId, Msg_Resume__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PTCPSocket::Msg_Resume", true);
70 : }
71 : IPC::Message*
72 0 : Msg_Close(int32_t routingId)
73 : {
74 0 : return new IPC::Message(routingId, Msg_Close__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PTCPSocket::Msg_Close", true);
75 : }
76 : IPC::Message*
77 0 : Msg_Callback(int32_t routingId)
78 : {
79 0 : return new IPC::Message(routingId, Msg_Callback__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PTCPSocket::Msg_Callback", true);
80 : }
81 : IPC::Message*
82 0 : Msg_UpdateBufferedAmount(int32_t routingId)
83 : {
84 0 : return new IPC::Message(routingId, Msg_UpdateBufferedAmount__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PTCPSocket::Msg_UpdateBufferedAmount", true);
85 : }
86 : IPC::Message*
87 0 : Msg_RequestDelete(int32_t routingId)
88 : {
89 0 : return new IPC::Message(routingId, Msg_RequestDelete__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PTCPSocket::Msg_RequestDelete", true);
90 : }
91 : IPC::Message*
92 0 : Msg___delete__(int32_t routingId)
93 : {
94 0 : return new IPC::Message(routingId, Msg___delete____ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PTCPSocket::Msg___delete__", true);
95 : }
96 : IPC::Message*
97 0 : Reply___delete__(int32_t routingId)
98 : {
99 0 : return new IPC::Message(routingId, Reply___delete____ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PTCPSocket::Reply___delete__", true);
100 : }
101 :
102 : } // namespace PTCPSocket
103 : } // namespace net
104 : } // namespace mozilla
105 :
106 : //-----------------------------------------------------------------------------
107 : // Method definitions for the IPDL type |struct TCPError|
108 : //
109 0 : MOZ_IMPLICIT TCPError::TCPError() :
110 : name_(),
111 0 : message_()
112 : {
113 0 : Init();
114 0 : }
115 :
116 0 : TCPError::~TCPError()
117 : {
118 0 : }
119 :
120 0 : auto TCPError::operator==(const TCPError& _o) const -> bool
121 : {
122 0 : if ((!((name()) == ((_o).name())))) {
123 0 : return false;
124 : }
125 0 : if ((!((message()) == ((_o).message())))) {
126 0 : return false;
127 : }
128 0 : return true;
129 : }
130 :
131 0 : auto TCPError::operator!=(const TCPError& _o) const -> bool
132 : {
133 0 : return (!(operator==(_o)));
134 : }
135 :
136 0 : auto TCPError::Init() -> void
137 : {
138 0 : }
139 :
140 0 : auto TCPError::Assign(
141 : const nsString& _name,
142 : const nsString& _message) -> void
143 : {
144 0 : name_ = _name;
145 0 : message_ = _message;
146 0 : }
147 :
148 :
149 : //-----------------------------------------------------------------------------
150 : // Method definitions for the IPDL type |union SendableData|
151 : //
152 0 : auto SendableData::MaybeDestroy(Type aNewType) -> bool
153 : {
154 0 : if ((mType) == (T__None)) {
155 0 : return true;
156 : }
157 0 : if ((mType) == (aNewType)) {
158 0 : return false;
159 : }
160 0 : switch (mType) {
161 : case TArrayOfuint8_t:
162 : {
163 0 : (ptr_ArrayOfuint8_t())->~ArrayOfuint8_t__tdef();
164 0 : break;
165 : }
166 : case TnsCString:
167 : {
168 0 : (ptr_nsCString())->~nsCString__tdef();
169 0 : break;
170 : }
171 : default:
172 : {
173 0 : mozilla::ipc::LogicError("not reached");
174 0 : break;
175 : }
176 : }
177 0 : return true;
178 : }
179 :
180 0 : MOZ_IMPLICIT SendableData::SendableData(const nsTArray<uint8_t>& aOther)
181 : {
182 0 : new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>(aOther);
183 0 : mType = TArrayOfuint8_t;
184 0 : }
185 :
186 0 : MOZ_IMPLICIT SendableData::SendableData(const nsCString& aOther)
187 : {
188 0 : new (mozilla::KnownNotNull, ptr_nsCString()) nsCString(aOther);
189 0 : mType = TnsCString;
190 0 : }
191 :
192 0 : MOZ_IMPLICIT SendableData::SendableData(const SendableData& aOther)
193 : {
194 0 : (aOther).AssertSanity();
195 0 : switch ((aOther).type()) {
196 : case TArrayOfuint8_t:
197 : {
198 0 : new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>((aOther).get_ArrayOfuint8_t());
199 0 : break;
200 : }
201 : case TnsCString:
202 : {
203 0 : new (mozilla::KnownNotNull, ptr_nsCString()) nsCString((aOther).get_nsCString());
204 0 : break;
205 : }
206 : case T__None:
207 : {
208 0 : break;
209 : }
210 : default:
211 : {
212 0 : mozilla::ipc::LogicError("unreached");
213 0 : return;
214 : }
215 : }
216 0 : mType = (aOther).type();
217 : }
218 :
219 0 : SendableData::~SendableData()
220 : {
221 0 : static_cast<void>(MaybeDestroy(T__None));
222 0 : }
223 :
224 0 : auto SendableData::operator=(const nsTArray<uint8_t>& aRhs) -> SendableData&
225 : {
226 0 : if (MaybeDestroy(TArrayOfuint8_t)) {
227 0 : new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>;
228 : }
229 0 : (*(ptr_ArrayOfuint8_t())) = aRhs;
230 0 : mType = TArrayOfuint8_t;
231 0 : return (*(this));
232 : }
233 :
234 0 : auto SendableData::operator=(const nsCString& aRhs) -> SendableData&
235 : {
236 0 : if (MaybeDestroy(TnsCString)) {
237 0 : new (mozilla::KnownNotNull, ptr_nsCString()) nsCString;
238 : }
239 0 : (*(ptr_nsCString())) = aRhs;
240 0 : mType = TnsCString;
241 0 : return (*(this));
242 : }
243 :
244 0 : auto SendableData::operator=(const SendableData& aRhs) -> SendableData&
245 : {
246 0 : (aRhs).AssertSanity();
247 0 : Type t = (aRhs).type();
248 0 : switch (t) {
249 : case TArrayOfuint8_t:
250 : {
251 0 : if (MaybeDestroy(t)) {
252 0 : new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>;
253 : }
254 0 : (*(ptr_ArrayOfuint8_t())) = (aRhs).get_ArrayOfuint8_t();
255 0 : break;
256 : }
257 : case TnsCString:
258 : {
259 0 : if (MaybeDestroy(t)) {
260 0 : new (mozilla::KnownNotNull, ptr_nsCString()) nsCString;
261 : }
262 0 : (*(ptr_nsCString())) = (aRhs).get_nsCString();
263 0 : break;
264 : }
265 : case T__None:
266 : {
267 0 : static_cast<void>(MaybeDestroy(t));
268 0 : break;
269 : }
270 : default:
271 : {
272 0 : mozilla::ipc::LogicError("unreached");
273 0 : break;
274 : }
275 : }
276 0 : mType = t;
277 0 : return (*(this));
278 : }
279 :
280 0 : auto SendableData::operator==(const nsTArray<uint8_t>& aRhs) const -> bool
281 : {
282 0 : return (get_ArrayOfuint8_t()) == (aRhs);
283 : }
284 :
285 0 : auto SendableData::operator==(const nsCString& aRhs) const -> bool
286 : {
287 0 : return (get_nsCString()) == (aRhs);
288 : }
289 :
290 0 : auto SendableData::operator==(const SendableData& aRhs) const -> bool
291 : {
292 0 : if ((type()) != ((aRhs).type())) {
293 0 : return false;
294 : }
295 :
296 0 : switch (type()) {
297 : case TArrayOfuint8_t:
298 : {
299 0 : return (get_ArrayOfuint8_t()) == ((aRhs).get_ArrayOfuint8_t());
300 : }
301 : case TnsCString:
302 : {
303 0 : return (get_nsCString()) == ((aRhs).get_nsCString());
304 : }
305 : default:
306 : {
307 0 : mozilla::ipc::LogicError("unreached");
308 0 : return false;
309 : }
310 : }
311 : }
312 :
313 0 : auto SendableData::get(nsTArray<uint8_t>* aOutValue) const -> void
314 : {
315 0 : (*(aOutValue)) = get_ArrayOfuint8_t();
316 0 : }
317 :
318 0 : auto SendableData::get(nsCString* aOutValue) const -> void
319 : {
320 0 : (*(aOutValue)) = get_nsCString();
321 0 : }
322 :
323 :
324 : //-----------------------------------------------------------------------------
325 : // Method definitions for the IPDL type |union CallbackData|
326 : //
327 0 : auto CallbackData::MaybeDestroy(Type aNewType) -> bool
328 : {
329 0 : if ((mType) == (T__None)) {
330 0 : return true;
331 : }
332 0 : if ((mType) == (aNewType)) {
333 0 : return false;
334 : }
335 0 : switch (mType) {
336 : case Tvoid_t:
337 : {
338 0 : (ptr_void_t())->~void_t__tdef();
339 0 : break;
340 : }
341 : case TSendableData:
342 : {
343 0 : (ptr_SendableData())->~SendableData__tdef();
344 0 : break;
345 : }
346 : case TTCPError:
347 : {
348 0 : (ptr_TCPError())->~TCPError__tdef();
349 0 : break;
350 : }
351 : default:
352 : {
353 0 : mozilla::ipc::LogicError("not reached");
354 0 : break;
355 : }
356 : }
357 0 : return true;
358 : }
359 :
360 0 : MOZ_IMPLICIT CallbackData::CallbackData(const void_t& aOther)
361 : {
362 0 : new (mozilla::KnownNotNull, ptr_void_t()) void_t(aOther);
363 0 : mType = Tvoid_t;
364 0 : }
365 :
366 0 : MOZ_IMPLICIT CallbackData::CallbackData(const SendableData& aOther)
367 : {
368 0 : new (mozilla::KnownNotNull, ptr_SendableData()) SendableData(aOther);
369 0 : mType = TSendableData;
370 0 : }
371 :
372 0 : MOZ_IMPLICIT CallbackData::CallbackData(const TCPError& aOther)
373 : {
374 0 : new (mozilla::KnownNotNull, ptr_TCPError()) TCPError(aOther);
375 0 : mType = TTCPError;
376 0 : }
377 :
378 0 : MOZ_IMPLICIT CallbackData::CallbackData(const CallbackData& aOther)
379 : {
380 0 : (aOther).AssertSanity();
381 0 : switch ((aOther).type()) {
382 : case Tvoid_t:
383 : {
384 0 : new (mozilla::KnownNotNull, ptr_void_t()) void_t((aOther).get_void_t());
385 0 : break;
386 : }
387 : case TSendableData:
388 : {
389 0 : new (mozilla::KnownNotNull, ptr_SendableData()) SendableData((aOther).get_SendableData());
390 0 : break;
391 : }
392 : case TTCPError:
393 : {
394 0 : new (mozilla::KnownNotNull, ptr_TCPError()) TCPError((aOther).get_TCPError());
395 0 : break;
396 : }
397 : case T__None:
398 : {
399 0 : break;
400 : }
401 : default:
402 : {
403 0 : mozilla::ipc::LogicError("unreached");
404 0 : return;
405 : }
406 : }
407 0 : mType = (aOther).type();
408 : }
409 :
410 0 : CallbackData::~CallbackData()
411 : {
412 0 : static_cast<void>(MaybeDestroy(T__None));
413 0 : }
414 :
415 0 : auto CallbackData::operator=(const void_t& aRhs) -> CallbackData&
416 : {
417 0 : if (MaybeDestroy(Tvoid_t)) {
418 0 : new (mozilla::KnownNotNull, ptr_void_t()) void_t;
419 : }
420 0 : (*(ptr_void_t())) = aRhs;
421 0 : mType = Tvoid_t;
422 0 : return (*(this));
423 : }
424 :
425 0 : auto CallbackData::operator=(const SendableData& aRhs) -> CallbackData&
426 : {
427 0 : if (MaybeDestroy(TSendableData)) {
428 0 : new (mozilla::KnownNotNull, ptr_SendableData()) SendableData;
429 : }
430 0 : (*(ptr_SendableData())) = aRhs;
431 0 : mType = TSendableData;
432 0 : return (*(this));
433 : }
434 :
435 0 : auto CallbackData::operator=(const TCPError& aRhs) -> CallbackData&
436 : {
437 0 : if (MaybeDestroy(TTCPError)) {
438 0 : new (mozilla::KnownNotNull, ptr_TCPError()) TCPError;
439 : }
440 0 : (*(ptr_TCPError())) = aRhs;
441 0 : mType = TTCPError;
442 0 : return (*(this));
443 : }
444 :
445 0 : auto CallbackData::operator=(const CallbackData& aRhs) -> CallbackData&
446 : {
447 0 : (aRhs).AssertSanity();
448 0 : Type t = (aRhs).type();
449 0 : switch (t) {
450 : case Tvoid_t:
451 : {
452 0 : if (MaybeDestroy(t)) {
453 0 : new (mozilla::KnownNotNull, ptr_void_t()) void_t;
454 : }
455 0 : (*(ptr_void_t())) = (aRhs).get_void_t();
456 0 : break;
457 : }
458 : case TSendableData:
459 : {
460 0 : if (MaybeDestroy(t)) {
461 0 : new (mozilla::KnownNotNull, ptr_SendableData()) SendableData;
462 : }
463 0 : (*(ptr_SendableData())) = (aRhs).get_SendableData();
464 0 : break;
465 : }
466 : case TTCPError:
467 : {
468 0 : if (MaybeDestroy(t)) {
469 0 : new (mozilla::KnownNotNull, ptr_TCPError()) TCPError;
470 : }
471 0 : (*(ptr_TCPError())) = (aRhs).get_TCPError();
472 0 : break;
473 : }
474 : case T__None:
475 : {
476 0 : static_cast<void>(MaybeDestroy(t));
477 0 : break;
478 : }
479 : default:
480 : {
481 0 : mozilla::ipc::LogicError("unreached");
482 0 : break;
483 : }
484 : }
485 0 : mType = t;
486 0 : return (*(this));
487 : }
488 :
489 0 : auto CallbackData::operator==(const void_t& aRhs) const -> bool
490 : {
491 0 : return (get_void_t()) == (aRhs);
492 : }
493 :
494 0 : auto CallbackData::operator==(const SendableData& aRhs) const -> bool
495 : {
496 0 : return (get_SendableData()) == (aRhs);
497 : }
498 :
499 0 : auto CallbackData::operator==(const TCPError& aRhs) const -> bool
500 : {
501 0 : return (get_TCPError()) == (aRhs);
502 : }
503 :
504 0 : auto CallbackData::operator==(const CallbackData& aRhs) const -> bool
505 : {
506 0 : if ((type()) != ((aRhs).type())) {
507 0 : return false;
508 : }
509 :
510 0 : switch (type()) {
511 : case Tvoid_t:
512 : {
513 0 : return (get_void_t()) == ((aRhs).get_void_t());
514 : }
515 : case TSendableData:
516 : {
517 0 : return (get_SendableData()) == ((aRhs).get_SendableData());
518 : }
519 : case TTCPError:
520 : {
521 0 : return (get_TCPError()) == ((aRhs).get_TCPError());
522 : }
523 : default:
524 : {
525 0 : mozilla::ipc::LogicError("unreached");
526 0 : return false;
527 : }
528 : }
529 : }
530 :
531 0 : auto CallbackData::get(void_t* aOutValue) const -> void
532 : {
533 0 : (*(aOutValue)) = get_void_t();
534 0 : }
535 :
536 0 : auto CallbackData::get(SendableData* aOutValue) const -> void
537 : {
538 0 : (*(aOutValue)) = get_SendableData();
539 0 : }
540 :
541 0 : auto CallbackData::get(TCPError* aOutValue) const -> void
542 : {
543 0 : (*(aOutValue)) = get_TCPError();
544 0 : }
545 :
|