/work/obj-fuzz/ipc/ipdl/PWebSocketParent.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/PWebSocketParent.h" |
8 | | #include "SerializedLoadContext.h" |
9 | | #include "ipc/IPCMessageUtils.h" |
10 | | |
11 | | #include "mozilla/net/PNeckoParent.h" |
12 | | #include "mozilla/dom/PBrowserParent.h" |
13 | | #include "mozilla/net/PTransportProviderParent.h" |
14 | | #include "mozilla/ipc/PFileDescriptorSetParent.h" |
15 | | #include "mozilla/ipc/PChildToParentStreamParent.h" |
16 | | #include "mozilla/ipc/PParentToChildStreamParent.h" |
17 | | |
18 | | #include "nsIFile.h" |
19 | | #include "GeckoProfiler.h" |
20 | | |
21 | | namespace mozilla { |
22 | | namespace net { |
23 | | |
24 | | |
25 | | auto PWebSocketParent::ActorDestroy(ActorDestroyReason aWhy) -> void |
26 | 0 | { |
27 | 0 | } |
28 | | |
29 | | MOZ_IMPLICIT PWebSocketParent::PWebSocketParent() : |
30 | | mozilla::ipc::IProtocol(mozilla::ipc::ParentSide), |
31 | | mLivenessState(mozilla::ipc::LivenessState::Dead) |
32 | 0 | { |
33 | 0 | MOZ_COUNT_CTOR(PWebSocketParent); |
34 | 0 | } |
35 | | |
36 | | PWebSocketParent::~PWebSocketParent() |
37 | 0 | { |
38 | 0 | MOZ_COUNT_DTOR(PWebSocketParent); |
39 | 0 | } |
40 | | |
41 | | auto PWebSocketParent::Manager() const -> PNeckoParent* |
42 | 0 | { |
43 | 0 | return static_cast<PNeckoParent*>(IProtocol::Manager()); |
44 | 0 | } |
45 | | |
46 | | auto PWebSocketParent::SendOnStart( |
47 | | const nsCString& aProtocol, |
48 | | const nsCString& aExtensions, |
49 | | const nsString& aEffectiveURL, |
50 | | const bool& aEncrypted) -> bool |
51 | 0 | { |
52 | 0 | IPC::Message* msg__ = PWebSocket::Msg_OnStart(Id()); |
53 | 0 |
|
54 | 0 | WriteIPDLParam(msg__, this, aProtocol); |
55 | 0 | // Sentinel = 'aProtocol' |
56 | 0 | (msg__)->WriteSentinel(3505310484); |
57 | 0 | WriteIPDLParam(msg__, this, aExtensions); |
58 | 0 | // Sentinel = 'aExtensions' |
59 | 0 | (msg__)->WriteSentinel(805668716); |
60 | 0 | WriteIPDLParam(msg__, this, aEffectiveURL); |
61 | 0 | // Sentinel = 'aEffectiveURL' |
62 | 0 | (msg__)->WriteSentinel(2123459946); |
63 | 0 | WriteIPDLParam(msg__, this, aEncrypted); |
64 | 0 | // Sentinel = 'aEncrypted' |
65 | 0 | (msg__)->WriteSentinel(3962043913); |
66 | 0 |
|
67 | 0 |
|
68 | 0 |
|
69 | 0 |
|
70 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebSocketParent")) { |
71 | 0 | mozilla::ipc::LogMessageForProtocol("PWebSocketParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
72 | 0 | } |
73 | 0 | AUTO_PROFILER_LABEL("PWebSocket::Msg_OnStart", OTHER); |
74 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
75 | 0 | mozilla::ipc::LogicError("Transition error"); |
76 | 0 | } |
77 | 0 |
|
78 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
79 | 0 | return sendok__; |
80 | 0 | } |
81 | | |
82 | | auto PWebSocketParent::SendOnStop(const nsresult& aStatusCode) -> bool |
83 | 0 | { |
84 | 0 | IPC::Message* msg__ = PWebSocket::Msg_OnStop(Id()); |
85 | 0 |
|
86 | 0 | WriteIPDLParam(msg__, this, aStatusCode); |
87 | 0 | // Sentinel = 'aStatusCode' |
88 | 0 | (msg__)->WriteSentinel(3484261911); |
89 | 0 |
|
90 | 0 |
|
91 | 0 |
|
92 | 0 |
|
93 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebSocketParent")) { |
94 | 0 | mozilla::ipc::LogMessageForProtocol("PWebSocketParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
95 | 0 | } |
96 | 0 | AUTO_PROFILER_LABEL("PWebSocket::Msg_OnStop", OTHER); |
97 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
98 | 0 | mozilla::ipc::LogicError("Transition error"); |
99 | 0 | } |
100 | 0 |
|
101 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
102 | 0 | return sendok__; |
103 | 0 | } |
104 | | |
105 | | auto PWebSocketParent::SendOnMessageAvailable(const nsCString& aMsg) -> bool |
106 | 0 | { |
107 | 0 | IPC::Message* msg__ = PWebSocket::Msg_OnMessageAvailable(Id()); |
108 | 0 |
|
109 | 0 | WriteIPDLParam(msg__, this, aMsg); |
110 | 0 | // Sentinel = 'aMsg' |
111 | 0 | (msg__)->WriteSentinel(3584578888); |
112 | 0 |
|
113 | 0 |
|
114 | 0 |
|
115 | 0 |
|
116 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebSocketParent")) { |
117 | 0 | mozilla::ipc::LogMessageForProtocol("PWebSocketParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
118 | 0 | } |
119 | 0 | AUTO_PROFILER_LABEL("PWebSocket::Msg_OnMessageAvailable", OTHER); |
120 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
121 | 0 | mozilla::ipc::LogicError("Transition error"); |
122 | 0 | } |
123 | 0 |
|
124 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
125 | 0 | return sendok__; |
126 | 0 | } |
127 | | |
128 | | auto PWebSocketParent::SendOnBinaryMessageAvailable(const nsCString& aMsg) -> bool |
129 | 0 | { |
130 | 0 | IPC::Message* msg__ = PWebSocket::Msg_OnBinaryMessageAvailable(Id()); |
131 | 0 |
|
132 | 0 | WriteIPDLParam(msg__, this, aMsg); |
133 | 0 | // Sentinel = 'aMsg' |
134 | 0 | (msg__)->WriteSentinel(3584578888); |
135 | 0 |
|
136 | 0 |
|
137 | 0 |
|
138 | 0 |
|
139 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebSocketParent")) { |
140 | 0 | mozilla::ipc::LogMessageForProtocol("PWebSocketParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
141 | 0 | } |
142 | 0 | AUTO_PROFILER_LABEL("PWebSocket::Msg_OnBinaryMessageAvailable", OTHER); |
143 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
144 | 0 | mozilla::ipc::LogicError("Transition error"); |
145 | 0 | } |
146 | 0 |
|
147 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
148 | 0 | return sendok__; |
149 | 0 | } |
150 | | |
151 | | auto PWebSocketParent::SendOnAcknowledge(const uint32_t& aSize) -> bool |
152 | 0 | { |
153 | 0 | IPC::Message* msg__ = PWebSocket::Msg_OnAcknowledge(Id()); |
154 | 0 |
|
155 | 0 | WriteIPDLParam(msg__, this, aSize); |
156 | 0 | // Sentinel = 'aSize' |
157 | 0 | (msg__)->WriteSentinel(2556665555); |
158 | 0 |
|
159 | 0 |
|
160 | 0 |
|
161 | 0 |
|
162 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebSocketParent")) { |
163 | 0 | mozilla::ipc::LogMessageForProtocol("PWebSocketParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
164 | 0 | } |
165 | 0 | AUTO_PROFILER_LABEL("PWebSocket::Msg_OnAcknowledge", OTHER); |
166 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
167 | 0 | mozilla::ipc::LogicError("Transition error"); |
168 | 0 | } |
169 | 0 |
|
170 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
171 | 0 | return sendok__; |
172 | 0 | } |
173 | | |
174 | | auto PWebSocketParent::SendOnServerClose( |
175 | | const uint16_t& code, |
176 | | const nsCString& aReason) -> bool |
177 | 0 | { |
178 | 0 | IPC::Message* msg__ = PWebSocket::Msg_OnServerClose(Id()); |
179 | 0 |
|
180 | 0 | WriteIPDLParam(msg__, this, code); |
181 | 0 | // Sentinel = 'code' |
182 | 0 | (msg__)->WriteSentinel(3318913027); |
183 | 0 | WriteIPDLParam(msg__, this, aReason); |
184 | 0 | // Sentinel = 'aReason' |
185 | 0 | (msg__)->WriteSentinel(829905706); |
186 | 0 |
|
187 | 0 |
|
188 | 0 |
|
189 | 0 |
|
190 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebSocketParent")) { |
191 | 0 | mozilla::ipc::LogMessageForProtocol("PWebSocketParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
192 | 0 | } |
193 | 0 | AUTO_PROFILER_LABEL("PWebSocket::Msg_OnServerClose", OTHER); |
194 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
195 | 0 | mozilla::ipc::LogicError("Transition error"); |
196 | 0 | } |
197 | 0 |
|
198 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
199 | 0 | return sendok__; |
200 | 0 | } |
201 | | |
202 | | auto PWebSocketParent::Send__delete__(PWebSocketParent* actor) -> bool |
203 | 0 | { |
204 | 0 | if ((!(actor))) { |
205 | 0 | return false; |
206 | 0 | } |
207 | 0 | |
208 | 0 | IPC::Message* msg__ = PWebSocket::Msg___delete__((actor)->Id()); |
209 | 0 |
|
210 | 0 | MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param"); |
211 | 0 | WriteIPDLParam(msg__, actor, actor); |
212 | 0 | // Sentinel = 'actor' |
213 | 0 | (msg__)->WriteSentinel(875202478); |
214 | 0 |
|
215 | 0 |
|
216 | 0 |
|
217 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebSocketParent")) { |
218 | 0 | mozilla::ipc::LogMessageForProtocol("PWebSocketParent", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
219 | 0 | } |
220 | 0 | AUTO_PROFILER_LABEL("PWebSocket::Msg___delete__", OTHER); |
221 | 0 | if ((!(StateTransition(true, (&((actor)->mLivenessState)))))) { |
222 | 0 | mozilla::ipc::LogicError("Transition error"); |
223 | 0 | } |
224 | 0 |
|
225 | 0 | bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__); |
226 | 0 |
|
227 | 0 | IProtocol* mgr = (actor)->Manager(); |
228 | 0 | (actor)->DestroySubtree(Deletion); |
229 | 0 | (actor)->DeallocSubtree(); |
230 | 0 | (mgr)->RemoveManagee(PWebSocketMsgStart, actor); |
231 | 0 | return sendok__; |
232 | 0 | } |
233 | | |
234 | | auto PWebSocketParent::RemoveManagee( |
235 | | int32_t aProtocolId, |
236 | | IProtocol* aListener) -> void |
237 | 0 | { |
238 | 0 | FatalError("unreached"); |
239 | 0 | return; |
240 | 0 | } |
241 | | |
242 | | auto PWebSocketParent::OnMessageReceived(const Message& msg__) -> PWebSocketParent::Result |
243 | 0 | { |
244 | 0 | switch ((msg__).type()) { |
245 | 0 | case PWebSocket::Msg_AsyncOpen__ID: |
246 | 0 | { |
247 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebSocketParent")) { |
248 | 0 | mozilla::ipc::LogMessageForProtocol("PWebSocketParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
249 | 0 | } |
250 | 0 | AUTO_PROFILER_LABEL("PWebSocket::Msg_AsyncOpen", OTHER); |
251 | 0 |
|
252 | 0 | PickleIterator iter__(msg__); |
253 | 0 | OptionalURIParams aURI; |
254 | 0 | nsCString aOrigin; |
255 | 0 | uint64_t aInnerWindowID; |
256 | 0 | nsCString aProtocol; |
257 | 0 | bool aSecure; |
258 | 0 | uint32_t aPingInterval; |
259 | 0 | bool aClientSetPingInterval; |
260 | 0 | uint32_t aPingTimeout; |
261 | 0 | bool aClientSetPingTimeout; |
262 | 0 | OptionalLoadInfoArgs aLoadInfoArgs; |
263 | 0 | OptionalTransportProvider aProvider; |
264 | 0 | nsCString aNegotiatedExtensions; |
265 | 0 |
|
266 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aURI)))))) { |
267 | 0 | FatalError("Error deserializing 'OptionalURIParams'"); |
268 | 0 | return MsgValueError; |
269 | 0 | } |
270 | 0 | // Sentinel = 'aURI' |
271 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2075506333)))) { |
272 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'OptionalURIParams'"); |
273 | 0 | return MsgValueError; |
274 | 0 | } |
275 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aOrigin)))))) { |
276 | 0 | FatalError("Error deserializing 'nsCString'"); |
277 | 0 | return MsgValueError; |
278 | 0 | } |
279 | 0 | // Sentinel = 'aOrigin' |
280 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2118207704)))) { |
281 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'"); |
282 | 0 | return MsgValueError; |
283 | 0 | } |
284 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aInnerWindowID)))))) { |
285 | 0 | FatalError("Error deserializing 'uint64_t'"); |
286 | 0 | return MsgValueError; |
287 | 0 | } |
288 | 0 | // Sentinel = 'aInnerWindowID' |
289 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3059251422)))) { |
290 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'"); |
291 | 0 | return MsgValueError; |
292 | 0 | } |
293 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aProtocol)))))) { |
294 | 0 | FatalError("Error deserializing 'nsCString'"); |
295 | 0 | return MsgValueError; |
296 | 0 | } |
297 | 0 | // Sentinel = 'aProtocol' |
298 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3505310484)))) { |
299 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'"); |
300 | 0 | return MsgValueError; |
301 | 0 | } |
302 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aSecure)))))) { |
303 | 0 | FatalError("Error deserializing 'bool'"); |
304 | 0 | return MsgValueError; |
305 | 0 | } |
306 | 0 | // Sentinel = 'aSecure' |
307 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4071505201)))) { |
308 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); |
309 | 0 | return MsgValueError; |
310 | 0 | } |
311 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aPingInterval)))))) { |
312 | 0 | FatalError("Error deserializing 'uint32_t'"); |
313 | 0 | return MsgValueError; |
314 | 0 | } |
315 | 0 | // Sentinel = 'aPingInterval' |
316 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 407028319)))) { |
317 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
318 | 0 | return MsgValueError; |
319 | 0 | } |
320 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aClientSetPingInterval)))))) { |
321 | 0 | FatalError("Error deserializing 'bool'"); |
322 | 0 | return MsgValueError; |
323 | 0 | } |
324 | 0 | // Sentinel = 'aClientSetPingInterval' |
325 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3486439937)))) { |
326 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); |
327 | 0 | return MsgValueError; |
328 | 0 | } |
329 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aPingTimeout)))))) { |
330 | 0 | FatalError("Error deserializing 'uint32_t'"); |
331 | 0 | return MsgValueError; |
332 | 0 | } |
333 | 0 | // Sentinel = 'aPingTimeout' |
334 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1400185874)))) { |
335 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
336 | 0 | return MsgValueError; |
337 | 0 | } |
338 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aClientSetPingTimeout)))))) { |
339 | 0 | FatalError("Error deserializing 'bool'"); |
340 | 0 | return MsgValueError; |
341 | 0 | } |
342 | 0 | // Sentinel = 'aClientSetPingTimeout' |
343 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2731101232)))) { |
344 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); |
345 | 0 | return MsgValueError; |
346 | 0 | } |
347 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aLoadInfoArgs)))))) { |
348 | 0 | FatalError("Error deserializing 'OptionalLoadInfoArgs'"); |
349 | 0 | return MsgValueError; |
350 | 0 | } |
351 | 0 | // Sentinel = 'aLoadInfoArgs' |
352 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3659468731)))) { |
353 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'OptionalLoadInfoArgs'"); |
354 | 0 | return MsgValueError; |
355 | 0 | } |
356 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aProvider)))))) { |
357 | 0 | FatalError("Error deserializing 'OptionalTransportProvider'"); |
358 | 0 | return MsgValueError; |
359 | 0 | } |
360 | 0 | // Sentinel = 'aProvider' |
361 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4112742927)))) { |
362 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'OptionalTransportProvider'"); |
363 | 0 | return MsgValueError; |
364 | 0 | } |
365 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aNegotiatedExtensions)))))) { |
366 | 0 | FatalError("Error deserializing 'nsCString'"); |
367 | 0 | return MsgValueError; |
368 | 0 | } |
369 | 0 | // Sentinel = 'aNegotiatedExtensions' |
370 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2751189790)))) { |
371 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'"); |
372 | 0 | return MsgValueError; |
373 | 0 | } |
374 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
375 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
376 | 0 | FatalError("Transition error"); |
377 | 0 | return MsgValueError; |
378 | 0 | } |
379 | 0 | if ((!(RecvAsyncOpen(aURI, aOrigin, aInnerWindowID, aProtocol, aSecure, aPingInterval, aClientSetPingInterval, aPingTimeout, aClientSetPingTimeout, aLoadInfoArgs, aProvider, aNegotiatedExtensions)))) { |
380 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
381 | 0 | // Error handled in mozilla::ipc::IPCResult |
382 | 0 | return MsgProcessingError; |
383 | 0 | } |
384 | 0 | |
385 | 0 | return MsgProcessed; |
386 | 0 | } |
387 | 0 | case PWebSocket::Msg_Close__ID: |
388 | 0 | { |
389 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebSocketParent")) { |
390 | 0 | mozilla::ipc::LogMessageForProtocol("PWebSocketParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
391 | 0 | } |
392 | 0 | AUTO_PROFILER_LABEL("PWebSocket::Msg_Close", OTHER); |
393 | 0 |
|
394 | 0 | PickleIterator iter__(msg__); |
395 | 0 | uint16_t code; |
396 | 0 | nsCString reason; |
397 | 0 |
|
398 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(code)))))) { |
399 | 0 | FatalError("Error deserializing 'uint16_t'"); |
400 | 0 | return MsgValueError; |
401 | 0 | } |
402 | 0 | // Sentinel = 'code' |
403 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3318913027)))) { |
404 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint16_t'"); |
405 | 0 | return MsgValueError; |
406 | 0 | } |
407 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(reason)))))) { |
408 | 0 | FatalError("Error deserializing 'nsCString'"); |
409 | 0 | return MsgValueError; |
410 | 0 | } |
411 | 0 | // Sentinel = 'reason' |
412 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4151390930)))) { |
413 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'"); |
414 | 0 | return MsgValueError; |
415 | 0 | } |
416 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
417 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
418 | 0 | FatalError("Transition error"); |
419 | 0 | return MsgValueError; |
420 | 0 | } |
421 | 0 | if ((!(RecvClose(code, reason)))) { |
422 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
423 | 0 | // Error handled in mozilla::ipc::IPCResult |
424 | 0 | return MsgProcessingError; |
425 | 0 | } |
426 | 0 | |
427 | 0 | return MsgProcessed; |
428 | 0 | } |
429 | 0 | case PWebSocket::Msg_SendMsg__ID: |
430 | 0 | { |
431 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebSocketParent")) { |
432 | 0 | mozilla::ipc::LogMessageForProtocol("PWebSocketParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
433 | 0 | } |
434 | 0 | AUTO_PROFILER_LABEL("PWebSocket::Msg_SendMsg", OTHER); |
435 | 0 |
|
436 | 0 | PickleIterator iter__(msg__); |
437 | 0 | nsCString aMsg; |
438 | 0 |
|
439 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aMsg)))))) { |
440 | 0 | FatalError("Error deserializing 'nsCString'"); |
441 | 0 | return MsgValueError; |
442 | 0 | } |
443 | 0 | // Sentinel = 'aMsg' |
444 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3584578888)))) { |
445 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'"); |
446 | 0 | return MsgValueError; |
447 | 0 | } |
448 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
449 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
450 | 0 | FatalError("Transition error"); |
451 | 0 | return MsgValueError; |
452 | 0 | } |
453 | 0 | if ((!(RecvSendMsg(aMsg)))) { |
454 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
455 | 0 | // Error handled in mozilla::ipc::IPCResult |
456 | 0 | return MsgProcessingError; |
457 | 0 | } |
458 | 0 | |
459 | 0 | return MsgProcessed; |
460 | 0 | } |
461 | 0 | case PWebSocket::Msg_SendBinaryMsg__ID: |
462 | 0 | { |
463 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebSocketParent")) { |
464 | 0 | mozilla::ipc::LogMessageForProtocol("PWebSocketParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
465 | 0 | } |
466 | 0 | AUTO_PROFILER_LABEL("PWebSocket::Msg_SendBinaryMsg", OTHER); |
467 | 0 |
|
468 | 0 | PickleIterator iter__(msg__); |
469 | 0 | nsCString aMsg; |
470 | 0 |
|
471 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aMsg)))))) { |
472 | 0 | FatalError("Error deserializing 'nsCString'"); |
473 | 0 | return MsgValueError; |
474 | 0 | } |
475 | 0 | // Sentinel = 'aMsg' |
476 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3584578888)))) { |
477 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'"); |
478 | 0 | return MsgValueError; |
479 | 0 | } |
480 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
481 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
482 | 0 | FatalError("Transition error"); |
483 | 0 | return MsgValueError; |
484 | 0 | } |
485 | 0 | if ((!(RecvSendBinaryMsg(aMsg)))) { |
486 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
487 | 0 | // Error handled in mozilla::ipc::IPCResult |
488 | 0 | return MsgProcessingError; |
489 | 0 | } |
490 | 0 | |
491 | 0 | return MsgProcessed; |
492 | 0 | } |
493 | 0 | case PWebSocket::Msg_SendBinaryStream__ID: |
494 | 0 | { |
495 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebSocketParent")) { |
496 | 0 | mozilla::ipc::LogMessageForProtocol("PWebSocketParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
497 | 0 | } |
498 | 0 | AUTO_PROFILER_LABEL("PWebSocket::Msg_SendBinaryStream", OTHER); |
499 | 0 |
|
500 | 0 | PickleIterator iter__(msg__); |
501 | 0 | IPCStream aStream; |
502 | 0 | uint32_t aLength; |
503 | 0 |
|
504 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aStream)))))) { |
505 | 0 | FatalError("Error deserializing 'IPCStream'"); |
506 | 0 | return MsgValueError; |
507 | 0 | } |
508 | 0 | // Sentinel = 'aStream' |
509 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3415320318)))) { |
510 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'IPCStream'"); |
511 | 0 | return MsgValueError; |
512 | 0 | } |
513 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aLength)))))) { |
514 | 0 | FatalError("Error deserializing 'uint32_t'"); |
515 | 0 | return MsgValueError; |
516 | 0 | } |
517 | 0 | // Sentinel = 'aLength' |
518 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2696905790)))) { |
519 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
520 | 0 | return MsgValueError; |
521 | 0 | } |
522 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
523 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
524 | 0 | FatalError("Transition error"); |
525 | 0 | return MsgValueError; |
526 | 0 | } |
527 | 0 | if ((!(RecvSendBinaryStream(aStream, aLength)))) { |
528 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
529 | 0 | // Error handled in mozilla::ipc::IPCResult |
530 | 0 | return MsgProcessingError; |
531 | 0 | } |
532 | 0 | |
533 | 0 | return MsgProcessed; |
534 | 0 | } |
535 | 0 | case PWebSocket::Msg_DeleteSelf__ID: |
536 | 0 | { |
537 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebSocketParent")) { |
538 | 0 | mozilla::ipc::LogMessageForProtocol("PWebSocketParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
539 | 0 | } |
540 | 0 | AUTO_PROFILER_LABEL("PWebSocket::Msg_DeleteSelf", OTHER); |
541 | 0 |
|
542 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
543 | 0 | FatalError("Transition error"); |
544 | 0 | return MsgValueError; |
545 | 0 | } |
546 | 0 | if ((!(RecvDeleteSelf()))) { |
547 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
548 | 0 | // Error handled in mozilla::ipc::IPCResult |
549 | 0 | return MsgProcessingError; |
550 | 0 | } |
551 | 0 | |
552 | 0 | return MsgProcessed; |
553 | 0 | } |
554 | 0 | case PWebSocket::Reply___delete____ID: |
555 | 0 | { |
556 | 0 | return MsgProcessed; |
557 | 0 | } |
558 | 0 | default: |
559 | 0 | { |
560 | 0 | return MsgNotKnown; |
561 | 0 | } |
562 | 0 | } |
563 | 0 | } |
564 | | |
565 | | auto PWebSocketParent::OnMessageReceived( |
566 | | const Message& msg__, |
567 | | Message*& reply__) -> PWebSocketParent::Result |
568 | 0 | { |
569 | 0 | return MsgNotKnown; |
570 | 0 | } |
571 | | |
572 | | auto PWebSocketParent::OnCallReceived( |
573 | | const Message& msg__, |
574 | | Message*& reply__) -> PWebSocketParent::Result |
575 | 0 | { |
576 | 0 | MOZ_ASSERT_UNREACHABLE("message protocol not supported"); |
577 | 0 | return MsgNotKnown; |
578 | 0 | } |
579 | | |
580 | | auto PWebSocketParent::GetProtocolTypeId() -> int32_t |
581 | 0 | { |
582 | 0 | return PWebSocketMsgStart; |
583 | 0 | } |
584 | | |
585 | | auto PWebSocketParent::DestroySubtree(ActorDestroyReason why) -> void |
586 | 0 | { |
587 | 0 | // Unregister from our manager. |
588 | 0 | Unregister(Id()); |
589 | 0 |
|
590 | 0 | // Reject owning pending responses. |
591 | 0 | (GetIPCChannel())->RejectPendingResponsesForActor(this); |
592 | 0 |
|
593 | 0 | // Finally, destroy "us". |
594 | 0 | ActorDestroy(why); |
595 | 0 | } |
596 | | |
597 | | auto PWebSocketParent::DeallocSubtree() -> void |
598 | 0 | { |
599 | 0 | } |
600 | | |
601 | | |
602 | | |
603 | | } // namespace net |
604 | | } // namespace mozilla |
605 | | namespace mozilla { |
606 | | namespace ipc { |
607 | | auto IPDLParamTraits<mozilla::net::PWebSocketParent>::Write( |
608 | | IPC::Message* aMsg, |
609 | | mozilla::ipc::IProtocol* aActor, |
610 | | const paramType& aVar) -> void |
611 | 0 | { |
612 | 0 | int32_t id; |
613 | 0 | if ((!(aVar))) { |
614 | 0 | id = 0; |
615 | 0 | } |
616 | 0 | else { |
617 | 0 | id = (aVar)->Id(); |
618 | 0 | if ((1) == (id)) { |
619 | 0 | (aActor)->FatalError("actor has been |delete|d"); |
620 | 0 | } |
621 | 0 | } |
622 | 0 | WriteIPDLParam(aMsg, aActor, id); |
623 | 0 | } |
624 | | |
625 | | auto IPDLParamTraits<mozilla::net::PWebSocketParent>::Read( |
626 | | const IPC::Message* aMsg, |
627 | | PickleIterator* aIter, |
628 | | mozilla::ipc::IProtocol* aActor, |
629 | | paramType* aVar) -> bool |
630 | 0 | { |
631 | 0 | mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PWebSocket", PWebSocketMsgStart); |
632 | 0 | if ((actor).isNothing()) { |
633 | 0 | return false; |
634 | 0 | } |
635 | 0 | |
636 | 0 | (*(aVar)) = static_cast<mozilla::net::PWebSocketParent*>((actor).value()); |
637 | 0 | return true; |
638 | 0 | } |
639 | | |
640 | | } // namespace ipc |
641 | | } // namespace mozilla |