/work/obj-fuzz/ipc/ipdl/PTCPSocketChild.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/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 | | auto PTCPSocketChild::Recv__delete__() -> mozilla::ipc::IPCResult |
20 | 0 | { |
21 | 0 | return IPC_OK(); |
22 | 0 | } |
23 | | |
24 | | auto PTCPSocketChild::ActorDestroy(ActorDestroyReason aWhy) -> void |
25 | 0 | { |
26 | 0 | } |
27 | | |
28 | | MOZ_IMPLICIT PTCPSocketChild::PTCPSocketChild() : |
29 | | mozilla::ipc::IProtocol(mozilla::ipc::ChildSide), |
30 | | mLivenessState(mozilla::ipc::LivenessState::Dead) |
31 | 0 | { |
32 | 0 | MOZ_COUNT_CTOR(PTCPSocketChild); |
33 | 0 | } |
34 | | |
35 | | PTCPSocketChild::~PTCPSocketChild() |
36 | 0 | { |
37 | 0 | MOZ_COUNT_DTOR(PTCPSocketChild); |
38 | 0 | } |
39 | | |
40 | | auto PTCPSocketChild::Manager() const -> PNeckoChild* |
41 | 0 | { |
42 | 0 | return static_cast<PNeckoChild*>(IProtocol::Manager()); |
43 | 0 | } |
44 | | |
45 | | auto PTCPSocketChild::SendOpen( |
46 | | const nsString& host, |
47 | | const uint16_t& port, |
48 | | const bool& useSSL, |
49 | | const bool& useArrayBuffers) -> bool |
50 | 0 | { |
51 | 0 | IPC::Message* msg__ = PTCPSocket::Msg_Open(Id()); |
52 | 0 |
|
53 | 0 | WriteIPDLParam(msg__, this, host); |
54 | 0 | // Sentinel = 'host' |
55 | 0 | (msg__)->WriteSentinel(4070301394); |
56 | 0 | WriteIPDLParam(msg__, this, port); |
57 | 0 | // Sentinel = 'port' |
58 | 0 | (msg__)->WriteSentinel(3633211549); |
59 | 0 | WriteIPDLParam(msg__, this, useSSL); |
60 | 0 | // Sentinel = 'useSSL' |
61 | 0 | (msg__)->WriteSentinel(714252035); |
62 | 0 | WriteIPDLParam(msg__, this, useArrayBuffers); |
63 | 0 | // Sentinel = 'useArrayBuffers' |
64 | 0 | (msg__)->WriteSentinel(1444022734); |
65 | 0 |
|
66 | 0 |
|
67 | 0 |
|
68 | 0 |
|
69 | 0 | if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) { |
70 | 0 | mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
71 | 0 | } |
72 | 0 | AUTO_PROFILER_LABEL("PTCPSocket::Msg_Open", OTHER); |
73 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
74 | 0 | mozilla::ipc::LogicError("Transition error"); |
75 | 0 | } |
76 | 0 |
|
77 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
78 | 0 | return sendok__; |
79 | 0 | } |
80 | | |
81 | | auto PTCPSocketChild::SendOpenBind( |
82 | | const nsCString& host, |
83 | | const uint16_t& port, |
84 | | const nsCString& localAddr, |
85 | | const uint16_t& localPort, |
86 | | const bool& useSSL, |
87 | | const bool& reuseAddrPort, |
88 | | const bool& aUseArrayBuffers, |
89 | | const nsCString& aFilter) -> bool |
90 | 0 | { |
91 | 0 | IPC::Message* msg__ = PTCPSocket::Msg_OpenBind(Id()); |
92 | 0 |
|
93 | 0 | WriteIPDLParam(msg__, this, host); |
94 | 0 | // Sentinel = 'host' |
95 | 0 | (msg__)->WriteSentinel(4070301394); |
96 | 0 | WriteIPDLParam(msg__, this, port); |
97 | 0 | // Sentinel = 'port' |
98 | 0 | (msg__)->WriteSentinel(3633211549); |
99 | 0 | WriteIPDLParam(msg__, this, localAddr); |
100 | 0 | // Sentinel = 'localAddr' |
101 | 0 | (msg__)->WriteSentinel(986524165); |
102 | 0 | WriteIPDLParam(msg__, this, localPort); |
103 | 0 | // Sentinel = 'localPort' |
104 | 0 | (msg__)->WriteSentinel(2930268933); |
105 | 0 | WriteIPDLParam(msg__, this, useSSL); |
106 | 0 | // Sentinel = 'useSSL' |
107 | 0 | (msg__)->WriteSentinel(714252035); |
108 | 0 | WriteIPDLParam(msg__, this, reuseAddrPort); |
109 | 0 | // Sentinel = 'reuseAddrPort' |
110 | 0 | (msg__)->WriteSentinel(3461003689); |
111 | 0 | WriteIPDLParam(msg__, this, aUseArrayBuffers); |
112 | 0 | // Sentinel = 'aUseArrayBuffers' |
113 | 0 | (msg__)->WriteSentinel(1388383946); |
114 | 0 | WriteIPDLParam(msg__, this, aFilter); |
115 | 0 | // Sentinel = 'aFilter' |
116 | 0 | (msg__)->WriteSentinel(1227311512); |
117 | 0 |
|
118 | 0 |
|
119 | 0 |
|
120 | 0 |
|
121 | 0 | if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) { |
122 | 0 | mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
123 | 0 | } |
124 | 0 | AUTO_PROFILER_LABEL("PTCPSocket::Msg_OpenBind", OTHER); |
125 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
126 | 0 | mozilla::ipc::LogicError("Transition error"); |
127 | 0 | } |
128 | 0 |
|
129 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
130 | 0 | return sendok__; |
131 | 0 | } |
132 | | |
133 | | auto PTCPSocketChild::SendData( |
134 | | const SendableData& data, |
135 | | const uint32_t& trackingNumber) -> bool |
136 | 0 | { |
137 | 0 | IPC::Message* msg__ = PTCPSocket::Msg_Data(Id()); |
138 | 0 |
|
139 | 0 | WriteIPDLParam(msg__, this, data); |
140 | 0 | // Sentinel = 'data' |
141 | 0 | (msg__)->WriteSentinel(843352540); |
142 | 0 | WriteIPDLParam(msg__, this, trackingNumber); |
143 | 0 | // Sentinel = 'trackingNumber' |
144 | 0 | (msg__)->WriteSentinel(272285434); |
145 | 0 |
|
146 | 0 |
|
147 | 0 |
|
148 | 0 |
|
149 | 0 | if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) { |
150 | 0 | mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
151 | 0 | } |
152 | 0 | AUTO_PROFILER_LABEL("PTCPSocket::Msg_Data", OTHER); |
153 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
154 | 0 | mozilla::ipc::LogicError("Transition error"); |
155 | 0 | } |
156 | 0 |
|
157 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
158 | 0 | return sendok__; |
159 | 0 | } |
160 | | |
161 | | auto PTCPSocketChild::SendStartTLS() -> bool |
162 | 0 | { |
163 | 0 | IPC::Message* msg__ = PTCPSocket::Msg_StartTLS(Id()); |
164 | 0 |
|
165 | 0 |
|
166 | 0 |
|
167 | 0 |
|
168 | 0 |
|
169 | 0 | if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) { |
170 | 0 | mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
171 | 0 | } |
172 | 0 | AUTO_PROFILER_LABEL("PTCPSocket::Msg_StartTLS", OTHER); |
173 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
174 | 0 | mozilla::ipc::LogicError("Transition error"); |
175 | 0 | } |
176 | 0 |
|
177 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
178 | 0 | return sendok__; |
179 | 0 | } |
180 | | |
181 | | auto PTCPSocketChild::SendSuspend() -> bool |
182 | 0 | { |
183 | 0 | IPC::Message* msg__ = PTCPSocket::Msg_Suspend(Id()); |
184 | 0 |
|
185 | 0 |
|
186 | 0 |
|
187 | 0 |
|
188 | 0 |
|
189 | 0 | if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) { |
190 | 0 | mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
191 | 0 | } |
192 | 0 | AUTO_PROFILER_LABEL("PTCPSocket::Msg_Suspend", OTHER); |
193 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
194 | 0 | mozilla::ipc::LogicError("Transition error"); |
195 | 0 | } |
196 | 0 |
|
197 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
198 | 0 | return sendok__; |
199 | 0 | } |
200 | | |
201 | | auto PTCPSocketChild::SendResume() -> bool |
202 | 0 | { |
203 | 0 | IPC::Message* msg__ = PTCPSocket::Msg_Resume(Id()); |
204 | 0 |
|
205 | 0 |
|
206 | 0 |
|
207 | 0 |
|
208 | 0 |
|
209 | 0 | if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) { |
210 | 0 | mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
211 | 0 | } |
212 | 0 | AUTO_PROFILER_LABEL("PTCPSocket::Msg_Resume", OTHER); |
213 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
214 | 0 | mozilla::ipc::LogicError("Transition error"); |
215 | 0 | } |
216 | 0 |
|
217 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
218 | 0 | return sendok__; |
219 | 0 | } |
220 | | |
221 | | auto PTCPSocketChild::SendClose() -> bool |
222 | 0 | { |
223 | 0 | IPC::Message* msg__ = PTCPSocket::Msg_Close(Id()); |
224 | 0 |
|
225 | 0 |
|
226 | 0 |
|
227 | 0 |
|
228 | 0 |
|
229 | 0 | if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) { |
230 | 0 | mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
231 | 0 | } |
232 | 0 | AUTO_PROFILER_LABEL("PTCPSocket::Msg_Close", OTHER); |
233 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
234 | 0 | mozilla::ipc::LogicError("Transition error"); |
235 | 0 | } |
236 | 0 |
|
237 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
238 | 0 | return sendok__; |
239 | 0 | } |
240 | | |
241 | | auto PTCPSocketChild::SendRequestDelete() -> bool |
242 | 0 | { |
243 | 0 | IPC::Message* msg__ = PTCPSocket::Msg_RequestDelete(Id()); |
244 | 0 |
|
245 | 0 |
|
246 | 0 |
|
247 | 0 |
|
248 | 0 |
|
249 | 0 | if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) { |
250 | 0 | mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
251 | 0 | } |
252 | 0 | AUTO_PROFILER_LABEL("PTCPSocket::Msg_RequestDelete", OTHER); |
253 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
254 | 0 | mozilla::ipc::LogicError("Transition error"); |
255 | 0 | } |
256 | 0 |
|
257 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
258 | 0 | return sendok__; |
259 | 0 | } |
260 | | |
261 | | auto PTCPSocketChild::Send__delete__(PTCPSocketChild* actor) -> bool |
262 | 0 | { |
263 | 0 | if ((!(actor))) { |
264 | 0 | return false; |
265 | 0 | } |
266 | 0 | |
267 | 0 | IPC::Message* msg__ = PTCPSocket::Msg___delete__((actor)->Id()); |
268 | 0 |
|
269 | 0 | MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param"); |
270 | 0 | WriteIPDLParam(msg__, actor, actor); |
271 | 0 | // Sentinel = 'actor' |
272 | 0 | (msg__)->WriteSentinel(875202478); |
273 | 0 |
|
274 | 0 |
|
275 | 0 |
|
276 | 0 | if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) { |
277 | 0 | mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
278 | 0 | } |
279 | 0 | AUTO_PROFILER_LABEL("PTCPSocket::Msg___delete__", OTHER); |
280 | 0 | if ((!(StateTransition(true, (&((actor)->mLivenessState)))))) { |
281 | 0 | mozilla::ipc::LogicError("Transition error"); |
282 | 0 | } |
283 | 0 |
|
284 | 0 | bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__); |
285 | 0 |
|
286 | 0 | IProtocol* mgr = (actor)->Manager(); |
287 | 0 | (actor)->DestroySubtree(Deletion); |
288 | 0 | (actor)->DeallocSubtree(); |
289 | 0 | (mgr)->RemoveManagee(PTCPSocketMsgStart, actor); |
290 | 0 | return sendok__; |
291 | 0 | } |
292 | | |
293 | | auto PTCPSocketChild::RemoveManagee( |
294 | | int32_t aProtocolId, |
295 | | IProtocol* aListener) -> void |
296 | 0 | { |
297 | 0 | FatalError("unreached"); |
298 | 0 | return; |
299 | 0 | } |
300 | | |
301 | | auto PTCPSocketChild::OnMessageReceived(const Message& msg__) -> PTCPSocketChild::Result |
302 | 0 | { |
303 | 0 | switch ((msg__).type()) { |
304 | 0 | case PTCPSocket::Msg_Callback__ID: |
305 | 0 | { |
306 | 0 | if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) { |
307 | 0 | mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
308 | 0 | } |
309 | 0 | AUTO_PROFILER_LABEL("PTCPSocket::Msg_Callback", OTHER); |
310 | 0 |
|
311 | 0 | PickleIterator iter__(msg__); |
312 | 0 | nsString type; |
313 | 0 | CallbackData data; |
314 | 0 | uint32_t readyState; |
315 | 0 |
|
316 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(type)))))) { |
317 | 0 | FatalError("Error deserializing 'nsString'"); |
318 | 0 | return MsgValueError; |
319 | 0 | } |
320 | 0 | // Sentinel = 'type' |
321 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2982068540)))) { |
322 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); |
323 | 0 | return MsgValueError; |
324 | 0 | } |
325 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(data)))))) { |
326 | 0 | FatalError("Error deserializing 'CallbackData'"); |
327 | 0 | return MsgValueError; |
328 | 0 | } |
329 | 0 | // Sentinel = 'data' |
330 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 843352540)))) { |
331 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'CallbackData'"); |
332 | 0 | return MsgValueError; |
333 | 0 | } |
334 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(readyState)))))) { |
335 | 0 | FatalError("Error deserializing 'uint32_t'"); |
336 | 0 | return MsgValueError; |
337 | 0 | } |
338 | 0 | // Sentinel = 'readyState' |
339 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 572411746)))) { |
340 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
341 | 0 | return MsgValueError; |
342 | 0 | } |
343 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
344 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
345 | 0 | FatalError("Transition error"); |
346 | 0 | return MsgValueError; |
347 | 0 | } |
348 | 0 | if ((!(RecvCallback(type, data, readyState)))) { |
349 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
350 | 0 | // Error handled in mozilla::ipc::IPCResult |
351 | 0 | return MsgProcessingError; |
352 | 0 | } |
353 | 0 | |
354 | 0 | return MsgProcessed; |
355 | 0 | } |
356 | 0 | case PTCPSocket::Msg_UpdateBufferedAmount__ID: |
357 | 0 | { |
358 | 0 | if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) { |
359 | 0 | mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
360 | 0 | } |
361 | 0 | AUTO_PROFILER_LABEL("PTCPSocket::Msg_UpdateBufferedAmount", OTHER); |
362 | 0 |
|
363 | 0 | PickleIterator iter__(msg__); |
364 | 0 | uint32_t bufferedAmount; |
365 | 0 | uint32_t trackingNumber; |
366 | 0 |
|
367 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(bufferedAmount)))))) { |
368 | 0 | FatalError("Error deserializing 'uint32_t'"); |
369 | 0 | return MsgValueError; |
370 | 0 | } |
371 | 0 | // Sentinel = 'bufferedAmount' |
372 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 580364331)))) { |
373 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
374 | 0 | return MsgValueError; |
375 | 0 | } |
376 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(trackingNumber)))))) { |
377 | 0 | FatalError("Error deserializing 'uint32_t'"); |
378 | 0 | return MsgValueError; |
379 | 0 | } |
380 | 0 | // Sentinel = 'trackingNumber' |
381 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 272285434)))) { |
382 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
383 | 0 | return MsgValueError; |
384 | 0 | } |
385 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
386 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
387 | 0 | FatalError("Transition error"); |
388 | 0 | return MsgValueError; |
389 | 0 | } |
390 | 0 | if ((!(RecvUpdateBufferedAmount(bufferedAmount, trackingNumber)))) { |
391 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
392 | 0 | // Error handled in mozilla::ipc::IPCResult |
393 | 0 | return MsgProcessingError; |
394 | 0 | } |
395 | 0 | |
396 | 0 | return MsgProcessed; |
397 | 0 | } |
398 | 0 | case PTCPSocket::Msg_RequestDelete__ID: |
399 | 0 | { |
400 | 0 | if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) { |
401 | 0 | mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
402 | 0 | } |
403 | 0 | AUTO_PROFILER_LABEL("PTCPSocket::Msg_RequestDelete", OTHER); |
404 | 0 |
|
405 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
406 | 0 | FatalError("Transition error"); |
407 | 0 | return MsgValueError; |
408 | 0 | } |
409 | 0 | if ((!(RecvRequestDelete()))) { |
410 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
411 | 0 | // Error handled in mozilla::ipc::IPCResult |
412 | 0 | return MsgProcessingError; |
413 | 0 | } |
414 | 0 | |
415 | 0 | return MsgProcessed; |
416 | 0 | } |
417 | 0 | case PTCPSocket::Reply___delete____ID: |
418 | 0 | { |
419 | 0 | return MsgProcessed; |
420 | 0 | } |
421 | 0 | case PTCPSocket::Msg___delete____ID: |
422 | 0 | { |
423 | 0 | if (mozilla::ipc::LoggingEnabledFor("PTCPSocketChild")) { |
424 | 0 | mozilla::ipc::LogMessageForProtocol("PTCPSocketChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
425 | 0 | } |
426 | 0 | AUTO_PROFILER_LABEL("PTCPSocket::Msg___delete__", OTHER); |
427 | 0 |
|
428 | 0 | PickleIterator iter__(msg__); |
429 | 0 | PTCPSocketChild* actor; |
430 | 0 |
|
431 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) { |
432 | 0 | FatalError("Error deserializing 'PTCPSocketChild'"); |
433 | 0 | return MsgValueError; |
434 | 0 | } |
435 | 0 | if ((!((*((&(actor))))))) { |
436 | 0 | FatalError("Error deserializing 'PTCPSocketChild'"); |
437 | 0 | return MsgValueError; |
438 | 0 | } |
439 | 0 | // Sentinel = 'actor' |
440 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) { |
441 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'PTCPSocketChild'"); |
442 | 0 | return MsgValueError; |
443 | 0 | } |
444 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
445 | 0 | if ((!(StateTransition(true, (&(mLivenessState)))))) { |
446 | 0 | FatalError("Transition error"); |
447 | 0 | return MsgValueError; |
448 | 0 | } |
449 | 0 | if ((!(Recv__delete__()))) { |
450 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
451 | 0 | // Error handled in mozilla::ipc::IPCResult |
452 | 0 | return MsgProcessingError; |
453 | 0 | } |
454 | 0 | |
455 | 0 | |
456 | 0 | IProtocol* mgr = (actor)->Manager(); |
457 | 0 | (actor)->DestroySubtree(Deletion); |
458 | 0 | (actor)->DeallocSubtree(); |
459 | 0 | (mgr)->RemoveManagee(PTCPSocketMsgStart, actor); |
460 | 0 |
|
461 | 0 | return MsgProcessed; |
462 | 0 | } |
463 | 0 | default: |
464 | 0 | { |
465 | 0 | return MsgNotKnown; |
466 | 0 | } |
467 | 0 | } |
468 | 0 | } |
469 | | |
470 | | auto PTCPSocketChild::OnMessageReceived( |
471 | | const Message& msg__, |
472 | | Message*& reply__) -> PTCPSocketChild::Result |
473 | 0 | { |
474 | 0 | return MsgNotKnown; |
475 | 0 | } |
476 | | |
477 | | auto PTCPSocketChild::OnCallReceived( |
478 | | const Message& msg__, |
479 | | Message*& reply__) -> PTCPSocketChild::Result |
480 | 0 | { |
481 | 0 | MOZ_ASSERT_UNREACHABLE("message protocol not supported"); |
482 | 0 | return MsgNotKnown; |
483 | 0 | } |
484 | | |
485 | | auto PTCPSocketChild::GetProtocolTypeId() -> int32_t |
486 | 0 | { |
487 | 0 | return PTCPSocketMsgStart; |
488 | 0 | } |
489 | | |
490 | | auto PTCPSocketChild::DestroySubtree(ActorDestroyReason why) -> void |
491 | 0 | { |
492 | 0 | // Unregister from our manager. |
493 | 0 | Unregister(Id()); |
494 | 0 |
|
495 | 0 | // Reject owning pending responses. |
496 | 0 | (GetIPCChannel())->RejectPendingResponsesForActor(this); |
497 | 0 |
|
498 | 0 | // Finally, destroy "us". |
499 | 0 | ActorDestroy(why); |
500 | 0 | } |
501 | | |
502 | | auto PTCPSocketChild::DeallocSubtree() -> void |
503 | 0 | { |
504 | 0 | } |
505 | | |
506 | | |
507 | | |
508 | | } // namespace net |
509 | | } // namespace mozilla |
510 | | namespace mozilla { |
511 | | namespace ipc { |
512 | | auto IPDLParamTraits<mozilla::net::PTCPSocketChild>::Write( |
513 | | IPC::Message* aMsg, |
514 | | mozilla::ipc::IProtocol* aActor, |
515 | | const paramType& aVar) -> void |
516 | 0 | { |
517 | 0 | int32_t id; |
518 | 0 | if ((!(aVar))) { |
519 | 0 | id = 0; |
520 | 0 | } |
521 | 0 | else { |
522 | 0 | id = (aVar)->Id(); |
523 | 0 | if ((1) == (id)) { |
524 | 0 | (aActor)->FatalError("actor has been |delete|d"); |
525 | 0 | } |
526 | 0 | } |
527 | 0 | WriteIPDLParam(aMsg, aActor, id); |
528 | 0 | } |
529 | | |
530 | | auto IPDLParamTraits<mozilla::net::PTCPSocketChild>::Read( |
531 | | const IPC::Message* aMsg, |
532 | | PickleIterator* aIter, |
533 | | mozilla::ipc::IProtocol* aActor, |
534 | | paramType* aVar) -> bool |
535 | 0 | { |
536 | 0 | mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PTCPSocket", PTCPSocketMsgStart); |
537 | 0 | if ((actor).isNothing()) { |
538 | 0 | return false; |
539 | 0 | } |
540 | 0 | |
541 | 0 | (*(aVar)) = static_cast<mozilla::net::PTCPSocketChild*>((actor).value()); |
542 | 0 | return true; |
543 | 0 | } |
544 | | |
545 | | } // namespace ipc |
546 | | } // namespace mozilla |