Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/net/PUDPSocket.h"
8 :
9 : namespace mozilla {
10 : namespace net {
11 : namespace PUDPSocket {
12 :
13 : nsresult
14 0 : CreateEndpoints(
15 : base::ProcessId aParentDestPid,
16 : base::ProcessId aChildDestPid,
17 : mozilla::ipc::Endpoint<mozilla::net::PUDPSocketParent>* aParent,
18 : mozilla::ipc::Endpoint<mozilla::net::PUDPSocketChild>* aChild)
19 : {
20 0 : return mozilla::ipc::CreateEndpoints(mozilla::ipc::PrivateIPDLInterface(), aParentDestPid, aChildDestPid, PUDPSocketMsgStart, PUDPSocketMsgStartChild, 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_Bind(int32_t routingId)
43 : {
44 0 : return new IPC::Message(routingId, Msg_Bind__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PUDPSocket::Msg_Bind", true);
45 : }
46 : IPC::Message*
47 0 : Msg_Connect(int32_t routingId)
48 : {
49 0 : return new IPC::Message(routingId, Msg_Connect__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PUDPSocket::Msg_Connect", true);
50 : }
51 : IPC::Message*
52 0 : Msg_OutgoingData(int32_t routingId)
53 : {
54 0 : return new IPC::Message(routingId, Msg_OutgoingData__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PUDPSocket::Msg_OutgoingData", true);
55 : }
56 : IPC::Message*
57 0 : Msg_JoinMulticast(int32_t routingId)
58 : {
59 0 : return new IPC::Message(routingId, Msg_JoinMulticast__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PUDPSocket::Msg_JoinMulticast", true);
60 : }
61 : IPC::Message*
62 0 : Msg_LeaveMulticast(int32_t routingId)
63 : {
64 0 : return new IPC::Message(routingId, Msg_LeaveMulticast__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PUDPSocket::Msg_LeaveMulticast", true);
65 : }
66 : IPC::Message*
67 0 : Msg_Close(int32_t routingId)
68 : {
69 0 : return new IPC::Message(routingId, Msg_Close__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PUDPSocket::Msg_Close", true);
70 : }
71 : IPC::Message*
72 0 : Msg_RequestDelete(int32_t routingId)
73 : {
74 0 : return new IPC::Message(routingId, Msg_RequestDelete__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PUDPSocket::Msg_RequestDelete", true);
75 : }
76 : IPC::Message*
77 0 : Msg_CallbackOpened(int32_t routingId)
78 : {
79 0 : return new IPC::Message(routingId, Msg_CallbackOpened__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PUDPSocket::Msg_CallbackOpened", true);
80 : }
81 : IPC::Message*
82 0 : Msg_CallbackConnected(int32_t routingId)
83 : {
84 0 : return new IPC::Message(routingId, Msg_CallbackConnected__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PUDPSocket::Msg_CallbackConnected", true);
85 : }
86 : IPC::Message*
87 0 : Msg_CallbackClosed(int32_t routingId)
88 : {
89 0 : return new IPC::Message(routingId, Msg_CallbackClosed__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PUDPSocket::Msg_CallbackClosed", true);
90 : }
91 : IPC::Message*
92 0 : Msg_CallbackReceivedData(int32_t routingId)
93 : {
94 0 : return new IPC::Message(routingId, Msg_CallbackReceivedData__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PUDPSocket::Msg_CallbackReceivedData", true);
95 : }
96 : IPC::Message*
97 0 : Msg_CallbackError(int32_t routingId)
98 : {
99 0 : return new IPC::Message(routingId, Msg_CallbackError__ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PUDPSocket::Msg_CallbackError", true);
100 : }
101 : IPC::Message*
102 0 : Msg___delete__(int32_t routingId)
103 : {
104 0 : return new IPC::Message(routingId, Msg___delete____ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PUDPSocket::Msg___delete__", true);
105 : }
106 : IPC::Message*
107 0 : Reply___delete__(int32_t routingId)
108 : {
109 0 : return new IPC::Message(routingId, Reply___delete____ID, 0, IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, "PUDPSocket::Reply___delete__", true);
110 : }
111 :
112 : } // namespace PUDPSocket
113 : } // namespace net
114 : } // namespace mozilla
115 :
116 : //-----------------------------------------------------------------------------
117 : // Method definitions for the IPDL type |struct UDPAddressInfo|
118 : //
119 0 : MOZ_IMPLICIT UDPAddressInfo::UDPAddressInfo() :
120 : addr_(),
121 0 : port_()
122 : {
123 0 : Init();
124 0 : }
125 :
126 0 : UDPAddressInfo::~UDPAddressInfo()
127 : {
128 0 : }
129 :
130 0 : auto UDPAddressInfo::operator==(const UDPAddressInfo& _o) const -> bool
131 : {
132 0 : if ((!((addr()) == ((_o).addr())))) {
133 0 : return false;
134 : }
135 0 : if ((!((port()) == ((_o).port())))) {
136 0 : return false;
137 : }
138 0 : return true;
139 : }
140 :
141 0 : auto UDPAddressInfo::operator!=(const UDPAddressInfo& _o) const -> bool
142 : {
143 0 : return (!(operator==(_o)));
144 : }
145 :
146 0 : auto UDPAddressInfo::Init() -> void
147 : {
148 0 : }
149 :
150 0 : auto UDPAddressInfo::Assign(
151 : const nsCString& _addr,
152 : const uint16_t& _port) -> void
153 : {
154 0 : addr_ = _addr;
155 0 : port_ = _port;
156 0 : }
157 :
158 :
159 : //-----------------------------------------------------------------------------
160 : // Method definitions for the IPDL type |union UDPSocketAddr|
161 : //
162 0 : auto UDPSocketAddr::MaybeDestroy(Type aNewType) -> bool
163 : {
164 0 : if ((mType) == (T__None)) {
165 0 : return true;
166 : }
167 0 : if ((mType) == (aNewType)) {
168 0 : return false;
169 : }
170 0 : switch (mType) {
171 : case TUDPAddressInfo:
172 : {
173 0 : (ptr_UDPAddressInfo())->~UDPAddressInfo__tdef();
174 0 : break;
175 : }
176 : case TNetAddr:
177 : {
178 0 : (ptr_NetAddr())->~NetAddr__tdef();
179 0 : break;
180 : }
181 : default:
182 : {
183 0 : mozilla::ipc::LogicError("not reached");
184 0 : break;
185 : }
186 : }
187 0 : return true;
188 : }
189 :
190 0 : MOZ_IMPLICIT UDPSocketAddr::UDPSocketAddr(const UDPAddressInfo& aOther)
191 : {
192 0 : new (mozilla::KnownNotNull, ptr_UDPAddressInfo()) UDPAddressInfo(aOther);
193 0 : mType = TUDPAddressInfo;
194 0 : }
195 :
196 0 : MOZ_IMPLICIT UDPSocketAddr::UDPSocketAddr(const NetAddr& aOther)
197 : {
198 0 : new (mozilla::KnownNotNull, ptr_NetAddr()) NetAddr(aOther);
199 0 : mType = TNetAddr;
200 0 : }
201 :
202 0 : MOZ_IMPLICIT UDPSocketAddr::UDPSocketAddr(const UDPSocketAddr& aOther)
203 : {
204 0 : (aOther).AssertSanity();
205 0 : switch ((aOther).type()) {
206 : case TUDPAddressInfo:
207 : {
208 0 : new (mozilla::KnownNotNull, ptr_UDPAddressInfo()) UDPAddressInfo((aOther).get_UDPAddressInfo());
209 0 : break;
210 : }
211 : case TNetAddr:
212 : {
213 0 : new (mozilla::KnownNotNull, ptr_NetAddr()) NetAddr((aOther).get_NetAddr());
214 0 : break;
215 : }
216 : case T__None:
217 : {
218 0 : break;
219 : }
220 : default:
221 : {
222 0 : mozilla::ipc::LogicError("unreached");
223 0 : return;
224 : }
225 : }
226 0 : mType = (aOther).type();
227 : }
228 :
229 0 : UDPSocketAddr::~UDPSocketAddr()
230 : {
231 0 : static_cast<void>(MaybeDestroy(T__None));
232 0 : }
233 :
234 0 : auto UDPSocketAddr::operator=(const UDPAddressInfo& aRhs) -> UDPSocketAddr&
235 : {
236 0 : if (MaybeDestroy(TUDPAddressInfo)) {
237 0 : new (mozilla::KnownNotNull, ptr_UDPAddressInfo()) UDPAddressInfo;
238 : }
239 0 : (*(ptr_UDPAddressInfo())) = aRhs;
240 0 : mType = TUDPAddressInfo;
241 0 : return (*(this));
242 : }
243 :
244 0 : auto UDPSocketAddr::operator=(const NetAddr& aRhs) -> UDPSocketAddr&
245 : {
246 0 : if (MaybeDestroy(TNetAddr)) {
247 0 : new (mozilla::KnownNotNull, ptr_NetAddr()) NetAddr;
248 : }
249 0 : (*(ptr_NetAddr())) = aRhs;
250 0 : mType = TNetAddr;
251 0 : return (*(this));
252 : }
253 :
254 0 : auto UDPSocketAddr::operator=(const UDPSocketAddr& aRhs) -> UDPSocketAddr&
255 : {
256 0 : (aRhs).AssertSanity();
257 0 : Type t = (aRhs).type();
258 0 : switch (t) {
259 : case TUDPAddressInfo:
260 : {
261 0 : if (MaybeDestroy(t)) {
262 0 : new (mozilla::KnownNotNull, ptr_UDPAddressInfo()) UDPAddressInfo;
263 : }
264 0 : (*(ptr_UDPAddressInfo())) = (aRhs).get_UDPAddressInfo();
265 0 : break;
266 : }
267 : case TNetAddr:
268 : {
269 0 : if (MaybeDestroy(t)) {
270 0 : new (mozilla::KnownNotNull, ptr_NetAddr()) NetAddr;
271 : }
272 0 : (*(ptr_NetAddr())) = (aRhs).get_NetAddr();
273 0 : break;
274 : }
275 : case T__None:
276 : {
277 0 : static_cast<void>(MaybeDestroy(t));
278 0 : break;
279 : }
280 : default:
281 : {
282 0 : mozilla::ipc::LogicError("unreached");
283 0 : break;
284 : }
285 : }
286 0 : mType = t;
287 0 : return (*(this));
288 : }
289 :
290 0 : auto UDPSocketAddr::operator==(const UDPAddressInfo& aRhs) const -> bool
291 : {
292 0 : return (get_UDPAddressInfo()) == (aRhs);
293 : }
294 :
295 0 : auto UDPSocketAddr::operator==(const NetAddr& aRhs) const -> bool
296 : {
297 0 : return (get_NetAddr()) == (aRhs);
298 : }
299 :
300 0 : auto UDPSocketAddr::operator==(const UDPSocketAddr& aRhs) const -> bool
301 : {
302 0 : if ((type()) != ((aRhs).type())) {
303 0 : return false;
304 : }
305 :
306 0 : switch (type()) {
307 : case TUDPAddressInfo:
308 : {
309 0 : return (get_UDPAddressInfo()) == ((aRhs).get_UDPAddressInfo());
310 : }
311 : case TNetAddr:
312 : {
313 0 : return (get_NetAddr()) == ((aRhs).get_NetAddr());
314 : }
315 : default:
316 : {
317 0 : mozilla::ipc::LogicError("unreached");
318 0 : return false;
319 : }
320 : }
321 : }
322 :
323 0 : auto UDPSocketAddr::get(UDPAddressInfo* aOutValue) const -> void
324 : {
325 0 : (*(aOutValue)) = get_UDPAddressInfo();
326 0 : }
327 :
328 0 : auto UDPSocketAddr::get(NetAddr* aOutValue) const -> void
329 : {
330 0 : (*(aOutValue)) = get_NetAddr();
331 0 : }
332 :
333 :
334 : //-----------------------------------------------------------------------------
335 : // Method definitions for the IPDL type |union UDPData|
336 : //
337 0 : auto UDPData::MaybeDestroy(Type aNewType) -> bool
338 : {
339 0 : if ((mType) == (T__None)) {
340 0 : return true;
341 : }
342 0 : if ((mType) == (aNewType)) {
343 0 : return false;
344 : }
345 0 : switch (mType) {
346 : case TArrayOfuint8_t:
347 : {
348 0 : (ptr_ArrayOfuint8_t())->~ArrayOfuint8_t__tdef();
349 0 : break;
350 : }
351 : case TIPCStream:
352 : {
353 0 : (ptr_IPCStream())->~IPCStream__tdef();
354 0 : break;
355 : }
356 : default:
357 : {
358 0 : mozilla::ipc::LogicError("not reached");
359 0 : break;
360 : }
361 : }
362 0 : return true;
363 : }
364 :
365 0 : MOZ_IMPLICIT UDPData::UDPData(const nsTArray<uint8_t>& aOther)
366 : {
367 0 : new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>(aOther);
368 0 : mType = TArrayOfuint8_t;
369 0 : }
370 :
371 0 : MOZ_IMPLICIT UDPData::UDPData(const IPCStream& aOther)
372 : {
373 0 : new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream(aOther);
374 0 : mType = TIPCStream;
375 0 : }
376 :
377 0 : MOZ_IMPLICIT UDPData::UDPData(const UDPData& aOther)
378 : {
379 0 : (aOther).AssertSanity();
380 0 : switch ((aOther).type()) {
381 : case TArrayOfuint8_t:
382 : {
383 0 : new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>((aOther).get_ArrayOfuint8_t());
384 0 : break;
385 : }
386 : case TIPCStream:
387 : {
388 0 : new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream((aOther).get_IPCStream());
389 0 : break;
390 : }
391 : case T__None:
392 : {
393 0 : break;
394 : }
395 : default:
396 : {
397 0 : mozilla::ipc::LogicError("unreached");
398 0 : return;
399 : }
400 : }
401 0 : mType = (aOther).type();
402 : }
403 :
404 0 : UDPData::~UDPData()
405 : {
406 0 : static_cast<void>(MaybeDestroy(T__None));
407 0 : }
408 :
409 0 : auto UDPData::operator=(const nsTArray<uint8_t>& aRhs) -> UDPData&
410 : {
411 0 : if (MaybeDestroy(TArrayOfuint8_t)) {
412 0 : new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>;
413 : }
414 0 : (*(ptr_ArrayOfuint8_t())) = aRhs;
415 0 : mType = TArrayOfuint8_t;
416 0 : return (*(this));
417 : }
418 :
419 0 : auto UDPData::operator=(const IPCStream& aRhs) -> UDPData&
420 : {
421 0 : if (MaybeDestroy(TIPCStream)) {
422 0 : new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream;
423 : }
424 0 : (*(ptr_IPCStream())) = aRhs;
425 0 : mType = TIPCStream;
426 0 : return (*(this));
427 : }
428 :
429 0 : auto UDPData::operator=(const UDPData& aRhs) -> UDPData&
430 : {
431 0 : (aRhs).AssertSanity();
432 0 : Type t = (aRhs).type();
433 0 : switch (t) {
434 : case TArrayOfuint8_t:
435 : {
436 0 : if (MaybeDestroy(t)) {
437 0 : new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>;
438 : }
439 0 : (*(ptr_ArrayOfuint8_t())) = (aRhs).get_ArrayOfuint8_t();
440 0 : break;
441 : }
442 : case TIPCStream:
443 : {
444 0 : if (MaybeDestroy(t)) {
445 0 : new (mozilla::KnownNotNull, ptr_IPCStream()) IPCStream;
446 : }
447 0 : (*(ptr_IPCStream())) = (aRhs).get_IPCStream();
448 0 : break;
449 : }
450 : case T__None:
451 : {
452 0 : static_cast<void>(MaybeDestroy(t));
453 0 : break;
454 : }
455 : default:
456 : {
457 0 : mozilla::ipc::LogicError("unreached");
458 0 : break;
459 : }
460 : }
461 0 : mType = t;
462 0 : return (*(this));
463 : }
464 :
465 0 : auto UDPData::operator==(const nsTArray<uint8_t>& aRhs) const -> bool
466 : {
467 0 : return (get_ArrayOfuint8_t()) == (aRhs);
468 : }
469 :
470 0 : auto UDPData::operator==(const IPCStream& aRhs) const -> bool
471 : {
472 0 : return (get_IPCStream()) == (aRhs);
473 : }
474 :
475 0 : auto UDPData::operator==(const UDPData& aRhs) const -> bool
476 : {
477 0 : if ((type()) != ((aRhs).type())) {
478 0 : return false;
479 : }
480 :
481 0 : switch (type()) {
482 : case TArrayOfuint8_t:
483 : {
484 0 : return (get_ArrayOfuint8_t()) == ((aRhs).get_ArrayOfuint8_t());
485 : }
486 : case TIPCStream:
487 : {
488 0 : return (get_IPCStream()) == ((aRhs).get_IPCStream());
489 : }
490 : default:
491 : {
492 0 : mozilla::ipc::LogicError("unreached");
493 0 : return false;
494 : }
495 : }
496 : }
497 :
498 0 : auto UDPData::get(nsTArray<uint8_t>* aOutValue) const -> void
499 : {
500 0 : (*(aOutValue)) = get_ArrayOfuint8_t();
501 0 : }
502 :
503 0 : auto UDPData::get(IPCStream* aOutValue) const -> void
504 : {
505 0 : (*(aOutValue)) = get_IPCStream();
506 0 : }
507 :
|