/work/obj-fuzz/ipc/ipdl/PImageBridgeParent.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/layers/PImageBridgeParent.h" |
8 | | #include "mozilla/layers/CompositorTypes.h" |
9 | | |
10 | | #include "mozilla/layers/PTextureParent.h" |
11 | | #include "mozilla/media/PMediaSystemResourceManagerParent.h" |
12 | | |
13 | | #include "nsIFile.h" |
14 | | #include "GeckoProfiler.h" |
15 | | |
16 | | namespace mozilla { |
17 | | namespace layers { |
18 | | |
19 | | |
20 | | auto PImageBridgeParent::RecvPTextureConstructor( |
21 | | PTextureParent* actor, |
22 | | const SurfaceDescriptor& aSharedData, |
23 | | const ReadLockDescriptor& aReadLock, |
24 | | const LayersBackend& aBackend, |
25 | | const TextureFlags& aTextureFlags, |
26 | | const uint64_t& aSerial, |
27 | | const MaybeExternalImageId& aExternalImageId) -> mozilla::ipc::IPCResult |
28 | 0 | { |
29 | 0 | return IPC_OK(); |
30 | 0 | } |
31 | | |
32 | | auto PImageBridgeParent::RecvPMediaSystemResourceManagerConstructor(PMediaSystemResourceManagerParent* actor) -> mozilla::ipc::IPCResult |
33 | 0 | { |
34 | 0 | return IPC_OK(); |
35 | 0 | } |
36 | | |
37 | | auto PImageBridgeParent::ActorDestroy(ActorDestroyReason aWhy) -> void |
38 | 0 | { |
39 | 0 | } |
40 | | |
41 | | auto PImageBridgeParent::ProcessingError( |
42 | | Result aCode, |
43 | | const char* aReason) -> void |
44 | 0 | { |
45 | 0 | } |
46 | | |
47 | | auto PImageBridgeParent::ShouldContinueFromReplyTimeout() -> bool |
48 | 0 | { |
49 | 0 | return true; |
50 | 0 | } |
51 | | |
52 | | auto PImageBridgeParent::EnteredCxxStack() -> void |
53 | 0 | { |
54 | 0 | } |
55 | | |
56 | | auto PImageBridgeParent::ExitedCxxStack() -> void |
57 | 0 | { |
58 | 0 | } |
59 | | |
60 | | auto PImageBridgeParent::EnteredCall() -> void |
61 | 0 | { |
62 | 0 | } |
63 | | |
64 | | auto PImageBridgeParent::ExitedCall() -> void |
65 | 0 | { |
66 | 0 | } |
67 | | |
68 | | MOZ_IMPLICIT PImageBridgeParent::PImageBridgeParent() : |
69 | | mozilla::ipc::IToplevelProtocol("PImageBridgeParent", PImageBridgeMsgStart, mozilla::ipc::ParentSide), |
70 | | mLivenessState(mozilla::ipc::LivenessState::Start) |
71 | 0 | { |
72 | 0 | MOZ_COUNT_CTOR(PImageBridgeParent); |
73 | 0 | } |
74 | | |
75 | | PImageBridgeParent::~PImageBridgeParent() |
76 | 0 | { |
77 | 0 | MOZ_COUNT_DTOR(PImageBridgeParent); |
78 | 0 | } |
79 | | |
80 | | auto PImageBridgeParent::ManagedPTextureParent(nsTArray<PTextureParent*>& aArr) const -> void |
81 | 0 | { |
82 | 0 | (mManagedPTextureParent).ToArray(aArr); |
83 | 0 | } |
84 | | |
85 | | auto PImageBridgeParent::ManagedPTextureParent() const -> const ManagedContainer<PTextureParent>& |
86 | 0 | { |
87 | 0 | return mManagedPTextureParent; |
88 | 0 | } |
89 | | |
90 | | auto PImageBridgeParent::ManagedPMediaSystemResourceManagerParent(nsTArray<PMediaSystemResourceManagerParent*>& aArr) const -> void |
91 | 0 | { |
92 | 0 | (mManagedPMediaSystemResourceManagerParent).ToArray(aArr); |
93 | 0 | } |
94 | | |
95 | | auto PImageBridgeParent::ManagedPMediaSystemResourceManagerParent() const -> const ManagedContainer<PMediaSystemResourceManagerParent>& |
96 | 0 | { |
97 | 0 | return mManagedPMediaSystemResourceManagerParent; |
98 | 0 | } |
99 | | |
100 | | auto PImageBridgeParent::SendParentAsyncMessages(const nsTArray<AsyncParentMessageData>& aMessages) -> bool |
101 | 0 | { |
102 | 0 | IPC::Message* msg__ = PImageBridge::Msg_ParentAsyncMessages(MSG_ROUTING_CONTROL); |
103 | 0 |
|
104 | 0 | WriteIPDLParam(msg__, this, aMessages); |
105 | 0 | // Sentinel = 'aMessages' |
106 | 0 | (msg__)->WriteSentinel(1923086976); |
107 | 0 |
|
108 | 0 |
|
109 | 0 |
|
110 | 0 |
|
111 | 0 | if (mozilla::ipc::LoggingEnabledFor("PImageBridgeParent")) { |
112 | 0 | mozilla::ipc::LogMessageForProtocol("PImageBridgeParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
113 | 0 | } |
114 | 0 | AUTO_PROFILER_LABEL("PImageBridge::Msg_ParentAsyncMessages", OTHER); |
115 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
116 | 0 | mozilla::ipc::LogicError("Transition error"); |
117 | 0 | } |
118 | 0 |
|
119 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
120 | 0 | return sendok__; |
121 | 0 | } |
122 | | |
123 | | auto PImageBridgeParent::SendDidComposite(const nsTArray<ImageCompositeNotification>& aNotifications) -> bool |
124 | 0 | { |
125 | 0 | IPC::Message* msg__ = PImageBridge::Msg_DidComposite(MSG_ROUTING_CONTROL); |
126 | 0 |
|
127 | 0 | WriteIPDLParam(msg__, this, aNotifications); |
128 | 0 | // Sentinel = 'aNotifications' |
129 | 0 | (msg__)->WriteSentinel(3779889553); |
130 | 0 |
|
131 | 0 |
|
132 | 0 |
|
133 | 0 |
|
134 | 0 | if (mozilla::ipc::LoggingEnabledFor("PImageBridgeParent")) { |
135 | 0 | mozilla::ipc::LogMessageForProtocol("PImageBridgeParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
136 | 0 | } |
137 | 0 | AUTO_PROFILER_LABEL("PImageBridge::Msg_DidComposite", OTHER); |
138 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
139 | 0 | mozilla::ipc::LogicError("Transition error"); |
140 | 0 | } |
141 | 0 |
|
142 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
143 | 0 | return sendok__; |
144 | 0 | } |
145 | | |
146 | | auto PImageBridgeParent::SendReportFramesDropped( |
147 | | const CompositableHandle& aHandle, |
148 | | const uint32_t& aFrames) -> bool |
149 | 0 | { |
150 | 0 | IPC::Message* msg__ = PImageBridge::Msg_ReportFramesDropped(MSG_ROUTING_CONTROL); |
151 | 0 |
|
152 | 0 | WriteIPDLParam(msg__, this, aHandle); |
153 | 0 | // Sentinel = 'aHandle' |
154 | 0 | (msg__)->WriteSentinel(2892339440); |
155 | 0 | WriteIPDLParam(msg__, this, aFrames); |
156 | 0 | // Sentinel = 'aFrames' |
157 | 0 | (msg__)->WriteSentinel(2222820396); |
158 | 0 |
|
159 | 0 |
|
160 | 0 |
|
161 | 0 |
|
162 | 0 | if (mozilla::ipc::LoggingEnabledFor("PImageBridgeParent")) { |
163 | 0 | mozilla::ipc::LogMessageForProtocol("PImageBridgeParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
164 | 0 | } |
165 | 0 | AUTO_PROFILER_LABEL("PImageBridge::Msg_ReportFramesDropped", 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 PImageBridgeParent::RemoveManagee( |
175 | | int32_t aProtocolId, |
176 | | IProtocol* aListener) -> void |
177 | 0 | { |
178 | 0 | switch (aProtocolId) { |
179 | 0 | case PTextureMsgStart: |
180 | 0 | { |
181 | 0 | PTextureParent* actor = static_cast<PTextureParent*>(aListener); |
182 | 0 | auto& container = mManagedPTextureParent; |
183 | 0 | MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!"); |
184 | 0 |
|
185 | 0 | (container).RemoveEntry(actor); |
186 | 0 | DeallocPTextureParent(actor); |
187 | 0 | return; |
188 | 0 | } |
189 | 0 | case PMediaSystemResourceManagerMsgStart: |
190 | 0 | { |
191 | 0 | PMediaSystemResourceManagerParent* actor = static_cast<PMediaSystemResourceManagerParent*>(aListener); |
192 | 0 | auto& container = mManagedPMediaSystemResourceManagerParent; |
193 | 0 | MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!"); |
194 | 0 |
|
195 | 0 | (container).RemoveEntry(actor); |
196 | 0 | DeallocPMediaSystemResourceManagerParent(actor); |
197 | 0 | return; |
198 | 0 | } |
199 | 0 | default: |
200 | 0 | { |
201 | 0 | FatalError("unreached"); |
202 | 0 | return; |
203 | 0 | } |
204 | 0 | } |
205 | 0 | } |
206 | | |
207 | | auto PImageBridgeParent::OnMessageReceived(const Message& msg__) -> PImageBridgeParent::Result |
208 | 0 | { |
209 | 0 | int32_t route__ = (msg__).routing_id(); |
210 | 0 | if ((MSG_ROUTING_CONTROL) != (route__)) { |
211 | 0 | IProtocol* routed__ = Lookup(route__); |
212 | 0 | if ((!(routed__))) { |
213 | 0 | return MsgRouteError; |
214 | 0 | } |
215 | 0 | return (routed__)->OnMessageReceived(msg__); |
216 | 0 | } |
217 | 0 | |
218 | 0 | switch ((msg__).type()) { |
219 | 0 | case PImageBridge::Msg_Update__ID: |
220 | 0 | { |
221 | 0 | if (mozilla::ipc::LoggingEnabledFor("PImageBridgeParent")) { |
222 | 0 | mozilla::ipc::LogMessageForProtocol("PImageBridgeParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
223 | 0 | } |
224 | 0 | AUTO_PROFILER_LABEL("PImageBridge::Msg_Update", OTHER); |
225 | 0 |
|
226 | 0 | PickleIterator iter__(msg__); |
227 | 0 | nsTArray<CompositableOperation> ops; |
228 | 0 | nsTArray<OpDestroy> toDestroy; |
229 | 0 | uint64_t fwdTransactionId; |
230 | 0 |
|
231 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(ops)))))) { |
232 | 0 | FatalError("Error deserializing 'nsTArray'"); |
233 | 0 | return MsgValueError; |
234 | 0 | } |
235 | 0 | // Sentinel = 'ops' |
236 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4059743815)))) { |
237 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'"); |
238 | 0 | return MsgValueError; |
239 | 0 | } |
240 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(toDestroy)))))) { |
241 | 0 | FatalError("Error deserializing 'nsTArray'"); |
242 | 0 | return MsgValueError; |
243 | 0 | } |
244 | 0 | // Sentinel = 'toDestroy' |
245 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4183172130)))) { |
246 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'"); |
247 | 0 | return MsgValueError; |
248 | 0 | } |
249 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(fwdTransactionId)))))) { |
250 | 0 | FatalError("Error deserializing 'uint64_t'"); |
251 | 0 | return MsgValueError; |
252 | 0 | } |
253 | 0 | // Sentinel = 'fwdTransactionId' |
254 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2023976742)))) { |
255 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'"); |
256 | 0 | return MsgValueError; |
257 | 0 | } |
258 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
259 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
260 | 0 | FatalError("Transition error"); |
261 | 0 | return MsgValueError; |
262 | 0 | } |
263 | 0 | if ((!(RecvUpdate(std::move(ops), std::move(toDestroy), fwdTransactionId)))) { |
264 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
265 | 0 | // Error handled in mozilla::ipc::IPCResult |
266 | 0 | return MsgProcessingError; |
267 | 0 | } |
268 | 0 | |
269 | 0 | return MsgProcessed; |
270 | 0 | } |
271 | 0 | case PImageBridge::Msg_PTextureConstructor__ID: |
272 | 0 | { |
273 | 0 | if (mozilla::ipc::LoggingEnabledFor("PImageBridgeParent")) { |
274 | 0 | mozilla::ipc::LogMessageForProtocol("PImageBridgeParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
275 | 0 | } |
276 | 0 | AUTO_PROFILER_LABEL("PImageBridge::Msg_PTextureConstructor", OTHER); |
277 | 0 |
|
278 | 0 | PickleIterator iter__(msg__); |
279 | 0 | ActorHandle handle__; |
280 | 0 | PTextureParent* actor; |
281 | 0 | SurfaceDescriptor aSharedData; |
282 | 0 | ReadLockDescriptor aReadLock; |
283 | 0 | LayersBackend aBackend; |
284 | 0 | TextureFlags aTextureFlags; |
285 | 0 | uint64_t aSerial; |
286 | 0 | MaybeExternalImageId aExternalImageId; |
287 | 0 |
|
288 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(handle__)))))) { |
289 | 0 | FatalError("Error deserializing 'ActorHandle'"); |
290 | 0 | return MsgValueError; |
291 | 0 | } |
292 | 0 | // Sentinel = 'actor' |
293 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) { |
294 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'"); |
295 | 0 | return MsgValueError; |
296 | 0 | } |
297 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aSharedData)))))) { |
298 | 0 | FatalError("Error deserializing 'SurfaceDescriptor'"); |
299 | 0 | return MsgValueError; |
300 | 0 | } |
301 | 0 | // Sentinel = 'aSharedData' |
302 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3013593029)))) { |
303 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'SurfaceDescriptor'"); |
304 | 0 | return MsgValueError; |
305 | 0 | } |
306 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aReadLock)))))) { |
307 | 0 | FatalError("Error deserializing 'ReadLockDescriptor'"); |
308 | 0 | return MsgValueError; |
309 | 0 | } |
310 | 0 | // Sentinel = 'aReadLock' |
311 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1208527801)))) { |
312 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'ReadLockDescriptor'"); |
313 | 0 | return MsgValueError; |
314 | 0 | } |
315 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aBackend)))))) { |
316 | 0 | FatalError("Error deserializing 'LayersBackend'"); |
317 | 0 | return MsgValueError; |
318 | 0 | } |
319 | 0 | // Sentinel = 'aBackend' |
320 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2878499283)))) { |
321 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'LayersBackend'"); |
322 | 0 | return MsgValueError; |
323 | 0 | } |
324 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aTextureFlags)))))) { |
325 | 0 | FatalError("Error deserializing 'TextureFlags'"); |
326 | 0 | return MsgValueError; |
327 | 0 | } |
328 | 0 | // Sentinel = 'aTextureFlags' |
329 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3005687826)))) { |
330 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'TextureFlags'"); |
331 | 0 | return MsgValueError; |
332 | 0 | } |
333 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aSerial)))))) { |
334 | 0 | FatalError("Error deserializing 'uint64_t'"); |
335 | 0 | return MsgValueError; |
336 | 0 | } |
337 | 0 | // Sentinel = 'aSerial' |
338 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1247987114)))) { |
339 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'"); |
340 | 0 | return MsgValueError; |
341 | 0 | } |
342 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aExternalImageId)))))) { |
343 | 0 | FatalError("Error deserializing 'MaybeExternalImageId'"); |
344 | 0 | return MsgValueError; |
345 | 0 | } |
346 | 0 | // Sentinel = 'aExternalImageId' |
347 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2889998824)))) { |
348 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'MaybeExternalImageId'"); |
349 | 0 | return MsgValueError; |
350 | 0 | } |
351 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
352 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
353 | 0 | FatalError("Transition error"); |
354 | 0 | return MsgValueError; |
355 | 0 | } |
356 | 0 | actor = AllocPTextureParent(aSharedData, aReadLock, aBackend, aTextureFlags, aSerial, aExternalImageId); |
357 | 0 | if ((!(actor))) { |
358 | 0 | NS_WARNING("Error constructing actor PTextureParent"); |
359 | 0 | return MsgValueError; |
360 | 0 | } |
361 | 0 | (actor)->SetManagerAndRegister(this, (handle__).mId); |
362 | 0 | (mManagedPTextureParent).PutEntry(actor); |
363 | 0 | (actor)->mLivenessState = mozilla::ipc::LivenessState::Start; |
364 | 0 |
|
365 | 0 | if ((!(RecvPTextureConstructor(actor, aSharedData, aReadLock, aBackend, aTextureFlags, aSerial, aExternalImageId)))) { |
366 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
367 | 0 | // Error handled in mozilla::ipc::IPCResult |
368 | 0 | return MsgProcessingError; |
369 | 0 | } |
370 | 0 | |
371 | 0 | return MsgProcessed; |
372 | 0 | } |
373 | 0 | case PImageBridge::Msg_PMediaSystemResourceManagerConstructor__ID: |
374 | 0 | { |
375 | 0 | if (mozilla::ipc::LoggingEnabledFor("PImageBridgeParent")) { |
376 | 0 | mozilla::ipc::LogMessageForProtocol("PImageBridgeParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
377 | 0 | } |
378 | 0 | AUTO_PROFILER_LABEL("PImageBridge::Msg_PMediaSystemResourceManagerConstructor", OTHER); |
379 | 0 |
|
380 | 0 | PickleIterator iter__(msg__); |
381 | 0 | ActorHandle handle__; |
382 | 0 | PMediaSystemResourceManagerParent* actor; |
383 | 0 |
|
384 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(handle__)))))) { |
385 | 0 | FatalError("Error deserializing 'ActorHandle'"); |
386 | 0 | return MsgValueError; |
387 | 0 | } |
388 | 0 | // Sentinel = 'actor' |
389 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) { |
390 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'"); |
391 | 0 | return MsgValueError; |
392 | 0 | } |
393 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
394 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
395 | 0 | FatalError("Transition error"); |
396 | 0 | return MsgValueError; |
397 | 0 | } |
398 | 0 | actor = AllocPMediaSystemResourceManagerParent(); |
399 | 0 | if ((!(actor))) { |
400 | 0 | NS_WARNING("Error constructing actor PMediaSystemResourceManagerParent"); |
401 | 0 | return MsgValueError; |
402 | 0 | } |
403 | 0 | (actor)->SetManagerAndRegister(this, (handle__).mId); |
404 | 0 | (mManagedPMediaSystemResourceManagerParent).PutEntry(actor); |
405 | 0 | (actor)->mLivenessState = mozilla::ipc::LivenessState::Start; |
406 | 0 |
|
407 | 0 | if ((!(RecvPMediaSystemResourceManagerConstructor(actor)))) { |
408 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
409 | 0 | // Error handled in mozilla::ipc::IPCResult |
410 | 0 | return MsgProcessingError; |
411 | 0 | } |
412 | 0 | |
413 | 0 | return MsgProcessed; |
414 | 0 | } |
415 | 0 | case PImageBridge::Msg_ReleaseCompositable__ID: |
416 | 0 | { |
417 | 0 | if (mozilla::ipc::LoggingEnabledFor("PImageBridgeParent")) { |
418 | 0 | mozilla::ipc::LogMessageForProtocol("PImageBridgeParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
419 | 0 | } |
420 | 0 | AUTO_PROFILER_LABEL("PImageBridge::Msg_ReleaseCompositable", OTHER); |
421 | 0 |
|
422 | 0 | PickleIterator iter__(msg__); |
423 | 0 | CompositableHandle aHandle; |
424 | 0 |
|
425 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aHandle)))))) { |
426 | 0 | FatalError("Error deserializing 'CompositableHandle'"); |
427 | 0 | return MsgValueError; |
428 | 0 | } |
429 | 0 | // Sentinel = 'aHandle' |
430 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2892339440)))) { |
431 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'CompositableHandle'"); |
432 | 0 | return MsgValueError; |
433 | 0 | } |
434 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
435 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
436 | 0 | FatalError("Transition error"); |
437 | 0 | return MsgValueError; |
438 | 0 | } |
439 | 0 | if ((!(RecvReleaseCompositable(aHandle)))) { |
440 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
441 | 0 | // Error handled in mozilla::ipc::IPCResult |
442 | 0 | return MsgProcessingError; |
443 | 0 | } |
444 | 0 | |
445 | 0 | return MsgProcessed; |
446 | 0 | } |
447 | 0 | default: |
448 | 0 | { |
449 | 0 | return MsgNotKnown; |
450 | 0 | } |
451 | 0 | case SHMEM_CREATED_MESSAGE_TYPE: |
452 | 0 | { |
453 | 0 | if ((!(ShmemCreated(msg__)))) { |
454 | 0 | return MsgPayloadError; |
455 | 0 | } |
456 | 0 | return MsgProcessed; |
457 | 0 | } |
458 | 0 | case SHMEM_DESTROYED_MESSAGE_TYPE: |
459 | 0 | { |
460 | 0 | if ((!(ShmemDestroyed(msg__)))) { |
461 | 0 | return MsgPayloadError; |
462 | 0 | } |
463 | 0 | return MsgProcessed; |
464 | 0 | } |
465 | 0 | } |
466 | 0 | } |
467 | | |
468 | | auto PImageBridgeParent::OnMessageReceived( |
469 | | const Message& msg__, |
470 | | Message*& reply__) -> PImageBridgeParent::Result |
471 | 0 | { |
472 | 0 | int32_t route__ = (msg__).routing_id(); |
473 | 0 | if ((MSG_ROUTING_CONTROL) != (route__)) { |
474 | 0 | IProtocol* routed__ = Lookup(route__); |
475 | 0 | if ((!(routed__))) { |
476 | 0 | return MsgRouteError; |
477 | 0 | } |
478 | 0 | return (routed__)->OnMessageReceived(msg__, reply__); |
479 | 0 | } |
480 | 0 | |
481 | 0 | switch ((msg__).type()) { |
482 | 0 | case PImageBridge::Msg_WillClose__ID: |
483 | 0 | { |
484 | 0 | if (mozilla::ipc::LoggingEnabledFor("PImageBridgeParent")) { |
485 | 0 | mozilla::ipc::LogMessageForProtocol("PImageBridgeParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
486 | 0 | } |
487 | 0 | AUTO_PROFILER_LABEL("PImageBridge::Msg_WillClose", OTHER); |
488 | 0 |
|
489 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
490 | 0 | FatalError("Transition error"); |
491 | 0 | return MsgValueError; |
492 | 0 | } |
493 | 0 | int32_t id__ = MSG_ROUTING_CONTROL; |
494 | 0 | if ((!(RecvWillClose()))) { |
495 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
496 | 0 | // Error handled in mozilla::ipc::IPCResult |
497 | 0 | return MsgProcessingError; |
498 | 0 | } |
499 | 0 | |
500 | 0 | reply__ = PImageBridge::Reply_WillClose(id__); |
501 | 0 |
|
502 | 0 |
|
503 | 0 | if (mozilla::ipc::LoggingEnabledFor("PImageBridgeParent")) { |
504 | 0 | mozilla::ipc::LogMessageForProtocol("PImageBridgeParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending); |
505 | 0 | } |
506 | 0 | return MsgProcessed; |
507 | 0 | } |
508 | 0 | case PImageBridge::Msg_NewCompositable__ID: |
509 | 0 | { |
510 | 0 | if (mozilla::ipc::LoggingEnabledFor("PImageBridgeParent")) { |
511 | 0 | mozilla::ipc::LogMessageForProtocol("PImageBridgeParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
512 | 0 | } |
513 | 0 | AUTO_PROFILER_LABEL("PImageBridge::Msg_NewCompositable", OTHER); |
514 | 0 |
|
515 | 0 | PickleIterator iter__(msg__); |
516 | 0 | CompositableHandle aHandle; |
517 | 0 | TextureInfo aInfo; |
518 | 0 | LayersBackend aBackend; |
519 | 0 |
|
520 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aHandle)))))) { |
521 | 0 | FatalError("Error deserializing 'CompositableHandle'"); |
522 | 0 | return MsgValueError; |
523 | 0 | } |
524 | 0 | // Sentinel = 'aHandle' |
525 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2892339440)))) { |
526 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'CompositableHandle'"); |
527 | 0 | return MsgValueError; |
528 | 0 | } |
529 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aInfo)))))) { |
530 | 0 | FatalError("Error deserializing 'TextureInfo'"); |
531 | 0 | return MsgValueError; |
532 | 0 | } |
533 | 0 | // Sentinel = 'aInfo' |
534 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3826123752)))) { |
535 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'TextureInfo'"); |
536 | 0 | return MsgValueError; |
537 | 0 | } |
538 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aBackend)))))) { |
539 | 0 | FatalError("Error deserializing 'LayersBackend'"); |
540 | 0 | return MsgValueError; |
541 | 0 | } |
542 | 0 | // Sentinel = 'aBackend' |
543 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2878499283)))) { |
544 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'LayersBackend'"); |
545 | 0 | return MsgValueError; |
546 | 0 | } |
547 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
548 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
549 | 0 | FatalError("Transition error"); |
550 | 0 | return MsgValueError; |
551 | 0 | } |
552 | 0 | int32_t id__ = MSG_ROUTING_CONTROL; |
553 | 0 | if ((!(RecvNewCompositable(aHandle, aInfo, aBackend)))) { |
554 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
555 | 0 | // Error handled in mozilla::ipc::IPCResult |
556 | 0 | return MsgProcessingError; |
557 | 0 | } |
558 | 0 | |
559 | 0 | reply__ = PImageBridge::Reply_NewCompositable(id__); |
560 | 0 |
|
561 | 0 |
|
562 | 0 | if (mozilla::ipc::LoggingEnabledFor("PImageBridgeParent")) { |
563 | 0 | mozilla::ipc::LogMessageForProtocol("PImageBridgeParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending); |
564 | 0 | } |
565 | 0 | return MsgProcessed; |
566 | 0 | } |
567 | 0 | default: |
568 | 0 | { |
569 | 0 | return MsgNotKnown; |
570 | 0 | } |
571 | 0 | } |
572 | 0 | } |
573 | | |
574 | | auto PImageBridgeParent::OnCallReceived( |
575 | | const Message& msg__, |
576 | | Message*& reply__) -> PImageBridgeParent::Result |
577 | 0 | { |
578 | 0 | MOZ_ASSERT_UNREACHABLE("message protocol not supported"); |
579 | 0 | return MsgNotKnown; |
580 | 0 | } |
581 | | |
582 | | auto PImageBridgeParent::GetProtocolTypeId() -> int32_t |
583 | 0 | { |
584 | 0 | return PImageBridgeMsgStart; |
585 | 0 | } |
586 | | |
587 | | auto PImageBridgeParent::OnChannelClose() -> void |
588 | 0 | { |
589 | 0 | DestroySubtree(NormalShutdown); |
590 | 0 | DeallocSubtree(); |
591 | 0 | DeallocShmems(); |
592 | 0 | DeallocPImageBridgeParent(); |
593 | 0 | } |
594 | | |
595 | | auto PImageBridgeParent::OnChannelError() -> void |
596 | 0 | { |
597 | 0 | DestroySubtree(AbnormalShutdown); |
598 | 0 | DeallocSubtree(); |
599 | 0 | DeallocShmems(); |
600 | 0 | DeallocPImageBridgeParent(); |
601 | 0 | } |
602 | | |
603 | | auto PImageBridgeParent::DestroySubtree(ActorDestroyReason why) -> void |
604 | 0 | { |
605 | 0 | ActorDestroyReason subtreewhy = (((why) == (Deletion)) || ((why) == (FailedConstructor)) ? AncestorDeletion : why); |
606 | 0 |
|
607 | 0 | { |
608 | 0 | // Recursively shutting down PTexture kids |
609 | 0 | nsTArray<PTextureParent*> kids; |
610 | 0 | // Accumulate kids into a stable structure to iterate over |
611 | 0 | ManagedPTextureParent(kids); |
612 | 0 | for (auto& kid : kids) { |
613 | 0 | // Guarding against a child removing a sibling from the list during the iteration. |
614 | 0 | if ((mManagedPTextureParent).Contains(kid)) { |
615 | 0 | (kid)->DestroySubtree(subtreewhy); |
616 | 0 | } |
617 | 0 | } |
618 | 0 | } |
619 | 0 | { |
620 | 0 | // Recursively shutting down PMediaSystemResourceManager kids |
621 | 0 | nsTArray<PMediaSystemResourceManagerParent*> kids; |
622 | 0 | // Accumulate kids into a stable structure to iterate over |
623 | 0 | ManagedPMediaSystemResourceManagerParent(kids); |
624 | 0 | for (auto& kid : kids) { |
625 | 0 | // Guarding against a child removing a sibling from the list during the iteration. |
626 | 0 | if ((mManagedPMediaSystemResourceManagerParent).Contains(kid)) { |
627 | 0 | (kid)->DestroySubtree(subtreewhy); |
628 | 0 | } |
629 | 0 | } |
630 | 0 | } |
631 | 0 |
|
632 | 0 | // Reject owning pending responses. |
633 | 0 | (GetIPCChannel())->RejectPendingResponsesForActor(this); |
634 | 0 |
|
635 | 0 | // Finally, destroy "us". |
636 | 0 | ActorDestroy(why); |
637 | 0 | } |
638 | | |
639 | | auto PImageBridgeParent::DeallocSubtree() -> void |
640 | 0 | { |
641 | 0 | { |
642 | 0 | // Recursively deleting PTexture kids |
643 | 0 | for (auto iter = (mManagedPTextureParent).Iter(); (!((iter).Done())); (iter).Next()) { |
644 | 0 | (((iter).Get())->GetKey())->DeallocSubtree(); |
645 | 0 | } |
646 | 0 |
|
647 | 0 | for (auto iter = (mManagedPTextureParent).Iter(); (!((iter).Done())); (iter).Next()) { |
648 | 0 | DeallocPTextureParent(((iter).Get())->GetKey()); |
649 | 0 | } |
650 | 0 | (mManagedPTextureParent).Clear(); |
651 | 0 | } |
652 | 0 | { |
653 | 0 | // Recursively deleting PMediaSystemResourceManager kids |
654 | 0 | for (auto iter = (mManagedPMediaSystemResourceManagerParent).Iter(); (!((iter).Done())); (iter).Next()) { |
655 | 0 | (((iter).Get())->GetKey())->DeallocSubtree(); |
656 | 0 | } |
657 | 0 |
|
658 | 0 | for (auto iter = (mManagedPMediaSystemResourceManagerParent).Iter(); (!((iter).Done())); (iter).Next()) { |
659 | 0 | DeallocPMediaSystemResourceManagerParent(((iter).Get())->GetKey()); |
660 | 0 | } |
661 | 0 | (mManagedPMediaSystemResourceManagerParent).Clear(); |
662 | 0 | } |
663 | 0 | } |
664 | | |
665 | | auto PImageBridgeParent::DeallocPImageBridgeParent() -> void |
666 | 0 | { |
667 | 0 | } |
668 | | |
669 | | |
670 | | |
671 | | } // namespace layers |
672 | | } // namespace mozilla |
673 | | namespace mozilla { |
674 | | namespace ipc { |
675 | | auto IPDLParamTraits<mozilla::layers::PImageBridgeParent>::Write( |
676 | | IPC::Message* aMsg, |
677 | | mozilla::ipc::IProtocol* aActor, |
678 | | const paramType& aVar) -> void |
679 | 0 | { |
680 | 0 | int32_t id; |
681 | 0 | if ((!(aVar))) { |
682 | 0 | id = 0; |
683 | 0 | } |
684 | 0 | else { |
685 | 0 | id = (aVar)->Id(); |
686 | 0 | if ((1) == (id)) { |
687 | 0 | (aActor)->FatalError("actor has been |delete|d"); |
688 | 0 | } |
689 | 0 | } |
690 | 0 | WriteIPDLParam(aMsg, aActor, id); |
691 | 0 | } |
692 | | |
693 | | auto IPDLParamTraits<mozilla::layers::PImageBridgeParent>::Read( |
694 | | const IPC::Message* aMsg, |
695 | | PickleIterator* aIter, |
696 | | mozilla::ipc::IProtocol* aActor, |
697 | | paramType* aVar) -> bool |
698 | 0 | { |
699 | 0 | mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PImageBridge", PImageBridgeMsgStart); |
700 | 0 | if ((actor).isNothing()) { |
701 | 0 | return false; |
702 | 0 | } |
703 | 0 | |
704 | 0 | (*(aVar)) = static_cast<mozilla::layers::PImageBridgeParent*>((actor).value()); |
705 | 0 | return true; |
706 | 0 | } |
707 | | |
708 | | } // namespace ipc |
709 | | } // namespace mozilla |