/work/obj-fuzz/ipc/ipdl/PContentBridgeChild.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/dom/PContentBridgeChild.h" |
8 | | #include "mozilla/dom/MessagePort.h" |
9 | | #include "mozilla/dom/PermissionMessageUtils.h" |
10 | | #include "mozilla/dom/ipc/StructuredCloneData.h" |
11 | | |
12 | | #include "mozilla/dom/PBrowserChild.h" |
13 | | #include "mozilla/dom/PContentChild.h" |
14 | | #include "mozilla/jsipc/PJavaScriptChild.h" |
15 | | #include "mozilla/ipc/PFileDescriptorSetChild.h" |
16 | | #include "mozilla/ipc/PChildToParentStreamChild.h" |
17 | | #include "mozilla/ipc/PParentToChildStreamChild.h" |
18 | | #include "mozilla/ipc/PIPCBlobInputStreamChild.h" |
19 | | |
20 | | #include "nsIFile.h" |
21 | | #include "GeckoProfiler.h" |
22 | | |
23 | | namespace mozilla { |
24 | | namespace dom { |
25 | | |
26 | | |
27 | | auto PContentBridgeChild::RecvPParentToChildStreamConstructor(PParentToChildStreamChild* actor) -> mozilla::ipc::IPCResult |
28 | 0 | { |
29 | 0 | return IPC_OK(); |
30 | 0 | } |
31 | | |
32 | | auto PContentBridgeChild::RecvPIPCBlobInputStreamConstructor( |
33 | | PIPCBlobInputStreamChild* actor, |
34 | | const nsID& aID, |
35 | | const uint64_t& aSize) -> mozilla::ipc::IPCResult |
36 | 0 | { |
37 | 0 | return IPC_OK(); |
38 | 0 | } |
39 | | |
40 | | auto PContentBridgeChild::RecvPBrowserConstructor( |
41 | | PBrowserChild* actor, |
42 | | const TabId& tabId, |
43 | | const TabId& sameTabGroupAs, |
44 | | const IPCTabContext& context, |
45 | | const uint32_t& chromeFlags, |
46 | | const ContentParentId& cpId, |
47 | | const bool& isForBrowser) -> mozilla::ipc::IPCResult |
48 | 0 | { |
49 | 0 | return IPC_OK(); |
50 | 0 | } |
51 | | |
52 | | auto PContentBridgeChild::RecvPFileDescriptorSetConstructor( |
53 | | PFileDescriptorSetChild* actor, |
54 | | const FileDescriptor& fd) -> mozilla::ipc::IPCResult |
55 | 0 | { |
56 | 0 | return IPC_OK(); |
57 | 0 | } |
58 | | |
59 | | auto PContentBridgeChild::ActorDestroy(ActorDestroyReason aWhy) -> void |
60 | 0 | { |
61 | 0 | } |
62 | | |
63 | | auto PContentBridgeChild::ProcessingError( |
64 | | Result aCode, |
65 | | const char* aReason) -> void |
66 | 0 | { |
67 | 0 | } |
68 | | |
69 | | auto PContentBridgeChild::ShouldContinueFromReplyTimeout() -> bool |
70 | 0 | { |
71 | 0 | return true; |
72 | 0 | } |
73 | | |
74 | | auto PContentBridgeChild::EnteredCxxStack() -> void |
75 | 0 | { |
76 | 0 | } |
77 | | |
78 | | auto PContentBridgeChild::ExitedCxxStack() -> void |
79 | 0 | { |
80 | 0 | } |
81 | | |
82 | | auto PContentBridgeChild::EnteredCall() -> void |
83 | 0 | { |
84 | 0 | } |
85 | | |
86 | | auto PContentBridgeChild::ExitedCall() -> void |
87 | 0 | { |
88 | 0 | } |
89 | | |
90 | | MOZ_IMPLICIT PContentBridgeChild::PContentBridgeChild() : |
91 | | mozilla::ipc::IToplevelProtocol("PContentBridgeChild", PContentBridgeMsgStart, mozilla::ipc::ChildSide), |
92 | | mLivenessState(mozilla::ipc::LivenessState::Start) |
93 | 0 | { |
94 | 0 | MOZ_COUNT_CTOR(PContentBridgeChild); |
95 | 0 | } |
96 | | |
97 | | PContentBridgeChild::~PContentBridgeChild() |
98 | 0 | { |
99 | 0 | MOZ_COUNT_DTOR(PContentBridgeChild); |
100 | 0 | } |
101 | | |
102 | | auto PContentBridgeChild::ManagedPBrowserChild(nsTArray<PBrowserChild*>& aArr) const -> void |
103 | 0 | { |
104 | 0 | (mManagedPBrowserChild).ToArray(aArr); |
105 | 0 | } |
106 | | |
107 | | auto PContentBridgeChild::ManagedPBrowserChild() const -> const ManagedContainer<PBrowserChild>& |
108 | 0 | { |
109 | 0 | return mManagedPBrowserChild; |
110 | 0 | } |
111 | | |
112 | | auto PContentBridgeChild::ManagedPFileDescriptorSetChild(nsTArray<PFileDescriptorSetChild*>& aArr) const -> void |
113 | 0 | { |
114 | 0 | (mManagedPFileDescriptorSetChild).ToArray(aArr); |
115 | 0 | } |
116 | | |
117 | | auto PContentBridgeChild::ManagedPFileDescriptorSetChild() const -> const ManagedContainer<PFileDescriptorSetChild>& |
118 | 0 | { |
119 | 0 | return mManagedPFileDescriptorSetChild; |
120 | 0 | } |
121 | | |
122 | | auto PContentBridgeChild::ManagedPJavaScriptChild(nsTArray<PJavaScriptChild*>& aArr) const -> void |
123 | 0 | { |
124 | 0 | (mManagedPJavaScriptChild).ToArray(aArr); |
125 | 0 | } |
126 | | |
127 | | auto PContentBridgeChild::ManagedPJavaScriptChild() const -> const ManagedContainer<PJavaScriptChild>& |
128 | 0 | { |
129 | 0 | return mManagedPJavaScriptChild; |
130 | 0 | } |
131 | | |
132 | | auto PContentBridgeChild::ManagedPChildToParentStreamChild(nsTArray<PChildToParentStreamChild*>& aArr) const -> void |
133 | 0 | { |
134 | 0 | (mManagedPChildToParentStreamChild).ToArray(aArr); |
135 | 0 | } |
136 | | |
137 | | auto PContentBridgeChild::ManagedPChildToParentStreamChild() const -> const ManagedContainer<PChildToParentStreamChild>& |
138 | 0 | { |
139 | 0 | return mManagedPChildToParentStreamChild; |
140 | 0 | } |
141 | | |
142 | | auto PContentBridgeChild::ManagedPParentToChildStreamChild(nsTArray<PParentToChildStreamChild*>& aArr) const -> void |
143 | 0 | { |
144 | 0 | (mManagedPParentToChildStreamChild).ToArray(aArr); |
145 | 0 | } |
146 | | |
147 | | auto PContentBridgeChild::ManagedPParentToChildStreamChild() const -> const ManagedContainer<PParentToChildStreamChild>& |
148 | 0 | { |
149 | 0 | return mManagedPParentToChildStreamChild; |
150 | 0 | } |
151 | | |
152 | | auto PContentBridgeChild::ManagedPIPCBlobInputStreamChild(nsTArray<PIPCBlobInputStreamChild*>& aArr) const -> void |
153 | 0 | { |
154 | 0 | (mManagedPIPCBlobInputStreamChild).ToArray(aArr); |
155 | 0 | } |
156 | | |
157 | | auto PContentBridgeChild::ManagedPIPCBlobInputStreamChild() const -> const ManagedContainer<PIPCBlobInputStreamChild>& |
158 | 0 | { |
159 | 0 | return mManagedPIPCBlobInputStreamChild; |
160 | 0 | } |
161 | | |
162 | | auto PContentBridgeChild::SendSyncMessage( |
163 | | const nsString& aMessage, |
164 | | const ClonedMessageData& aData, |
165 | | const nsTArray<CpowEntry>& aCpows, |
166 | | const Principal& aPrincipal, |
167 | | nsTArray<StructuredCloneData>* retval) -> bool |
168 | 0 | { |
169 | 0 | IPC::Message* msg__ = PContentBridge::Msg_SyncMessage(MSG_ROUTING_CONTROL); |
170 | 0 |
|
171 | 0 | WriteIPDLParam(msg__, this, aMessage); |
172 | 0 | // Sentinel = 'aMessage' |
173 | 0 | (msg__)->WriteSentinel(3453110902); |
174 | 0 | WriteIPDLParam(msg__, this, aData); |
175 | 0 | // Sentinel = 'aData' |
176 | 0 | (msg__)->WriteSentinel(3285075324); |
177 | 0 | WriteIPDLParam(msg__, this, aCpows); |
178 | 0 | // Sentinel = 'aCpows' |
179 | 0 | (msg__)->WriteSentinel(2178221451); |
180 | 0 | WriteIPDLParam(msg__, this, aPrincipal); |
181 | 0 | // Sentinel = 'aPrincipal' |
182 | 0 | (msg__)->WriteSentinel(4097511); |
183 | 0 |
|
184 | 0 |
|
185 | 0 |
|
186 | 0 | Message reply__; |
187 | 0 |
|
188 | 0 | if (mozilla::ipc::LoggingEnabledFor("PContentBridgeChild")) { |
189 | 0 | mozilla::ipc::LogMessageForProtocol("PContentBridgeChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
190 | 0 | } |
191 | 0 | AUTO_PROFILER_LABEL("PContentBridge::Msg_SyncMessage", OTHER); |
192 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
193 | 0 | mozilla::ipc::LogicError("Transition error"); |
194 | 0 | } |
195 | 0 |
|
196 | 0 | bool sendok__; |
197 | 0 | { |
198 | 0 | AUTO_PROFILER_TRACING("IPC", "PContentBridge::Msg_SyncMessage"); |
199 | 0 | sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__))); |
200 | 0 | } |
201 | 0 | if ((!(sendok__))) { |
202 | 0 | return false; |
203 | 0 | } |
204 | 0 | |
205 | 0 | if (mozilla::ipc::LoggingEnabledFor("PContentBridgeChild")) { |
206 | 0 | mozilla::ipc::LogMessageForProtocol("PContentBridgeChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
207 | 0 | } |
208 | 0 |
|
209 | 0 | PickleIterator iter__(reply__); |
210 | 0 |
|
211 | 0 | if ((!(ReadIPDLParam((&(reply__)), (&(iter__)), this, retval)))) { |
212 | 0 | FatalError("Error deserializing 'nsTArray'"); |
213 | 0 | return false; |
214 | 0 | } |
215 | 0 | // Sentinel = 'retval' |
216 | 0 | if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 3130628604)))) { |
217 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'"); |
218 | 0 | return false; |
219 | 0 | } |
220 | 0 | (reply__).EndRead(iter__, (reply__).type()); |
221 | 0 |
|
222 | 0 | return true; |
223 | 0 | } |
224 | | |
225 | | auto PContentBridgeChild::SendPJavaScriptConstructor() -> PJavaScriptChild* |
226 | 0 | { |
227 | 0 | return SendPJavaScriptConstructor(AllocPJavaScriptChild()); |
228 | 0 | } |
229 | | |
230 | | auto PContentBridgeChild::SendPJavaScriptConstructor(PJavaScriptChild* actor) -> PJavaScriptChild* |
231 | 0 | { |
232 | 0 | if ((!(actor))) { |
233 | 0 | NS_WARNING("Error constructing actor PJavaScriptChild"); |
234 | 0 | return nullptr; |
235 | 0 | } |
236 | 0 | (actor)->SetManagerAndRegister(this); |
237 | 0 | (mManagedPJavaScriptChild).PutEntry(actor); |
238 | 0 | (actor)->mLivenessState = mozilla::ipc::LivenessState::Start; |
239 | 0 |
|
240 | 0 | IPC::Message* msg__ = PContentBridge::Msg_PJavaScriptConstructor(MSG_ROUTING_CONTROL); |
241 | 0 |
|
242 | 0 | MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param"); |
243 | 0 | WriteIPDLParam(msg__, this, actor); |
244 | 0 | // Sentinel = 'actor' |
245 | 0 | (msg__)->WriteSentinel(875202478); |
246 | 0 |
|
247 | 0 |
|
248 | 0 |
|
249 | 0 | if (mozilla::ipc::LoggingEnabledFor("PContentBridgeChild")) { |
250 | 0 | mozilla::ipc::LogMessageForProtocol("PContentBridgeChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
251 | 0 | } |
252 | 0 | AUTO_PROFILER_LABEL("PContentBridge::Msg_PJavaScriptConstructor", 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 | if ((!(sendok__))) { |
259 | 0 | FatalError("constructor for actor failed"); |
260 | 0 | return nullptr; |
261 | 0 | } |
262 | 0 | return actor; |
263 | 0 | } |
264 | | |
265 | | auto PContentBridgeChild::SendPChildToParentStreamConstructor() -> PChildToParentStreamChild* |
266 | 0 | { |
267 | 0 | return SendPChildToParentStreamConstructor(AllocPChildToParentStreamChild()); |
268 | 0 | } |
269 | | |
270 | | auto PContentBridgeChild::SendPChildToParentStreamConstructor(PChildToParentStreamChild* actor) -> PChildToParentStreamChild* |
271 | 0 | { |
272 | 0 | if ((!(actor))) { |
273 | 0 | NS_WARNING("Error constructing actor PChildToParentStreamChild"); |
274 | 0 | return nullptr; |
275 | 0 | } |
276 | 0 | (actor)->SetManagerAndRegister(this); |
277 | 0 | (mManagedPChildToParentStreamChild).PutEntry(actor); |
278 | 0 | (actor)->mLivenessState = mozilla::ipc::LivenessState::Start; |
279 | 0 |
|
280 | 0 | IPC::Message* msg__ = PContentBridge::Msg_PChildToParentStreamConstructor(MSG_ROUTING_CONTROL); |
281 | 0 |
|
282 | 0 | MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param"); |
283 | 0 | WriteIPDLParam(msg__, this, actor); |
284 | 0 | // Sentinel = 'actor' |
285 | 0 | (msg__)->WriteSentinel(875202478); |
286 | 0 |
|
287 | 0 |
|
288 | 0 |
|
289 | 0 | if (mozilla::ipc::LoggingEnabledFor("PContentBridgeChild")) { |
290 | 0 | mozilla::ipc::LogMessageForProtocol("PContentBridgeChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
291 | 0 | } |
292 | 0 | AUTO_PROFILER_LABEL("PContentBridge::Msg_PChildToParentStreamConstructor", OTHER); |
293 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
294 | 0 | mozilla::ipc::LogicError("Transition error"); |
295 | 0 | } |
296 | 0 |
|
297 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
298 | 0 | if ((!(sendok__))) { |
299 | 0 | FatalError("constructor for actor failed"); |
300 | 0 | return nullptr; |
301 | 0 | } |
302 | 0 | return actor; |
303 | 0 | } |
304 | | |
305 | | auto PContentBridgeChild::SendPBrowserConstructor( |
306 | | const TabId& tabId, |
307 | | const TabId& sameTabGroupAs, |
308 | | const IPCTabContext& context, |
309 | | const uint32_t& chromeFlags, |
310 | | const ContentParentId& cpId, |
311 | | const bool& isForBrowser) -> PBrowserChild* |
312 | 0 | { |
313 | 0 | return SendPBrowserConstructor(AllocPBrowserChild(tabId, sameTabGroupAs, context, chromeFlags, cpId, isForBrowser), tabId, sameTabGroupAs, context, chromeFlags, cpId, isForBrowser); |
314 | 0 | } |
315 | | |
316 | | auto PContentBridgeChild::SendPBrowserConstructor( |
317 | | PBrowserChild* actor, |
318 | | const TabId& tabId, |
319 | | const TabId& sameTabGroupAs, |
320 | | const IPCTabContext& context, |
321 | | const uint32_t& chromeFlags, |
322 | | const ContentParentId& cpId, |
323 | | const bool& isForBrowser) -> PBrowserChild* |
324 | 0 | { |
325 | 0 | if ((!(actor))) { |
326 | 0 | NS_WARNING("Error constructing actor PBrowserChild"); |
327 | 0 | return nullptr; |
328 | 0 | } |
329 | 0 | (actor)->SetManagerAndRegister(this); |
330 | 0 | (mManagedPBrowserChild).PutEntry(actor); |
331 | 0 | (actor)->mLivenessState = mozilla::ipc::LivenessState::Start; |
332 | 0 |
|
333 | 0 | IPC::Message* msg__ = PContentBridge::Msg_PBrowserConstructor(MSG_ROUTING_CONTROL); |
334 | 0 |
|
335 | 0 | MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param"); |
336 | 0 | WriteIPDLParam(msg__, this, actor); |
337 | 0 | // Sentinel = 'actor' |
338 | 0 | (msg__)->WriteSentinel(875202478); |
339 | 0 | WriteIPDLParam(msg__, this, tabId); |
340 | 0 | // Sentinel = 'tabId' |
341 | 0 | (msg__)->WriteSentinel(3419081923); |
342 | 0 | WriteIPDLParam(msg__, this, sameTabGroupAs); |
343 | 0 | // Sentinel = 'sameTabGroupAs' |
344 | 0 | (msg__)->WriteSentinel(3969365410); |
345 | 0 | WriteIPDLParam(msg__, this, context); |
346 | 0 | // Sentinel = 'context' |
347 | 0 | (msg__)->WriteSentinel(3514529014); |
348 | 0 | WriteIPDLParam(msg__, this, chromeFlags); |
349 | 0 | // Sentinel = 'chromeFlags' |
350 | 0 | (msg__)->WriteSentinel(299515804); |
351 | 0 | WriteIPDLParam(msg__, this, cpId); |
352 | 0 | // Sentinel = 'cpId' |
353 | 0 | (msg__)->WriteSentinel(2452595622); |
354 | 0 | WriteIPDLParam(msg__, this, isForBrowser); |
355 | 0 | // Sentinel = 'isForBrowser' |
356 | 0 | (msg__)->WriteSentinel(2051565587); |
357 | 0 |
|
358 | 0 |
|
359 | 0 |
|
360 | 0 | if (mozilla::ipc::LoggingEnabledFor("PContentBridgeChild")) { |
361 | 0 | mozilla::ipc::LogMessageForProtocol("PContentBridgeChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
362 | 0 | } |
363 | 0 | AUTO_PROFILER_LABEL("PContentBridge::Msg_PBrowserConstructor", OTHER); |
364 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
365 | 0 | mozilla::ipc::LogicError("Transition error"); |
366 | 0 | } |
367 | 0 |
|
368 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
369 | 0 | if ((!(sendok__))) { |
370 | 0 | FatalError("constructor for actor failed"); |
371 | 0 | return nullptr; |
372 | 0 | } |
373 | 0 | return actor; |
374 | 0 | } |
375 | | |
376 | | auto PContentBridgeChild::SendPFileDescriptorSetConstructor(const FileDescriptor& fd) -> PFileDescriptorSetChild* |
377 | 0 | { |
378 | 0 | return SendPFileDescriptorSetConstructor(AllocPFileDescriptorSetChild(fd), fd); |
379 | 0 | } |
380 | | |
381 | | auto PContentBridgeChild::SendPFileDescriptorSetConstructor( |
382 | | PFileDescriptorSetChild* actor, |
383 | | const FileDescriptor& fd) -> PFileDescriptorSetChild* |
384 | 0 | { |
385 | 0 | if ((!(actor))) { |
386 | 0 | NS_WARNING("Error constructing actor PFileDescriptorSetChild"); |
387 | 0 | return nullptr; |
388 | 0 | } |
389 | 0 | (actor)->SetManagerAndRegister(this); |
390 | 0 | (mManagedPFileDescriptorSetChild).PutEntry(actor); |
391 | 0 | (actor)->mLivenessState = mozilla::ipc::LivenessState::Start; |
392 | 0 |
|
393 | 0 | IPC::Message* msg__ = PContentBridge::Msg_PFileDescriptorSetConstructor(MSG_ROUTING_CONTROL); |
394 | 0 |
|
395 | 0 | MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param"); |
396 | 0 | WriteIPDLParam(msg__, this, actor); |
397 | 0 | // Sentinel = 'actor' |
398 | 0 | (msg__)->WriteSentinel(875202478); |
399 | 0 | WriteIPDLParam(msg__, this, fd); |
400 | 0 | // Sentinel = 'fd' |
401 | 0 | (msg__)->WriteSentinel(628535764); |
402 | 0 |
|
403 | 0 |
|
404 | 0 |
|
405 | 0 | if (mozilla::ipc::LoggingEnabledFor("PContentBridgeChild")) { |
406 | 0 | mozilla::ipc::LogMessageForProtocol("PContentBridgeChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
407 | 0 | } |
408 | 0 | AUTO_PROFILER_LABEL("PContentBridge::Msg_PFileDescriptorSetConstructor", OTHER); |
409 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
410 | 0 | mozilla::ipc::LogicError("Transition error"); |
411 | 0 | } |
412 | 0 |
|
413 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
414 | 0 | if ((!(sendok__))) { |
415 | 0 | FatalError("constructor for actor failed"); |
416 | 0 | return nullptr; |
417 | 0 | } |
418 | 0 | return actor; |
419 | 0 | } |
420 | | |
421 | | auto PContentBridgeChild::SendAsyncMessage( |
422 | | const nsString& aMessage, |
423 | | const nsTArray<CpowEntry>& aCpows, |
424 | | const Principal& aPrincipal, |
425 | | const ClonedMessageData& aData) -> bool |
426 | 0 | { |
427 | 0 | IPC::Message* msg__ = PContentBridge::Msg_AsyncMessage(MSG_ROUTING_CONTROL); |
428 | 0 |
|
429 | 0 | WriteIPDLParam(msg__, this, aMessage); |
430 | 0 | // Sentinel = 'aMessage' |
431 | 0 | (msg__)->WriteSentinel(3453110902); |
432 | 0 | WriteIPDLParam(msg__, this, aCpows); |
433 | 0 | // Sentinel = 'aCpows' |
434 | 0 | (msg__)->WriteSentinel(2178221451); |
435 | 0 | WriteIPDLParam(msg__, this, aPrincipal); |
436 | 0 | // Sentinel = 'aPrincipal' |
437 | 0 | (msg__)->WriteSentinel(4097511); |
438 | 0 | WriteIPDLParam(msg__, this, aData); |
439 | 0 | // Sentinel = 'aData' |
440 | 0 | (msg__)->WriteSentinel(3285075324); |
441 | 0 |
|
442 | 0 |
|
443 | 0 |
|
444 | 0 |
|
445 | 0 | if (mozilla::ipc::LoggingEnabledFor("PContentBridgeChild")) { |
446 | 0 | mozilla::ipc::LogMessageForProtocol("PContentBridgeChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
447 | 0 | } |
448 | 0 | AUTO_PROFILER_LABEL("PContentBridge::Msg_AsyncMessage", OTHER); |
449 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
450 | 0 | mozilla::ipc::LogicError("Transition error"); |
451 | 0 | } |
452 | 0 |
|
453 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
454 | 0 | return sendok__; |
455 | 0 | } |
456 | | |
457 | | auto PContentBridgeChild::RemoveManagee( |
458 | | int32_t aProtocolId, |
459 | | IProtocol* aListener) -> void |
460 | 0 | { |
461 | 0 | switch (aProtocolId) { |
462 | 0 | case PBrowserMsgStart: |
463 | 0 | { |
464 | 0 | PBrowserChild* actor = static_cast<PBrowserChild*>(aListener); |
465 | 0 | auto& container = mManagedPBrowserChild; |
466 | 0 | MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!"); |
467 | 0 |
|
468 | 0 | (container).RemoveEntry(actor); |
469 | 0 | DeallocPBrowserChild(actor); |
470 | 0 | return; |
471 | 0 | } |
472 | 0 | case PFileDescriptorSetMsgStart: |
473 | 0 | { |
474 | 0 | PFileDescriptorSetChild* actor = static_cast<PFileDescriptorSetChild*>(aListener); |
475 | 0 | auto& container = mManagedPFileDescriptorSetChild; |
476 | 0 | MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!"); |
477 | 0 |
|
478 | 0 | (container).RemoveEntry(actor); |
479 | 0 | DeallocPFileDescriptorSetChild(actor); |
480 | 0 | return; |
481 | 0 | } |
482 | 0 | case PJavaScriptMsgStart: |
483 | 0 | { |
484 | 0 | PJavaScriptChild* actor = static_cast<PJavaScriptChild*>(aListener); |
485 | 0 | auto& container = mManagedPJavaScriptChild; |
486 | 0 | MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!"); |
487 | 0 |
|
488 | 0 | (container).RemoveEntry(actor); |
489 | 0 | DeallocPJavaScriptChild(actor); |
490 | 0 | return; |
491 | 0 | } |
492 | 0 | case PChildToParentStreamMsgStart: |
493 | 0 | { |
494 | 0 | PChildToParentStreamChild* actor = static_cast<PChildToParentStreamChild*>(aListener); |
495 | 0 | auto& container = mManagedPChildToParentStreamChild; |
496 | 0 | MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!"); |
497 | 0 |
|
498 | 0 | (container).RemoveEntry(actor); |
499 | 0 | DeallocPChildToParentStreamChild(actor); |
500 | 0 | return; |
501 | 0 | } |
502 | 0 | case PParentToChildStreamMsgStart: |
503 | 0 | { |
504 | 0 | PParentToChildStreamChild* actor = static_cast<PParentToChildStreamChild*>(aListener); |
505 | 0 | auto& container = mManagedPParentToChildStreamChild; |
506 | 0 | MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!"); |
507 | 0 |
|
508 | 0 | (container).RemoveEntry(actor); |
509 | 0 | DeallocPParentToChildStreamChild(actor); |
510 | 0 | return; |
511 | 0 | } |
512 | 0 | case PIPCBlobInputStreamMsgStart: |
513 | 0 | { |
514 | 0 | PIPCBlobInputStreamChild* actor = static_cast<PIPCBlobInputStreamChild*>(aListener); |
515 | 0 | auto& container = mManagedPIPCBlobInputStreamChild; |
516 | 0 | MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!"); |
517 | 0 |
|
518 | 0 | (container).RemoveEntry(actor); |
519 | 0 | DeallocPIPCBlobInputStreamChild(actor); |
520 | 0 | return; |
521 | 0 | } |
522 | 0 | default: |
523 | 0 | { |
524 | 0 | FatalError("unreached"); |
525 | 0 | return; |
526 | 0 | } |
527 | 0 | } |
528 | 0 | } |
529 | | |
530 | | auto PContentBridgeChild::OnMessageReceived(const Message& msg__) -> PContentBridgeChild::Result |
531 | 0 | { |
532 | 0 | int32_t route__ = (msg__).routing_id(); |
533 | 0 | if ((MSG_ROUTING_CONTROL) != (route__)) { |
534 | 0 | IProtocol* routed__ = Lookup(route__); |
535 | 0 | if ((!(routed__))) { |
536 | 0 | return MsgRouteError; |
537 | 0 | } |
538 | 0 | return (routed__)->OnMessageReceived(msg__); |
539 | 0 | } |
540 | 0 | |
541 | 0 | switch ((msg__).type()) { |
542 | 0 | case PContentBridge::Msg_PParentToChildStreamConstructor__ID: |
543 | 0 | { |
544 | 0 | if (mozilla::ipc::LoggingEnabledFor("PContentBridgeChild")) { |
545 | 0 | mozilla::ipc::LogMessageForProtocol("PContentBridgeChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
546 | 0 | } |
547 | 0 | AUTO_PROFILER_LABEL("PContentBridge::Msg_PParentToChildStreamConstructor", OTHER); |
548 | 0 |
|
549 | 0 | PickleIterator iter__(msg__); |
550 | 0 | ActorHandle handle__; |
551 | 0 | PParentToChildStreamChild* actor; |
552 | 0 |
|
553 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(handle__)))))) { |
554 | 0 | FatalError("Error deserializing 'ActorHandle'"); |
555 | 0 | return MsgValueError; |
556 | 0 | } |
557 | 0 | // Sentinel = 'actor' |
558 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) { |
559 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'"); |
560 | 0 | return MsgValueError; |
561 | 0 | } |
562 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
563 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
564 | 0 | FatalError("Transition error"); |
565 | 0 | return MsgValueError; |
566 | 0 | } |
567 | 0 | actor = AllocPParentToChildStreamChild(); |
568 | 0 | if ((!(actor))) { |
569 | 0 | NS_WARNING("Error constructing actor PParentToChildStreamChild"); |
570 | 0 | return MsgValueError; |
571 | 0 | } |
572 | 0 | (actor)->SetManagerAndRegister(this, (handle__).mId); |
573 | 0 | (mManagedPParentToChildStreamChild).PutEntry(actor); |
574 | 0 | (actor)->mLivenessState = mozilla::ipc::LivenessState::Start; |
575 | 0 |
|
576 | 0 | if ((!(RecvPParentToChildStreamConstructor(actor)))) { |
577 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
578 | 0 | // Error handled in mozilla::ipc::IPCResult |
579 | 0 | return MsgProcessingError; |
580 | 0 | } |
581 | 0 | |
582 | 0 | return MsgProcessed; |
583 | 0 | } |
584 | 0 | case PContentBridge::Msg_Activate__ID: |
585 | 0 | { |
586 | 0 | if (mozilla::ipc::LoggingEnabledFor("PContentBridgeChild")) { |
587 | 0 | mozilla::ipc::LogMessageForProtocol("PContentBridgeChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
588 | 0 | } |
589 | 0 | AUTO_PROFILER_LABEL("PContentBridge::Msg_Activate", OTHER); |
590 | 0 |
|
591 | 0 | PickleIterator iter__(msg__); |
592 | 0 | PBrowserChild* aTab; |
593 | 0 |
|
594 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aTab)))))) { |
595 | 0 | FatalError("Error deserializing 'PBrowserChild'"); |
596 | 0 | return MsgValueError; |
597 | 0 | } |
598 | 0 | if ((!((*((&(aTab))))))) { |
599 | 0 | FatalError("Error deserializing 'PBrowserChild'"); |
600 | 0 | return MsgValueError; |
601 | 0 | } |
602 | 0 | // Sentinel = 'aTab' |
603 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1179125994)))) { |
604 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'PBrowserChild'"); |
605 | 0 | return MsgValueError; |
606 | 0 | } |
607 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
608 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
609 | 0 | FatalError("Transition error"); |
610 | 0 | return MsgValueError; |
611 | 0 | } |
612 | 0 | if ((!(RecvActivate(aTab)))) { |
613 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
614 | 0 | // Error handled in mozilla::ipc::IPCResult |
615 | 0 | return MsgProcessingError; |
616 | 0 | } |
617 | 0 | |
618 | 0 | return MsgProcessed; |
619 | 0 | } |
620 | 0 | case PContentBridge::Msg_Deactivate__ID: |
621 | 0 | { |
622 | 0 | if (mozilla::ipc::LoggingEnabledFor("PContentBridgeChild")) { |
623 | 0 | mozilla::ipc::LogMessageForProtocol("PContentBridgeChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
624 | 0 | } |
625 | 0 | AUTO_PROFILER_LABEL("PContentBridge::Msg_Deactivate", OTHER); |
626 | 0 |
|
627 | 0 | PickleIterator iter__(msg__); |
628 | 0 | PBrowserChild* aTab; |
629 | 0 |
|
630 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aTab)))))) { |
631 | 0 | FatalError("Error deserializing 'PBrowserChild'"); |
632 | 0 | return MsgValueError; |
633 | 0 | } |
634 | 0 | if ((!((*((&(aTab))))))) { |
635 | 0 | FatalError("Error deserializing 'PBrowserChild'"); |
636 | 0 | return MsgValueError; |
637 | 0 | } |
638 | 0 | // Sentinel = 'aTab' |
639 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1179125994)))) { |
640 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'PBrowserChild'"); |
641 | 0 | return MsgValueError; |
642 | 0 | } |
643 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
644 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
645 | 0 | FatalError("Transition error"); |
646 | 0 | return MsgValueError; |
647 | 0 | } |
648 | 0 | if ((!(RecvDeactivate(aTab)))) { |
649 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
650 | 0 | // Error handled in mozilla::ipc::IPCResult |
651 | 0 | return MsgProcessingError; |
652 | 0 | } |
653 | 0 | |
654 | 0 | return MsgProcessed; |
655 | 0 | } |
656 | 0 | case PContentBridge::Msg_PIPCBlobInputStreamConstructor__ID: |
657 | 0 | { |
658 | 0 | if (mozilla::ipc::LoggingEnabledFor("PContentBridgeChild")) { |
659 | 0 | mozilla::ipc::LogMessageForProtocol("PContentBridgeChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
660 | 0 | } |
661 | 0 | AUTO_PROFILER_LABEL("PContentBridge::Msg_PIPCBlobInputStreamConstructor", OTHER); |
662 | 0 |
|
663 | 0 | PickleIterator iter__(msg__); |
664 | 0 | ActorHandle handle__; |
665 | 0 | PIPCBlobInputStreamChild* actor; |
666 | 0 | nsID aID; |
667 | 0 | uint64_t aSize; |
668 | 0 |
|
669 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(handle__)))))) { |
670 | 0 | FatalError("Error deserializing 'ActorHandle'"); |
671 | 0 | return MsgValueError; |
672 | 0 | } |
673 | 0 | // Sentinel = 'actor' |
674 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) { |
675 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'"); |
676 | 0 | return MsgValueError; |
677 | 0 | } |
678 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aID)))))) { |
679 | 0 | FatalError("Error deserializing 'nsID'"); |
680 | 0 | return MsgValueError; |
681 | 0 | } |
682 | 0 | // Sentinel = 'aID' |
683 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2735041849)))) { |
684 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsID'"); |
685 | 0 | return MsgValueError; |
686 | 0 | } |
687 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aSize)))))) { |
688 | 0 | FatalError("Error deserializing 'uint64_t'"); |
689 | 0 | return MsgValueError; |
690 | 0 | } |
691 | 0 | // Sentinel = 'aSize' |
692 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2556665555)))) { |
693 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'"); |
694 | 0 | return MsgValueError; |
695 | 0 | } |
696 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
697 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
698 | 0 | FatalError("Transition error"); |
699 | 0 | return MsgValueError; |
700 | 0 | } |
701 | 0 | actor = AllocPIPCBlobInputStreamChild(aID, aSize); |
702 | 0 | if ((!(actor))) { |
703 | 0 | NS_WARNING("Error constructing actor PIPCBlobInputStreamChild"); |
704 | 0 | return MsgValueError; |
705 | 0 | } |
706 | 0 | (actor)->SetManagerAndRegister(this, (handle__).mId); |
707 | 0 | (mManagedPIPCBlobInputStreamChild).PutEntry(actor); |
708 | 0 | (actor)->mLivenessState = mozilla::ipc::LivenessState::Start; |
709 | 0 |
|
710 | 0 | if ((!(RecvPIPCBlobInputStreamConstructor(actor, aID, aSize)))) { |
711 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
712 | 0 | // Error handled in mozilla::ipc::IPCResult |
713 | 0 | return MsgProcessingError; |
714 | 0 | } |
715 | 0 | |
716 | 0 | return MsgProcessed; |
717 | 0 | } |
718 | 0 | case PContentBridge::Reply_PJavaScriptConstructor__ID: |
719 | 0 | { |
720 | 0 | return MsgProcessed; |
721 | 0 | } |
722 | 0 | case PContentBridge::Reply_PChildToParentStreamConstructor__ID: |
723 | 0 | { |
724 | 0 | return MsgProcessed; |
725 | 0 | } |
726 | 0 | case PContentBridge::Reply_PBrowserConstructor__ID: |
727 | 0 | { |
728 | 0 | return MsgProcessed; |
729 | 0 | } |
730 | 0 | case PContentBridge::Msg_PBrowserConstructor__ID: |
731 | 0 | { |
732 | 0 | if (mozilla::ipc::LoggingEnabledFor("PContentBridgeChild")) { |
733 | 0 | mozilla::ipc::LogMessageForProtocol("PContentBridgeChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
734 | 0 | } |
735 | 0 | AUTO_PROFILER_LABEL("PContentBridge::Msg_PBrowserConstructor", OTHER); |
736 | 0 |
|
737 | 0 | PickleIterator iter__(msg__); |
738 | 0 | ActorHandle handle__; |
739 | 0 | PBrowserChild* actor; |
740 | 0 | TabId tabId; |
741 | 0 | TabId sameTabGroupAs; |
742 | 0 | IPCTabContext context; |
743 | 0 | uint32_t chromeFlags; |
744 | 0 | ContentParentId cpId; |
745 | 0 | bool isForBrowser; |
746 | 0 |
|
747 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(handle__)))))) { |
748 | 0 | FatalError("Error deserializing 'ActorHandle'"); |
749 | 0 | return MsgValueError; |
750 | 0 | } |
751 | 0 | // Sentinel = 'actor' |
752 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) { |
753 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'"); |
754 | 0 | return MsgValueError; |
755 | 0 | } |
756 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(tabId)))))) { |
757 | 0 | FatalError("Error deserializing 'TabId'"); |
758 | 0 | return MsgValueError; |
759 | 0 | } |
760 | 0 | // Sentinel = 'tabId' |
761 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3419081923)))) { |
762 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'TabId'"); |
763 | 0 | return MsgValueError; |
764 | 0 | } |
765 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(sameTabGroupAs)))))) { |
766 | 0 | FatalError("Error deserializing 'TabId'"); |
767 | 0 | return MsgValueError; |
768 | 0 | } |
769 | 0 | // Sentinel = 'sameTabGroupAs' |
770 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3969365410)))) { |
771 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'TabId'"); |
772 | 0 | return MsgValueError; |
773 | 0 | } |
774 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(context)))))) { |
775 | 0 | FatalError("Error deserializing 'IPCTabContext'"); |
776 | 0 | return MsgValueError; |
777 | 0 | } |
778 | 0 | // Sentinel = 'context' |
779 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3514529014)))) { |
780 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'IPCTabContext'"); |
781 | 0 | return MsgValueError; |
782 | 0 | } |
783 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(chromeFlags)))))) { |
784 | 0 | FatalError("Error deserializing 'uint32_t'"); |
785 | 0 | return MsgValueError; |
786 | 0 | } |
787 | 0 | // Sentinel = 'chromeFlags' |
788 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 299515804)))) { |
789 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
790 | 0 | return MsgValueError; |
791 | 0 | } |
792 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(cpId)))))) { |
793 | 0 | FatalError("Error deserializing 'ContentParentId'"); |
794 | 0 | return MsgValueError; |
795 | 0 | } |
796 | 0 | // Sentinel = 'cpId' |
797 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2452595622)))) { |
798 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'ContentParentId'"); |
799 | 0 | return MsgValueError; |
800 | 0 | } |
801 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(isForBrowser)))))) { |
802 | 0 | FatalError("Error deserializing 'bool'"); |
803 | 0 | return MsgValueError; |
804 | 0 | } |
805 | 0 | // Sentinel = 'isForBrowser' |
806 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2051565587)))) { |
807 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'bool'"); |
808 | 0 | return MsgValueError; |
809 | 0 | } |
810 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
811 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
812 | 0 | FatalError("Transition error"); |
813 | 0 | return MsgValueError; |
814 | 0 | } |
815 | 0 | actor = AllocPBrowserChild(tabId, sameTabGroupAs, context, chromeFlags, cpId, isForBrowser); |
816 | 0 | if ((!(actor))) { |
817 | 0 | NS_WARNING("Error constructing actor PBrowserChild"); |
818 | 0 | return MsgValueError; |
819 | 0 | } |
820 | 0 | (actor)->SetManagerAndRegister(this, (handle__).mId); |
821 | 0 | (mManagedPBrowserChild).PutEntry(actor); |
822 | 0 | (actor)->mLivenessState = mozilla::ipc::LivenessState::Start; |
823 | 0 |
|
824 | 0 | if ((!(RecvPBrowserConstructor(actor, tabId, sameTabGroupAs, context, chromeFlags, cpId, isForBrowser)))) { |
825 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
826 | 0 | // Error handled in mozilla::ipc::IPCResult |
827 | 0 | return MsgProcessingError; |
828 | 0 | } |
829 | 0 | |
830 | 0 | return MsgProcessed; |
831 | 0 | } |
832 | 0 | case PContentBridge::Reply_PFileDescriptorSetConstructor__ID: |
833 | 0 | { |
834 | 0 | return MsgProcessed; |
835 | 0 | } |
836 | 0 | case PContentBridge::Msg_PFileDescriptorSetConstructor__ID: |
837 | 0 | { |
838 | 0 | if (mozilla::ipc::LoggingEnabledFor("PContentBridgeChild")) { |
839 | 0 | mozilla::ipc::LogMessageForProtocol("PContentBridgeChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
840 | 0 | } |
841 | 0 | AUTO_PROFILER_LABEL("PContentBridge::Msg_PFileDescriptorSetConstructor", OTHER); |
842 | 0 |
|
843 | 0 | PickleIterator iter__(msg__); |
844 | 0 | ActorHandle handle__; |
845 | 0 | PFileDescriptorSetChild* actor; |
846 | 0 | FileDescriptor fd; |
847 | 0 |
|
848 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(handle__)))))) { |
849 | 0 | FatalError("Error deserializing 'ActorHandle'"); |
850 | 0 | return MsgValueError; |
851 | 0 | } |
852 | 0 | // Sentinel = 'actor' |
853 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) { |
854 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'"); |
855 | 0 | return MsgValueError; |
856 | 0 | } |
857 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(fd)))))) { |
858 | 0 | FatalError("Error deserializing 'FileDescriptor'"); |
859 | 0 | return MsgValueError; |
860 | 0 | } |
861 | 0 | // Sentinel = 'fd' |
862 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 628535764)))) { |
863 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'FileDescriptor'"); |
864 | 0 | return MsgValueError; |
865 | 0 | } |
866 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
867 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
868 | 0 | FatalError("Transition error"); |
869 | 0 | return MsgValueError; |
870 | 0 | } |
871 | 0 | actor = AllocPFileDescriptorSetChild(fd); |
872 | 0 | if ((!(actor))) { |
873 | 0 | NS_WARNING("Error constructing actor PFileDescriptorSetChild"); |
874 | 0 | return MsgValueError; |
875 | 0 | } |
876 | 0 | (actor)->SetManagerAndRegister(this, (handle__).mId); |
877 | 0 | (mManagedPFileDescriptorSetChild).PutEntry(actor); |
878 | 0 | (actor)->mLivenessState = mozilla::ipc::LivenessState::Start; |
879 | 0 |
|
880 | 0 | if ((!(RecvPFileDescriptorSetConstructor(actor, fd)))) { |
881 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
882 | 0 | // Error handled in mozilla::ipc::IPCResult |
883 | 0 | return MsgProcessingError; |
884 | 0 | } |
885 | 0 | |
886 | 0 | return MsgProcessed; |
887 | 0 | } |
888 | 0 | case PContentBridge::Msg_AsyncMessage__ID: |
889 | 0 | { |
890 | 0 | if (mozilla::ipc::LoggingEnabledFor("PContentBridgeChild")) { |
891 | 0 | mozilla::ipc::LogMessageForProtocol("PContentBridgeChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
892 | 0 | } |
893 | 0 | AUTO_PROFILER_LABEL("PContentBridge::Msg_AsyncMessage", OTHER); |
894 | 0 |
|
895 | 0 | PickleIterator iter__(msg__); |
896 | 0 | nsString aMessage; |
897 | 0 | nsTArray<CpowEntry> aCpows; |
898 | 0 | Principal aPrincipal; |
899 | 0 | ClonedMessageData aData; |
900 | 0 |
|
901 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aMessage)))))) { |
902 | 0 | FatalError("Error deserializing 'nsString'"); |
903 | 0 | return MsgValueError; |
904 | 0 | } |
905 | 0 | // Sentinel = 'aMessage' |
906 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3453110902)))) { |
907 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsString'"); |
908 | 0 | return MsgValueError; |
909 | 0 | } |
910 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aCpows)))))) { |
911 | 0 | FatalError("Error deserializing 'nsTArray'"); |
912 | 0 | return MsgValueError; |
913 | 0 | } |
914 | 0 | // Sentinel = 'aCpows' |
915 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2178221451)))) { |
916 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'"); |
917 | 0 | return MsgValueError; |
918 | 0 | } |
919 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aPrincipal)))))) { |
920 | 0 | FatalError("Error deserializing 'Principal'"); |
921 | 0 | return MsgValueError; |
922 | 0 | } |
923 | 0 | // Sentinel = 'aPrincipal' |
924 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4097511)))) { |
925 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'Principal'"); |
926 | 0 | return MsgValueError; |
927 | 0 | } |
928 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aData)))))) { |
929 | 0 | FatalError("Error deserializing 'ClonedMessageData'"); |
930 | 0 | return MsgValueError; |
931 | 0 | } |
932 | 0 | // Sentinel = 'aData' |
933 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3285075324)))) { |
934 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'ClonedMessageData'"); |
935 | 0 | return MsgValueError; |
936 | 0 | } |
937 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
938 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
939 | 0 | FatalError("Transition error"); |
940 | 0 | return MsgValueError; |
941 | 0 | } |
942 | 0 | if ((!(RecvAsyncMessage(aMessage, std::move(aCpows), aPrincipal, aData)))) { |
943 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
944 | 0 | // Error handled in mozilla::ipc::IPCResult |
945 | 0 | return MsgProcessingError; |
946 | 0 | } |
947 | 0 | |
948 | 0 | return MsgProcessed; |
949 | 0 | } |
950 | 0 | default: |
951 | 0 | { |
952 | 0 | return MsgNotKnown; |
953 | 0 | } |
954 | 0 | case SHMEM_CREATED_MESSAGE_TYPE: |
955 | 0 | { |
956 | 0 | if ((!(ShmemCreated(msg__)))) { |
957 | 0 | return MsgPayloadError; |
958 | 0 | } |
959 | 0 | return MsgProcessed; |
960 | 0 | } |
961 | 0 | case SHMEM_DESTROYED_MESSAGE_TYPE: |
962 | 0 | { |
963 | 0 | if ((!(ShmemDestroyed(msg__)))) { |
964 | 0 | return MsgPayloadError; |
965 | 0 | } |
966 | 0 | return MsgProcessed; |
967 | 0 | } |
968 | 0 | } |
969 | 0 | } |
970 | | |
971 | | auto PContentBridgeChild::OnMessageReceived( |
972 | | const Message& msg__, |
973 | | Message*& reply__) -> PContentBridgeChild::Result |
974 | 0 | { |
975 | 0 | int32_t route__ = (msg__).routing_id(); |
976 | 0 | if ((MSG_ROUTING_CONTROL) != (route__)) { |
977 | 0 | IProtocol* routed__ = Lookup(route__); |
978 | 0 | if ((!(routed__))) { |
979 | 0 | return MsgRouteError; |
980 | 0 | } |
981 | 0 | return (routed__)->OnMessageReceived(msg__, reply__); |
982 | 0 | } |
983 | 0 | |
984 | 0 | return MsgNotKnown; |
985 | 0 | } |
986 | | |
987 | | auto PContentBridgeChild::OnCallReceived( |
988 | | const Message& msg__, |
989 | | Message*& reply__) -> PContentBridgeChild::Result |
990 | 0 | { |
991 | 0 | MOZ_ASSERT_UNREACHABLE("message protocol not supported"); |
992 | 0 | return MsgNotKnown; |
993 | 0 | } |
994 | | |
995 | | auto PContentBridgeChild::GetProtocolTypeId() -> int32_t |
996 | 0 | { |
997 | 0 | return PContentBridgeMsgStart; |
998 | 0 | } |
999 | | |
1000 | | auto PContentBridgeChild::OnChannelClose() -> void |
1001 | 0 | { |
1002 | 0 | DestroySubtree(NormalShutdown); |
1003 | 0 | DeallocSubtree(); |
1004 | 0 | DeallocShmems(); |
1005 | 0 | DeallocPContentBridgeChild(); |
1006 | 0 | } |
1007 | | |
1008 | | auto PContentBridgeChild::OnChannelError() -> void |
1009 | 0 | { |
1010 | 0 | DestroySubtree(AbnormalShutdown); |
1011 | 0 | DeallocSubtree(); |
1012 | 0 | DeallocShmems(); |
1013 | 0 | DeallocPContentBridgeChild(); |
1014 | 0 | } |
1015 | | |
1016 | | auto PContentBridgeChild::DestroySubtree(ActorDestroyReason why) -> void |
1017 | 0 | { |
1018 | 0 | ActorDestroyReason subtreewhy = (((why) == (Deletion)) || ((why) == (FailedConstructor)) ? AncestorDeletion : why); |
1019 | 0 |
|
1020 | 0 | { |
1021 | 0 | // Recursively shutting down PBrowser kids |
1022 | 0 | nsTArray<PBrowserChild*> kids; |
1023 | 0 | // Accumulate kids into a stable structure to iterate over |
1024 | 0 | ManagedPBrowserChild(kids); |
1025 | 0 | for (auto& kid : kids) { |
1026 | 0 | // Guarding against a child removing a sibling from the list during the iteration. |
1027 | 0 | if ((mManagedPBrowserChild).Contains(kid)) { |
1028 | 0 | (kid)->DestroySubtree(subtreewhy); |
1029 | 0 | } |
1030 | 0 | } |
1031 | 0 | } |
1032 | 0 | { |
1033 | 0 | // Recursively shutting down PFileDescriptorSet kids |
1034 | 0 | nsTArray<PFileDescriptorSetChild*> kids; |
1035 | 0 | // Accumulate kids into a stable structure to iterate over |
1036 | 0 | ManagedPFileDescriptorSetChild(kids); |
1037 | 0 | for (auto& kid : kids) { |
1038 | 0 | // Guarding against a child removing a sibling from the list during the iteration. |
1039 | 0 | if ((mManagedPFileDescriptorSetChild).Contains(kid)) { |
1040 | 0 | (kid)->DestroySubtree(subtreewhy); |
1041 | 0 | } |
1042 | 0 | } |
1043 | 0 | } |
1044 | 0 | { |
1045 | 0 | // Recursively shutting down PJavaScript kids |
1046 | 0 | nsTArray<PJavaScriptChild*> kids; |
1047 | 0 | // Accumulate kids into a stable structure to iterate over |
1048 | 0 | ManagedPJavaScriptChild(kids); |
1049 | 0 | for (auto& kid : kids) { |
1050 | 0 | // Guarding against a child removing a sibling from the list during the iteration. |
1051 | 0 | if ((mManagedPJavaScriptChild).Contains(kid)) { |
1052 | 0 | (kid)->DestroySubtree(subtreewhy); |
1053 | 0 | } |
1054 | 0 | } |
1055 | 0 | } |
1056 | 0 | { |
1057 | 0 | // Recursively shutting down PChildToParentStream kids |
1058 | 0 | nsTArray<PChildToParentStreamChild*> kids; |
1059 | 0 | // Accumulate kids into a stable structure to iterate over |
1060 | 0 | ManagedPChildToParentStreamChild(kids); |
1061 | 0 | for (auto& kid : kids) { |
1062 | 0 | // Guarding against a child removing a sibling from the list during the iteration. |
1063 | 0 | if ((mManagedPChildToParentStreamChild).Contains(kid)) { |
1064 | 0 | (kid)->DestroySubtree(subtreewhy); |
1065 | 0 | } |
1066 | 0 | } |
1067 | 0 | } |
1068 | 0 | { |
1069 | 0 | // Recursively shutting down PParentToChildStream kids |
1070 | 0 | nsTArray<PParentToChildStreamChild*> kids; |
1071 | 0 | // Accumulate kids into a stable structure to iterate over |
1072 | 0 | ManagedPParentToChildStreamChild(kids); |
1073 | 0 | for (auto& kid : kids) { |
1074 | 0 | // Guarding against a child removing a sibling from the list during the iteration. |
1075 | 0 | if ((mManagedPParentToChildStreamChild).Contains(kid)) { |
1076 | 0 | (kid)->DestroySubtree(subtreewhy); |
1077 | 0 | } |
1078 | 0 | } |
1079 | 0 | } |
1080 | 0 | { |
1081 | 0 | // Recursively shutting down PIPCBlobInputStream kids |
1082 | 0 | nsTArray<PIPCBlobInputStreamChild*> kids; |
1083 | 0 | // Accumulate kids into a stable structure to iterate over |
1084 | 0 | ManagedPIPCBlobInputStreamChild(kids); |
1085 | 0 | for (auto& kid : kids) { |
1086 | 0 | // Guarding against a child removing a sibling from the list during the iteration. |
1087 | 0 | if ((mManagedPIPCBlobInputStreamChild).Contains(kid)) { |
1088 | 0 | (kid)->DestroySubtree(subtreewhy); |
1089 | 0 | } |
1090 | 0 | } |
1091 | 0 | } |
1092 | 0 |
|
1093 | 0 | // Reject owning pending responses. |
1094 | 0 | (GetIPCChannel())->RejectPendingResponsesForActor(this); |
1095 | 0 |
|
1096 | 0 | // Finally, destroy "us". |
1097 | 0 | ActorDestroy(why); |
1098 | 0 | } |
1099 | | |
1100 | | auto PContentBridgeChild::DeallocSubtree() -> void |
1101 | 0 | { |
1102 | 0 | { |
1103 | 0 | // Recursively deleting PBrowser kids |
1104 | 0 | for (auto iter = (mManagedPBrowserChild).Iter(); (!((iter).Done())); (iter).Next()) { |
1105 | 0 | (((iter).Get())->GetKey())->DeallocSubtree(); |
1106 | 0 | } |
1107 | 0 |
|
1108 | 0 | for (auto iter = (mManagedPBrowserChild).Iter(); (!((iter).Done())); (iter).Next()) { |
1109 | 0 | DeallocPBrowserChild(((iter).Get())->GetKey()); |
1110 | 0 | } |
1111 | 0 | (mManagedPBrowserChild).Clear(); |
1112 | 0 | } |
1113 | 0 | { |
1114 | 0 | // Recursively deleting PFileDescriptorSet kids |
1115 | 0 | for (auto iter = (mManagedPFileDescriptorSetChild).Iter(); (!((iter).Done())); (iter).Next()) { |
1116 | 0 | (((iter).Get())->GetKey())->DeallocSubtree(); |
1117 | 0 | } |
1118 | 0 |
|
1119 | 0 | for (auto iter = (mManagedPFileDescriptorSetChild).Iter(); (!((iter).Done())); (iter).Next()) { |
1120 | 0 | DeallocPFileDescriptorSetChild(((iter).Get())->GetKey()); |
1121 | 0 | } |
1122 | 0 | (mManagedPFileDescriptorSetChild).Clear(); |
1123 | 0 | } |
1124 | 0 | { |
1125 | 0 | // Recursively deleting PJavaScript kids |
1126 | 0 | for (auto iter = (mManagedPJavaScriptChild).Iter(); (!((iter).Done())); (iter).Next()) { |
1127 | 0 | (((iter).Get())->GetKey())->DeallocSubtree(); |
1128 | 0 | } |
1129 | 0 |
|
1130 | 0 | for (auto iter = (mManagedPJavaScriptChild).Iter(); (!((iter).Done())); (iter).Next()) { |
1131 | 0 | DeallocPJavaScriptChild(((iter).Get())->GetKey()); |
1132 | 0 | } |
1133 | 0 | (mManagedPJavaScriptChild).Clear(); |
1134 | 0 | } |
1135 | 0 | { |
1136 | 0 | // Recursively deleting PChildToParentStream kids |
1137 | 0 | for (auto iter = (mManagedPChildToParentStreamChild).Iter(); (!((iter).Done())); (iter).Next()) { |
1138 | 0 | (((iter).Get())->GetKey())->DeallocSubtree(); |
1139 | 0 | } |
1140 | 0 |
|
1141 | 0 | for (auto iter = (mManagedPChildToParentStreamChild).Iter(); (!((iter).Done())); (iter).Next()) { |
1142 | 0 | DeallocPChildToParentStreamChild(((iter).Get())->GetKey()); |
1143 | 0 | } |
1144 | 0 | (mManagedPChildToParentStreamChild).Clear(); |
1145 | 0 | } |
1146 | 0 | { |
1147 | 0 | // Recursively deleting PParentToChildStream kids |
1148 | 0 | for (auto iter = (mManagedPParentToChildStreamChild).Iter(); (!((iter).Done())); (iter).Next()) { |
1149 | 0 | (((iter).Get())->GetKey())->DeallocSubtree(); |
1150 | 0 | } |
1151 | 0 |
|
1152 | 0 | for (auto iter = (mManagedPParentToChildStreamChild).Iter(); (!((iter).Done())); (iter).Next()) { |
1153 | 0 | DeallocPParentToChildStreamChild(((iter).Get())->GetKey()); |
1154 | 0 | } |
1155 | 0 | (mManagedPParentToChildStreamChild).Clear(); |
1156 | 0 | } |
1157 | 0 | { |
1158 | 0 | // Recursively deleting PIPCBlobInputStream kids |
1159 | 0 | for (auto iter = (mManagedPIPCBlobInputStreamChild).Iter(); (!((iter).Done())); (iter).Next()) { |
1160 | 0 | (((iter).Get())->GetKey())->DeallocSubtree(); |
1161 | 0 | } |
1162 | 0 |
|
1163 | 0 | for (auto iter = (mManagedPIPCBlobInputStreamChild).Iter(); (!((iter).Done())); (iter).Next()) { |
1164 | 0 | DeallocPIPCBlobInputStreamChild(((iter).Get())->GetKey()); |
1165 | 0 | } |
1166 | 0 | (mManagedPIPCBlobInputStreamChild).Clear(); |
1167 | 0 | } |
1168 | 0 | } |
1169 | | |
1170 | | auto PContentBridgeChild::DeallocPContentBridgeChild() -> void |
1171 | 0 | { |
1172 | 0 | } |
1173 | | |
1174 | | |
1175 | | |
1176 | | } // namespace dom |
1177 | | } // namespace mozilla |
1178 | | namespace mozilla { |
1179 | | namespace ipc { |
1180 | | auto IPDLParamTraits<mozilla::dom::PContentBridgeChild>::Write( |
1181 | | IPC::Message* aMsg, |
1182 | | mozilla::ipc::IProtocol* aActor, |
1183 | | const paramType& aVar) -> void |
1184 | 0 | { |
1185 | 0 | int32_t id; |
1186 | 0 | if ((!(aVar))) { |
1187 | 0 | id = 0; |
1188 | 0 | } |
1189 | 0 | else { |
1190 | 0 | id = (aVar)->Id(); |
1191 | 0 | if ((1) == (id)) { |
1192 | 0 | (aActor)->FatalError("actor has been |delete|d"); |
1193 | 0 | } |
1194 | 0 | } |
1195 | 0 | WriteIPDLParam(aMsg, aActor, id); |
1196 | 0 | } |
1197 | | |
1198 | | auto IPDLParamTraits<mozilla::dom::PContentBridgeChild>::Read( |
1199 | | const IPC::Message* aMsg, |
1200 | | PickleIterator* aIter, |
1201 | | mozilla::ipc::IProtocol* aActor, |
1202 | | paramType* aVar) -> bool |
1203 | 0 | { |
1204 | 0 | mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PContentBridge", PContentBridgeMsgStart); |
1205 | 0 | if ((actor).isNothing()) { |
1206 | 0 | return false; |
1207 | 0 | } |
1208 | 0 | |
1209 | 0 | (*(aVar)) = static_cast<mozilla::dom::PContentBridgeChild*>((actor).value()); |
1210 | 0 | return true; |
1211 | 0 | } |
1212 | | |
1213 | | } // namespace ipc |
1214 | | } // namespace mozilla |