/work/obj-fuzz/ipc/ipdl/PWebBrowserPersistDocumentChild.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/PWebBrowserPersistDocumentChild.h" |
8 | | |
9 | | #include "mozilla/dom/PContentChild.h" |
10 | | #include "mozilla/PWebBrowserPersistResourcesChild.h" |
11 | | #include "mozilla/PWebBrowserPersistSerializeChild.h" |
12 | | #include "mozilla/ipc/PFileDescriptorSetChild.h" |
13 | | #include "mozilla/ipc/PChildToParentStreamChild.h" |
14 | | #include "mozilla/ipc/PParentToChildStreamChild.h" |
15 | | |
16 | | #include "nsIFile.h" |
17 | | #include "GeckoProfiler.h" |
18 | | |
19 | | namespace mozilla { |
20 | | |
21 | | |
22 | | auto PWebBrowserPersistDocumentChild::RecvPWebBrowserPersistResourcesConstructor(PWebBrowserPersistResourcesChild* actor) -> mozilla::ipc::IPCResult |
23 | 0 | { |
24 | 0 | return IPC_OK(); |
25 | 0 | } |
26 | | |
27 | | auto PWebBrowserPersistDocumentChild::RecvPWebBrowserPersistSerializeConstructor( |
28 | | PWebBrowserPersistSerializeChild* actor, |
29 | | const WebBrowserPersistURIMap& aMap, |
30 | | const nsCString& aRequestedContentType, |
31 | | const uint32_t& aEncoderFlags, |
32 | | const uint32_t& aWrapColumn) -> mozilla::ipc::IPCResult |
33 | 0 | { |
34 | 0 | return IPC_OK(); |
35 | 0 | } |
36 | | |
37 | | auto PWebBrowserPersistDocumentChild::Recv__delete__() -> mozilla::ipc::IPCResult |
38 | 0 | { |
39 | 0 | return IPC_OK(); |
40 | 0 | } |
41 | | |
42 | | auto PWebBrowserPersistDocumentChild::ActorDestroy(ActorDestroyReason aWhy) -> void |
43 | 0 | { |
44 | 0 | } |
45 | | |
46 | | MOZ_IMPLICIT PWebBrowserPersistDocumentChild::PWebBrowserPersistDocumentChild() : |
47 | | mozilla::ipc::IProtocol(mozilla::ipc::ChildSide), |
48 | | mLivenessState(mozilla::ipc::LivenessState::Dead) |
49 | 0 | { |
50 | 0 | MOZ_COUNT_CTOR(PWebBrowserPersistDocumentChild); |
51 | 0 | } |
52 | | |
53 | | PWebBrowserPersistDocumentChild::~PWebBrowserPersistDocumentChild() |
54 | 0 | { |
55 | 0 | MOZ_COUNT_DTOR(PWebBrowserPersistDocumentChild); |
56 | 0 | } |
57 | | |
58 | | auto PWebBrowserPersistDocumentChild::Manager() const -> PContentChild* |
59 | 0 | { |
60 | 0 | return static_cast<PContentChild*>(IProtocol::Manager()); |
61 | 0 | } |
62 | | |
63 | | auto PWebBrowserPersistDocumentChild::ManagedPWebBrowserPersistResourcesChild(nsTArray<PWebBrowserPersistResourcesChild*>& aArr) const -> void |
64 | 0 | { |
65 | 0 | (mManagedPWebBrowserPersistResourcesChild).ToArray(aArr); |
66 | 0 | } |
67 | | |
68 | | auto PWebBrowserPersistDocumentChild::ManagedPWebBrowserPersistResourcesChild() const -> const ManagedContainer<PWebBrowserPersistResourcesChild>& |
69 | 0 | { |
70 | 0 | return mManagedPWebBrowserPersistResourcesChild; |
71 | 0 | } |
72 | | |
73 | | auto PWebBrowserPersistDocumentChild::ManagedPWebBrowserPersistSerializeChild(nsTArray<PWebBrowserPersistSerializeChild*>& aArr) const -> void |
74 | 0 | { |
75 | 0 | (mManagedPWebBrowserPersistSerializeChild).ToArray(aArr); |
76 | 0 | } |
77 | | |
78 | | auto PWebBrowserPersistDocumentChild::ManagedPWebBrowserPersistSerializeChild() const -> const ManagedContainer<PWebBrowserPersistSerializeChild>& |
79 | 0 | { |
80 | 0 | return mManagedPWebBrowserPersistSerializeChild; |
81 | 0 | } |
82 | | |
83 | | auto PWebBrowserPersistDocumentChild::SendAttributes( |
84 | | const WebBrowserPersistDocumentAttrs& aAttrs, |
85 | | const OptionalIPCStream& stream) -> bool |
86 | 0 | { |
87 | 0 | IPC::Message* msg__ = PWebBrowserPersistDocument::Msg_Attributes(Id()); |
88 | 0 |
|
89 | 0 | WriteIPDLParam(msg__, this, aAttrs); |
90 | 0 | // Sentinel = 'aAttrs' |
91 | 0 | (msg__)->WriteSentinel(2405661289); |
92 | 0 | WriteIPDLParam(msg__, this, stream); |
93 | 0 | // Sentinel = 'stream' |
94 | 0 | (msg__)->WriteSentinel(4152748422); |
95 | 0 |
|
96 | 0 |
|
97 | 0 |
|
98 | 0 |
|
99 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebBrowserPersistDocumentChild")) { |
100 | 0 | mozilla::ipc::LogMessageForProtocol("PWebBrowserPersistDocumentChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
101 | 0 | } |
102 | 0 | AUTO_PROFILER_LABEL("PWebBrowserPersistDocument::Msg_Attributes", OTHER); |
103 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
104 | 0 | mozilla::ipc::LogicError("Transition error"); |
105 | 0 | } |
106 | 0 |
|
107 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
108 | 0 | return sendok__; |
109 | 0 | } |
110 | | |
111 | | auto PWebBrowserPersistDocumentChild::SendInitFailure(const nsresult& aStatus) -> bool |
112 | 0 | { |
113 | 0 | IPC::Message* msg__ = PWebBrowserPersistDocument::Msg_InitFailure(Id()); |
114 | 0 |
|
115 | 0 | WriteIPDLParam(msg__, this, aStatus); |
116 | 0 | // Sentinel = 'aStatus' |
117 | 0 | (msg__)->WriteSentinel(236002576); |
118 | 0 |
|
119 | 0 |
|
120 | 0 |
|
121 | 0 |
|
122 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebBrowserPersistDocumentChild")) { |
123 | 0 | mozilla::ipc::LogMessageForProtocol("PWebBrowserPersistDocumentChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
124 | 0 | } |
125 | 0 | AUTO_PROFILER_LABEL("PWebBrowserPersistDocument::Msg_InitFailure", OTHER); |
126 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
127 | 0 | mozilla::ipc::LogicError("Transition error"); |
128 | 0 | } |
129 | 0 |
|
130 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
131 | 0 | return sendok__; |
132 | 0 | } |
133 | | |
134 | | auto PWebBrowserPersistDocumentChild::RemoveManagee( |
135 | | int32_t aProtocolId, |
136 | | IProtocol* aListener) -> void |
137 | 0 | { |
138 | 0 | switch (aProtocolId) { |
139 | 0 | case PWebBrowserPersistResourcesMsgStart: |
140 | 0 | { |
141 | 0 | PWebBrowserPersistResourcesChild* actor = static_cast<PWebBrowserPersistResourcesChild*>(aListener); |
142 | 0 | auto& container = mManagedPWebBrowserPersistResourcesChild; |
143 | 0 | MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!"); |
144 | 0 |
|
145 | 0 | (container).RemoveEntry(actor); |
146 | 0 | DeallocPWebBrowserPersistResourcesChild(actor); |
147 | 0 | return; |
148 | 0 | } |
149 | 0 | case PWebBrowserPersistSerializeMsgStart: |
150 | 0 | { |
151 | 0 | PWebBrowserPersistSerializeChild* actor = static_cast<PWebBrowserPersistSerializeChild*>(aListener); |
152 | 0 | auto& container = mManagedPWebBrowserPersistSerializeChild; |
153 | 0 | MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!"); |
154 | 0 |
|
155 | 0 | (container).RemoveEntry(actor); |
156 | 0 | DeallocPWebBrowserPersistSerializeChild(actor); |
157 | 0 | return; |
158 | 0 | } |
159 | 0 | default: |
160 | 0 | { |
161 | 0 | FatalError("unreached"); |
162 | 0 | return; |
163 | 0 | } |
164 | 0 | } |
165 | 0 | } |
166 | | |
167 | | auto PWebBrowserPersistDocumentChild::OnMessageReceived(const Message& msg__) -> PWebBrowserPersistDocumentChild::Result |
168 | 0 | { |
169 | 0 | switch ((msg__).type()) { |
170 | 0 | case PWebBrowserPersistDocument::Msg_SetPersistFlags__ID: |
171 | 0 | { |
172 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebBrowserPersistDocumentChild")) { |
173 | 0 | mozilla::ipc::LogMessageForProtocol("PWebBrowserPersistDocumentChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
174 | 0 | } |
175 | 0 | AUTO_PROFILER_LABEL("PWebBrowserPersistDocument::Msg_SetPersistFlags", OTHER); |
176 | 0 |
|
177 | 0 | PickleIterator iter__(msg__); |
178 | 0 | uint32_t aNewFlags; |
179 | 0 |
|
180 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aNewFlags)))))) { |
181 | 0 | FatalError("Error deserializing 'uint32_t'"); |
182 | 0 | return MsgValueError; |
183 | 0 | } |
184 | 0 | // Sentinel = 'aNewFlags' |
185 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4032949079)))) { |
186 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
187 | 0 | return MsgValueError; |
188 | 0 | } |
189 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
190 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
191 | 0 | FatalError("Transition error"); |
192 | 0 | return MsgValueError; |
193 | 0 | } |
194 | 0 | if ((!(RecvSetPersistFlags(aNewFlags)))) { |
195 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
196 | 0 | // Error handled in mozilla::ipc::IPCResult |
197 | 0 | return MsgProcessingError; |
198 | 0 | } |
199 | 0 | |
200 | 0 | return MsgProcessed; |
201 | 0 | } |
202 | 0 | case PWebBrowserPersistDocument::Msg_PWebBrowserPersistResourcesConstructor__ID: |
203 | 0 | { |
204 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebBrowserPersistDocumentChild")) { |
205 | 0 | mozilla::ipc::LogMessageForProtocol("PWebBrowserPersistDocumentChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
206 | 0 | } |
207 | 0 | AUTO_PROFILER_LABEL("PWebBrowserPersistDocument::Msg_PWebBrowserPersistResourcesConstructor", OTHER); |
208 | 0 |
|
209 | 0 | PickleIterator iter__(msg__); |
210 | 0 | ActorHandle handle__; |
211 | 0 | PWebBrowserPersistResourcesChild* actor; |
212 | 0 |
|
213 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(handle__)))))) { |
214 | 0 | FatalError("Error deserializing 'ActorHandle'"); |
215 | 0 | return MsgValueError; |
216 | 0 | } |
217 | 0 | // Sentinel = 'actor' |
218 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) { |
219 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'"); |
220 | 0 | return MsgValueError; |
221 | 0 | } |
222 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
223 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
224 | 0 | FatalError("Transition error"); |
225 | 0 | return MsgValueError; |
226 | 0 | } |
227 | 0 | actor = AllocPWebBrowserPersistResourcesChild(); |
228 | 0 | if ((!(actor))) { |
229 | 0 | NS_WARNING("Error constructing actor PWebBrowserPersistResourcesChild"); |
230 | 0 | return MsgValueError; |
231 | 0 | } |
232 | 0 | (actor)->SetManagerAndRegister(this, (handle__).mId); |
233 | 0 | (mManagedPWebBrowserPersistResourcesChild).PutEntry(actor); |
234 | 0 | (actor)->mLivenessState = mozilla::ipc::LivenessState::Start; |
235 | 0 |
|
236 | 0 | if ((!(RecvPWebBrowserPersistResourcesConstructor(actor)))) { |
237 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
238 | 0 | // Error handled in mozilla::ipc::IPCResult |
239 | 0 | return MsgProcessingError; |
240 | 0 | } |
241 | 0 | |
242 | 0 | return MsgProcessed; |
243 | 0 | } |
244 | 0 | case PWebBrowserPersistDocument::Msg_PWebBrowserPersistSerializeConstructor__ID: |
245 | 0 | { |
246 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebBrowserPersistDocumentChild")) { |
247 | 0 | mozilla::ipc::LogMessageForProtocol("PWebBrowserPersistDocumentChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
248 | 0 | } |
249 | 0 | AUTO_PROFILER_LABEL("PWebBrowserPersistDocument::Msg_PWebBrowserPersistSerializeConstructor", OTHER); |
250 | 0 |
|
251 | 0 | PickleIterator iter__(msg__); |
252 | 0 | ActorHandle handle__; |
253 | 0 | PWebBrowserPersistSerializeChild* actor; |
254 | 0 | WebBrowserPersistURIMap aMap; |
255 | 0 | nsCString aRequestedContentType; |
256 | 0 | uint32_t aEncoderFlags; |
257 | 0 | uint32_t aWrapColumn; |
258 | 0 |
|
259 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(handle__)))))) { |
260 | 0 | FatalError("Error deserializing 'ActorHandle'"); |
261 | 0 | return MsgValueError; |
262 | 0 | } |
263 | 0 | // Sentinel = 'actor' |
264 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) { |
265 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'"); |
266 | 0 | return MsgValueError; |
267 | 0 | } |
268 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aMap)))))) { |
269 | 0 | FatalError("Error deserializing 'WebBrowserPersistURIMap'"); |
270 | 0 | return MsgValueError; |
271 | 0 | } |
272 | 0 | // Sentinel = 'aMap' |
273 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3570578933)))) { |
274 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'WebBrowserPersistURIMap'"); |
275 | 0 | return MsgValueError; |
276 | 0 | } |
277 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aRequestedContentType)))))) { |
278 | 0 | FatalError("Error deserializing 'nsCString'"); |
279 | 0 | return MsgValueError; |
280 | 0 | } |
281 | 0 | // Sentinel = 'aRequestedContentType' |
282 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 193281947)))) { |
283 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'"); |
284 | 0 | return MsgValueError; |
285 | 0 | } |
286 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aEncoderFlags)))))) { |
287 | 0 | FatalError("Error deserializing 'uint32_t'"); |
288 | 0 | return MsgValueError; |
289 | 0 | } |
290 | 0 | // Sentinel = 'aEncoderFlags' |
291 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1146908877)))) { |
292 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
293 | 0 | return MsgValueError; |
294 | 0 | } |
295 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aWrapColumn)))))) { |
296 | 0 | FatalError("Error deserializing 'uint32_t'"); |
297 | 0 | return MsgValueError; |
298 | 0 | } |
299 | 0 | // Sentinel = 'aWrapColumn' |
300 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3600022264)))) { |
301 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'"); |
302 | 0 | return MsgValueError; |
303 | 0 | } |
304 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
305 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
306 | 0 | FatalError("Transition error"); |
307 | 0 | return MsgValueError; |
308 | 0 | } |
309 | 0 | actor = AllocPWebBrowserPersistSerializeChild(aMap, aRequestedContentType, aEncoderFlags, aWrapColumn); |
310 | 0 | if ((!(actor))) { |
311 | 0 | NS_WARNING("Error constructing actor PWebBrowserPersistSerializeChild"); |
312 | 0 | return MsgValueError; |
313 | 0 | } |
314 | 0 | (actor)->SetManagerAndRegister(this, (handle__).mId); |
315 | 0 | (mManagedPWebBrowserPersistSerializeChild).PutEntry(actor); |
316 | 0 | (actor)->mLivenessState = mozilla::ipc::LivenessState::Start; |
317 | 0 |
|
318 | 0 | if ((!(RecvPWebBrowserPersistSerializeConstructor(actor, aMap, aRequestedContentType, aEncoderFlags, aWrapColumn)))) { |
319 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
320 | 0 | // Error handled in mozilla::ipc::IPCResult |
321 | 0 | return MsgProcessingError; |
322 | 0 | } |
323 | 0 | |
324 | 0 | return MsgProcessed; |
325 | 0 | } |
326 | 0 | case PWebBrowserPersistDocument::Msg___delete____ID: |
327 | 0 | { |
328 | 0 | if (mozilla::ipc::LoggingEnabledFor("PWebBrowserPersistDocumentChild")) { |
329 | 0 | mozilla::ipc::LogMessageForProtocol("PWebBrowserPersistDocumentChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
330 | 0 | } |
331 | 0 | AUTO_PROFILER_LABEL("PWebBrowserPersistDocument::Msg___delete__", OTHER); |
332 | 0 |
|
333 | 0 | PickleIterator iter__(msg__); |
334 | 0 | PWebBrowserPersistDocumentChild* actor; |
335 | 0 |
|
336 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) { |
337 | 0 | FatalError("Error deserializing 'PWebBrowserPersistDocumentChild'"); |
338 | 0 | return MsgValueError; |
339 | 0 | } |
340 | 0 | if ((!((*((&(actor))))))) { |
341 | 0 | FatalError("Error deserializing 'PWebBrowserPersistDocumentChild'"); |
342 | 0 | return MsgValueError; |
343 | 0 | } |
344 | 0 | // Sentinel = 'actor' |
345 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) { |
346 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'PWebBrowserPersistDocumentChild'"); |
347 | 0 | return MsgValueError; |
348 | 0 | } |
349 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
350 | 0 | if ((!(StateTransition(true, (&(mLivenessState)))))) { |
351 | 0 | FatalError("Transition error"); |
352 | 0 | return MsgValueError; |
353 | 0 | } |
354 | 0 | if ((!(Recv__delete__()))) { |
355 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
356 | 0 | // Error handled in mozilla::ipc::IPCResult |
357 | 0 | return MsgProcessingError; |
358 | 0 | } |
359 | 0 | |
360 | 0 | |
361 | 0 | IProtocol* mgr = (actor)->Manager(); |
362 | 0 | (actor)->DestroySubtree(Deletion); |
363 | 0 | (actor)->DeallocSubtree(); |
364 | 0 | (mgr)->RemoveManagee(PWebBrowserPersistDocumentMsgStart, actor); |
365 | 0 |
|
366 | 0 | return MsgProcessed; |
367 | 0 | } |
368 | 0 | default: |
369 | 0 | { |
370 | 0 | return MsgNotKnown; |
371 | 0 | } |
372 | 0 | } |
373 | 0 | } |
374 | | |
375 | | auto PWebBrowserPersistDocumentChild::OnMessageReceived( |
376 | | const Message& msg__, |
377 | | Message*& reply__) -> PWebBrowserPersistDocumentChild::Result |
378 | 0 | { |
379 | 0 | return MsgNotKnown; |
380 | 0 | } |
381 | | |
382 | | auto PWebBrowserPersistDocumentChild::OnCallReceived( |
383 | | const Message& msg__, |
384 | | Message*& reply__) -> PWebBrowserPersistDocumentChild::Result |
385 | 0 | { |
386 | 0 | MOZ_ASSERT_UNREACHABLE("message protocol not supported"); |
387 | 0 | return MsgNotKnown; |
388 | 0 | } |
389 | | |
390 | | auto PWebBrowserPersistDocumentChild::GetProtocolTypeId() -> int32_t |
391 | 0 | { |
392 | 0 | return PWebBrowserPersistDocumentMsgStart; |
393 | 0 | } |
394 | | |
395 | | auto PWebBrowserPersistDocumentChild::DestroySubtree(ActorDestroyReason why) -> void |
396 | 0 | { |
397 | 0 | // Unregister from our manager. |
398 | 0 | Unregister(Id()); |
399 | 0 |
|
400 | 0 | ActorDestroyReason subtreewhy = (((why) == (Deletion)) || ((why) == (FailedConstructor)) ? AncestorDeletion : why); |
401 | 0 |
|
402 | 0 | { |
403 | 0 | // Recursively shutting down PWebBrowserPersistResources kids |
404 | 0 | nsTArray<PWebBrowserPersistResourcesChild*> kids; |
405 | 0 | // Accumulate kids into a stable structure to iterate over |
406 | 0 | ManagedPWebBrowserPersistResourcesChild(kids); |
407 | 0 | for (auto& kid : kids) { |
408 | 0 | // Guarding against a child removing a sibling from the list during the iteration. |
409 | 0 | if ((mManagedPWebBrowserPersistResourcesChild).Contains(kid)) { |
410 | 0 | (kid)->DestroySubtree(subtreewhy); |
411 | 0 | } |
412 | 0 | } |
413 | 0 | } |
414 | 0 | { |
415 | 0 | // Recursively shutting down PWebBrowserPersistSerialize kids |
416 | 0 | nsTArray<PWebBrowserPersistSerializeChild*> kids; |
417 | 0 | // Accumulate kids into a stable structure to iterate over |
418 | 0 | ManagedPWebBrowserPersistSerializeChild(kids); |
419 | 0 | for (auto& kid : kids) { |
420 | 0 | // Guarding against a child removing a sibling from the list during the iteration. |
421 | 0 | if ((mManagedPWebBrowserPersistSerializeChild).Contains(kid)) { |
422 | 0 | (kid)->DestroySubtree(subtreewhy); |
423 | 0 | } |
424 | 0 | } |
425 | 0 | } |
426 | 0 |
|
427 | 0 | // Reject owning pending responses. |
428 | 0 | (GetIPCChannel())->RejectPendingResponsesForActor(this); |
429 | 0 |
|
430 | 0 | // Finally, destroy "us". |
431 | 0 | ActorDestroy(why); |
432 | 0 | } |
433 | | |
434 | | auto PWebBrowserPersistDocumentChild::DeallocSubtree() -> void |
435 | 0 | { |
436 | 0 | { |
437 | 0 | // Recursively deleting PWebBrowserPersistResources kids |
438 | 0 | for (auto iter = (mManagedPWebBrowserPersistResourcesChild).Iter(); (!((iter).Done())); (iter).Next()) { |
439 | 0 | (((iter).Get())->GetKey())->DeallocSubtree(); |
440 | 0 | } |
441 | 0 |
|
442 | 0 | for (auto iter = (mManagedPWebBrowserPersistResourcesChild).Iter(); (!((iter).Done())); (iter).Next()) { |
443 | 0 | DeallocPWebBrowserPersistResourcesChild(((iter).Get())->GetKey()); |
444 | 0 | } |
445 | 0 | (mManagedPWebBrowserPersistResourcesChild).Clear(); |
446 | 0 | } |
447 | 0 | { |
448 | 0 | // Recursively deleting PWebBrowserPersistSerialize kids |
449 | 0 | for (auto iter = (mManagedPWebBrowserPersistSerializeChild).Iter(); (!((iter).Done())); (iter).Next()) { |
450 | 0 | (((iter).Get())->GetKey())->DeallocSubtree(); |
451 | 0 | } |
452 | 0 |
|
453 | 0 | for (auto iter = (mManagedPWebBrowserPersistSerializeChild).Iter(); (!((iter).Done())); (iter).Next()) { |
454 | 0 | DeallocPWebBrowserPersistSerializeChild(((iter).Get())->GetKey()); |
455 | 0 | } |
456 | 0 | (mManagedPWebBrowserPersistSerializeChild).Clear(); |
457 | 0 | } |
458 | 0 | } |
459 | | |
460 | | |
461 | | |
462 | | } // namespace mozilla |
463 | | namespace mozilla { |
464 | | namespace ipc { |
465 | | auto IPDLParamTraits<mozilla::PWebBrowserPersistDocumentChild>::Write( |
466 | | IPC::Message* aMsg, |
467 | | mozilla::ipc::IProtocol* aActor, |
468 | | const paramType& aVar) -> void |
469 | 0 | { |
470 | 0 | int32_t id; |
471 | 0 | if ((!(aVar))) { |
472 | 0 | id = 0; |
473 | 0 | } |
474 | 0 | else { |
475 | 0 | id = (aVar)->Id(); |
476 | 0 | if ((1) == (id)) { |
477 | 0 | (aActor)->FatalError("actor has been |delete|d"); |
478 | 0 | } |
479 | 0 | } |
480 | 0 | WriteIPDLParam(aMsg, aActor, id); |
481 | 0 | } |
482 | | |
483 | | auto IPDLParamTraits<mozilla::PWebBrowserPersistDocumentChild>::Read( |
484 | | const IPC::Message* aMsg, |
485 | | PickleIterator* aIter, |
486 | | mozilla::ipc::IProtocol* aActor, |
487 | | paramType* aVar) -> bool |
488 | 0 | { |
489 | 0 | mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PWebBrowserPersistDocument", PWebBrowserPersistDocumentMsgStart); |
490 | 0 | if ((actor).isNothing()) { |
491 | 0 | return false; |
492 | 0 | } |
493 | 0 | |
494 | 0 | (*(aVar)) = static_cast<mozilla::PWebBrowserPersistDocumentChild*>((actor).value()); |
495 | 0 | return true; |
496 | 0 | } |
497 | | |
498 | | } // namespace ipc |
499 | | } // namespace mozilla |