Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/gmp/PGMPContentChild.h"
8 : #ifdef MOZ_CRASHREPORTER
9 : # include "nsXULAppAPI.h"
10 : #endif
11 :
12 : #include "mozilla/gmp/PGMPVideoDecoderChild.h"
13 : #include "mozilla/gmp/PGMPVideoEncoderChild.h"
14 : #include "mozilla/gmp/PGMPDecryptorChild.h"
15 : #include "mozilla/gmp/PChromiumCDMChild.h"
16 :
17 : #include "nsIFile.h"
18 : #include "GeckoProfiler.h"
19 :
20 : namespace mozilla {
21 : namespace gmp {
22 :
23 :
24 0 : auto PGMPContentChild::RecvPGMPDecryptorConstructor(PGMPDecryptorChild* actor) -> mozilla::ipc::IPCResult
25 : {
26 0 : return IPC_OK();
27 : }
28 :
29 0 : auto PGMPContentChild::RecvPGMPVideoDecoderConstructor(
30 : PGMPVideoDecoderChild* actor,
31 : const uint32_t& aDecryptorId) -> mozilla::ipc::IPCResult
32 : {
33 0 : return IPC_OK();
34 : }
35 :
36 0 : auto PGMPContentChild::RecvPGMPVideoEncoderConstructor(PGMPVideoEncoderChild* actor) -> mozilla::ipc::IPCResult
37 : {
38 0 : return IPC_OK();
39 : }
40 :
41 0 : auto PGMPContentChild::RecvPChromiumCDMConstructor(PChromiumCDMChild* actor) -> mozilla::ipc::IPCResult
42 : {
43 0 : return IPC_OK();
44 : }
45 :
46 0 : auto PGMPContentChild::ActorDestroy(ActorDestroyReason aWhy) -> void
47 : {
48 0 : }
49 :
50 0 : auto PGMPContentChild::ProcessingError(
51 : Result aCode,
52 : const char* aReason) -> void
53 : {
54 0 : }
55 :
56 0 : auto PGMPContentChild::ShouldContinueFromReplyTimeout() -> bool
57 : {
58 0 : return true;
59 : }
60 :
61 0 : auto PGMPContentChild::EnteredCxxStack() -> void
62 : {
63 0 : }
64 :
65 0 : auto PGMPContentChild::ExitedCxxStack() -> void
66 : {
67 0 : }
68 :
69 0 : auto PGMPContentChild::EnteredCall() -> void
70 : {
71 0 : }
72 :
73 0 : auto PGMPContentChild::ExitedCall() -> void
74 : {
75 0 : }
76 :
77 0 : MOZ_IMPLICIT PGMPContentChild::PGMPContentChild() :
78 : mozilla::ipc::IToplevelProtocol(PGMPContentMsgStart, mozilla::ipc::ChildSide),
79 : mChannel("PGMPContentChild", ALLOW_THIS_IN_INITIALIZER_LIST(this)),
80 0 : mState(PGMPContent::__Start)
81 : {
82 0 : MOZ_COUNT_CTOR(PGMPContentChild);
83 0 : }
84 :
85 0 : PGMPContentChild::~PGMPContentChild()
86 : {
87 0 : MOZ_COUNT_DTOR(PGMPContentChild);
88 0 : }
89 :
90 0 : auto PGMPContentChild::ManagedPGMPDecryptorChild(nsTArray<PGMPDecryptorChild*>& aArr) const -> void
91 : {
92 0 : (mManagedPGMPDecryptorChild).ToArray(aArr);
93 0 : }
94 :
95 0 : auto PGMPContentChild::ManagedPGMPDecryptorChild() const -> const ManagedContainer<PGMPDecryptorChild>&
96 : {
97 0 : return mManagedPGMPDecryptorChild;
98 : }
99 :
100 0 : auto PGMPContentChild::ManagedPGMPVideoDecoderChild(nsTArray<PGMPVideoDecoderChild*>& aArr) const -> void
101 : {
102 0 : (mManagedPGMPVideoDecoderChild).ToArray(aArr);
103 0 : }
104 :
105 0 : auto PGMPContentChild::ManagedPGMPVideoDecoderChild() const -> const ManagedContainer<PGMPVideoDecoderChild>&
106 : {
107 0 : return mManagedPGMPVideoDecoderChild;
108 : }
109 :
110 0 : auto PGMPContentChild::ManagedPGMPVideoEncoderChild(nsTArray<PGMPVideoEncoderChild*>& aArr) const -> void
111 : {
112 0 : (mManagedPGMPVideoEncoderChild).ToArray(aArr);
113 0 : }
114 :
115 0 : auto PGMPContentChild::ManagedPGMPVideoEncoderChild() const -> const ManagedContainer<PGMPVideoEncoderChild>&
116 : {
117 0 : return mManagedPGMPVideoEncoderChild;
118 : }
119 :
120 0 : auto PGMPContentChild::ManagedPChromiumCDMChild(nsTArray<PChromiumCDMChild*>& aArr) const -> void
121 : {
122 0 : (mManagedPChromiumCDMChild).ToArray(aArr);
123 0 : }
124 :
125 0 : auto PGMPContentChild::ManagedPChromiumCDMChild() const -> const ManagedContainer<PChromiumCDMChild>&
126 : {
127 0 : return mManagedPChromiumCDMChild;
128 : }
129 :
130 0 : auto PGMPContentChild::GetIPCChannel() -> MessageChannel*
131 : {
132 0 : return (&(mChannel));
133 : }
134 :
135 0 : auto PGMPContentChild::GetIPCChannel() const -> const MessageChannel*
136 : {
137 0 : return (&(mChannel));
138 : }
139 :
140 0 : auto PGMPContentChild::RemoveManagee(
141 : int32_t aProtocolId,
142 : ProtocolBase* aListener) -> void
143 : {
144 0 : switch (aProtocolId) {
145 : case PGMPDecryptorMsgStart:
146 : {
147 0 : PGMPDecryptorChild* actor = static_cast<PGMPDecryptorChild*>(aListener);
148 0 : auto& container = mManagedPGMPDecryptorChild;
149 0 : MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!");
150 :
151 0 : (container).RemoveEntry(actor);
152 0 : DeallocPGMPDecryptorChild(actor);
153 0 : return;
154 : }
155 : case PGMPVideoDecoderMsgStart:
156 : {
157 0 : PGMPVideoDecoderChild* actor = static_cast<PGMPVideoDecoderChild*>(aListener);
158 0 : auto& container = mManagedPGMPVideoDecoderChild;
159 0 : MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!");
160 :
161 0 : (container).RemoveEntry(actor);
162 0 : DeallocPGMPVideoDecoderChild(actor);
163 0 : return;
164 : }
165 : case PGMPVideoEncoderMsgStart:
166 : {
167 0 : PGMPVideoEncoderChild* actor = static_cast<PGMPVideoEncoderChild*>(aListener);
168 0 : auto& container = mManagedPGMPVideoEncoderChild;
169 0 : MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!");
170 :
171 0 : (container).RemoveEntry(actor);
172 0 : DeallocPGMPVideoEncoderChild(actor);
173 0 : return;
174 : }
175 : case PChromiumCDMMsgStart:
176 : {
177 0 : PChromiumCDMChild* actor = static_cast<PChromiumCDMChild*>(aListener);
178 0 : auto& container = mManagedPChromiumCDMChild;
179 0 : MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!");
180 :
181 0 : (container).RemoveEntry(actor);
182 0 : DeallocPChromiumCDMChild(actor);
183 0 : return;
184 : }
185 : default:
186 : {
187 0 : FatalError("unreached");
188 0 : return;
189 : }
190 : }
191 : }
192 :
193 0 : auto PGMPContentChild::OnMessageReceived(const Message& msg__) -> PGMPContentChild::Result
194 : {
195 0 : int32_t route__ = (msg__).routing_id();
196 0 : if ((MSG_ROUTING_CONTROL) != (route__)) {
197 0 : ChannelListener* routed__ = Lookup(route__);
198 0 : if ((!(routed__))) {
199 0 : return MsgRouteError;
200 : }
201 0 : return (routed__)->OnMessageReceived(msg__);
202 : }
203 :
204 0 : switch ((msg__).type()) {
205 : case PGMPContent::Msg_PGMPDecryptorConstructor__ID:
206 : {
207 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPContentChild")) {
208 0 : mozilla::ipc::LogMessageForProtocol("PGMPContentChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
209 : }
210 0 : AUTO_PROFILER_LABEL("PGMPContent::Msg_PGMPDecryptorConstructor", OTHER);
211 :
212 0 : PickleIterator iter__(msg__);
213 : ActorHandle handle__;
214 : PGMPDecryptorChild* actor;
215 :
216 0 : if ((!(Read((&(handle__)), (&(msg__)), (&(iter__)))))) {
217 0 : FatalError("Error deserializing 'ActorHandle'");
218 0 : return MsgValueError;
219 : }
220 : // Sentinel = 'actor'
221 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
222 0 : mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'");
223 0 : return MsgValueError;
224 : }
225 0 : (msg__).EndRead(iter__, (msg__).type());
226 0 : PGMPContent::Transition(PGMPContent::Msg_PGMPDecryptorConstructor__ID, (&(mState)));
227 0 : actor = AllocPGMPDecryptorChild();
228 0 : if ((!(actor))) {
229 0 : NS_WARNING("Error constructing actor PGMPDecryptorChild");
230 0 : return MsgValueError;
231 : }
232 0 : (actor)->SetManager(this);
233 0 : RegisterID(actor, (handle__).mId);
234 0 : (actor)->SetIPCChannel(GetIPCChannel());
235 0 : (mManagedPGMPDecryptorChild).PutEntry(actor);
236 0 : (actor)->mState = mozilla::gmp::PGMPDecryptor::__Start;
237 :
238 0 : if ((!(RecvPGMPDecryptorConstructor(mozilla::Move(actor))))) {
239 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
240 : // Error handled in mozilla::ipc::IPCResult
241 0 : return MsgProcessingError;
242 : }
243 :
244 0 : return MsgProcessed;
245 : }
246 : case PGMPContent::Msg_PGMPVideoDecoderConstructor__ID:
247 : {
248 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPContentChild")) {
249 0 : mozilla::ipc::LogMessageForProtocol("PGMPContentChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
250 : }
251 0 : AUTO_PROFILER_LABEL("PGMPContent::Msg_PGMPVideoDecoderConstructor", OTHER);
252 :
253 0 : PickleIterator iter__(msg__);
254 : ActorHandle handle__;
255 : PGMPVideoDecoderChild* actor;
256 : uint32_t aDecryptorId;
257 :
258 0 : if ((!(Read((&(handle__)), (&(msg__)), (&(iter__)))))) {
259 0 : FatalError("Error deserializing 'ActorHandle'");
260 0 : return MsgValueError;
261 : }
262 : // Sentinel = 'actor'
263 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
264 0 : mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'");
265 0 : return MsgValueError;
266 : }
267 0 : if ((!(Read((&(aDecryptorId)), (&(msg__)), (&(iter__)))))) {
268 0 : FatalError("Error deserializing 'uint32_t'");
269 0 : return MsgValueError;
270 : }
271 : // Sentinel = 'aDecryptorId'
272 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2779641256)))) {
273 0 : mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
274 0 : return MsgValueError;
275 : }
276 0 : (msg__).EndRead(iter__, (msg__).type());
277 0 : PGMPContent::Transition(PGMPContent::Msg_PGMPVideoDecoderConstructor__ID, (&(mState)));
278 0 : actor = AllocPGMPVideoDecoderChild(aDecryptorId);
279 0 : if ((!(actor))) {
280 0 : NS_WARNING("Error constructing actor PGMPVideoDecoderChild");
281 0 : return MsgValueError;
282 : }
283 0 : (actor)->SetManager(this);
284 0 : RegisterID(actor, (handle__).mId);
285 0 : (actor)->SetIPCChannel(GetIPCChannel());
286 0 : (mManagedPGMPVideoDecoderChild).PutEntry(actor);
287 0 : (actor)->mState = mozilla::gmp::PGMPVideoDecoder::__Start;
288 :
289 0 : if ((!(RecvPGMPVideoDecoderConstructor(mozilla::Move(actor), mozilla::Move(aDecryptorId))))) {
290 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
291 : // Error handled in mozilla::ipc::IPCResult
292 0 : return MsgProcessingError;
293 : }
294 :
295 0 : return MsgProcessed;
296 : }
297 : case PGMPContent::Msg_PGMPVideoEncoderConstructor__ID:
298 : {
299 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPContentChild")) {
300 0 : mozilla::ipc::LogMessageForProtocol("PGMPContentChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
301 : }
302 0 : AUTO_PROFILER_LABEL("PGMPContent::Msg_PGMPVideoEncoderConstructor", OTHER);
303 :
304 0 : PickleIterator iter__(msg__);
305 : ActorHandle handle__;
306 : PGMPVideoEncoderChild* actor;
307 :
308 0 : if ((!(Read((&(handle__)), (&(msg__)), (&(iter__)))))) {
309 0 : FatalError("Error deserializing 'ActorHandle'");
310 0 : return MsgValueError;
311 : }
312 : // Sentinel = 'actor'
313 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
314 0 : mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'");
315 0 : return MsgValueError;
316 : }
317 0 : (msg__).EndRead(iter__, (msg__).type());
318 0 : PGMPContent::Transition(PGMPContent::Msg_PGMPVideoEncoderConstructor__ID, (&(mState)));
319 0 : actor = AllocPGMPVideoEncoderChild();
320 0 : if ((!(actor))) {
321 0 : NS_WARNING("Error constructing actor PGMPVideoEncoderChild");
322 0 : return MsgValueError;
323 : }
324 0 : (actor)->SetManager(this);
325 0 : RegisterID(actor, (handle__).mId);
326 0 : (actor)->SetIPCChannel(GetIPCChannel());
327 0 : (mManagedPGMPVideoEncoderChild).PutEntry(actor);
328 0 : (actor)->mState = mozilla::gmp::PGMPVideoEncoder::__Start;
329 :
330 0 : if ((!(RecvPGMPVideoEncoderConstructor(mozilla::Move(actor))))) {
331 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
332 : // Error handled in mozilla::ipc::IPCResult
333 0 : return MsgProcessingError;
334 : }
335 :
336 0 : return MsgProcessed;
337 : }
338 : case PGMPContent::Msg_PChromiumCDMConstructor__ID:
339 : {
340 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPContentChild")) {
341 0 : mozilla::ipc::LogMessageForProtocol("PGMPContentChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
342 : }
343 0 : AUTO_PROFILER_LABEL("PGMPContent::Msg_PChromiumCDMConstructor", OTHER);
344 :
345 0 : PickleIterator iter__(msg__);
346 : ActorHandle handle__;
347 : PChromiumCDMChild* actor;
348 :
349 0 : if ((!(Read((&(handle__)), (&(msg__)), (&(iter__)))))) {
350 0 : FatalError("Error deserializing 'ActorHandle'");
351 0 : return MsgValueError;
352 : }
353 : // Sentinel = 'actor'
354 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
355 0 : mozilla::ipc::SentinelReadError("Error deserializing 'ActorHandle'");
356 0 : return MsgValueError;
357 : }
358 0 : (msg__).EndRead(iter__, (msg__).type());
359 0 : PGMPContent::Transition(PGMPContent::Msg_PChromiumCDMConstructor__ID, (&(mState)));
360 0 : actor = AllocPChromiumCDMChild();
361 0 : if ((!(actor))) {
362 0 : NS_WARNING("Error constructing actor PChromiumCDMChild");
363 0 : return MsgValueError;
364 : }
365 0 : (actor)->SetManager(this);
366 0 : RegisterID(actor, (handle__).mId);
367 0 : (actor)->SetIPCChannel(GetIPCChannel());
368 0 : (mManagedPChromiumCDMChild).PutEntry(actor);
369 0 : (actor)->mState = mozilla::gmp::PChromiumCDM::__Start;
370 :
371 0 : if ((!(RecvPChromiumCDMConstructor(mozilla::Move(actor))))) {
372 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
373 : // Error handled in mozilla::ipc::IPCResult
374 0 : return MsgProcessingError;
375 : }
376 :
377 0 : return MsgProcessed;
378 : }
379 : default:
380 : {
381 0 : return MsgNotKnown;
382 : }
383 : case SHMEM_CREATED_MESSAGE_TYPE:
384 : {
385 0 : if ((!(ShmemCreated(msg__)))) {
386 0 : return MsgPayloadError;
387 : }
388 0 : return MsgProcessed;
389 : }
390 : case SHMEM_DESTROYED_MESSAGE_TYPE:
391 : {
392 0 : if ((!(ShmemDestroyed(msg__)))) {
393 0 : return MsgPayloadError;
394 : }
395 0 : return MsgProcessed;
396 : }
397 : }
398 : }
399 :
400 0 : auto PGMPContentChild::OnMessageReceived(
401 : const Message& msg__,
402 : Message*& reply__) -> PGMPContentChild::Result
403 : {
404 0 : int32_t route__ = (msg__).routing_id();
405 0 : if ((MSG_ROUTING_CONTROL) != (route__)) {
406 0 : ChannelListener* routed__ = Lookup(route__);
407 0 : if ((!(routed__))) {
408 0 : return MsgRouteError;
409 : }
410 0 : return (routed__)->OnMessageReceived(msg__, reply__);
411 : }
412 :
413 0 : return MsgNotKnown;
414 : }
415 :
416 0 : auto PGMPContentChild::OnCallReceived(
417 : const Message& msg__,
418 : Message*& reply__) -> PGMPContentChild::Result
419 : {
420 0 : int32_t route__ = (msg__).routing_id();
421 0 : if ((MSG_ROUTING_CONTROL) != (route__)) {
422 0 : ChannelListener* routed__ = Lookup(route__);
423 0 : if ((!(routed__))) {
424 0 : return MsgRouteError;
425 : }
426 0 : return (routed__)->OnCallReceived(msg__, reply__);
427 : }
428 :
429 0 : return MsgNotKnown;
430 : }
431 :
432 0 : auto PGMPContentChild::GetProtocolTypeId() -> int32_t
433 : {
434 0 : return PGMPContentMsgStart;
435 : }
436 :
437 0 : auto PGMPContentChild::OnChannelClose() -> void
438 : {
439 0 : DestroySubtree(NormalShutdown);
440 0 : DeallocSubtree();
441 0 : DeallocShmems();
442 0 : DeallocPGMPContentChild();
443 0 : }
444 :
445 0 : auto PGMPContentChild::OnChannelError() -> void
446 : {
447 0 : DestroySubtree(AbnormalShutdown);
448 0 : DeallocSubtree();
449 0 : DeallocShmems();
450 0 : DeallocPGMPContentChild();
451 0 : }
452 :
453 0 : auto PGMPContentChild::ProcessNativeEventsInInterruptCall() -> void
454 : {
455 : #ifdef OS_WIN
456 : (mChannel).ProcessNativeEventsInInterruptCall();
457 : #else
458 0 : FatalError("This method is Windows-only");
459 : #endif
460 0 : }
461 :
462 0 : auto PGMPContentChild::ProtocolName() const -> const char*
463 : {
464 0 : return "PGMPContentChild";
465 : }
466 :
467 0 : auto PGMPContentChild::DestroySubtree(ActorDestroyReason why) -> void
468 : {
469 0 : ActorDestroyReason subtreewhy = (((why) == (Deletion)) || ((why) == (FailedConstructor)) ? AncestorDeletion : why);
470 :
471 : {
472 : // Recursively shutting down PGMPDecryptor kids
473 0 : nsTArray<PGMPDecryptorChild*> kids;
474 : // Accumulate kids into a stable structure to iterate over
475 0 : ManagedPGMPDecryptorChild(kids);
476 0 : for (auto& kid : kids) {
477 : // Guarding against a child removing a sibling from the list during the iteration.
478 0 : if ((mManagedPGMPDecryptorChild).Contains(kid)) {
479 0 : (kid)->DestroySubtree(subtreewhy);
480 : }
481 : }
482 : }
483 : {
484 : // Recursively shutting down PGMPVideoDecoder kids
485 0 : nsTArray<PGMPVideoDecoderChild*> kids;
486 : // Accumulate kids into a stable structure to iterate over
487 0 : ManagedPGMPVideoDecoderChild(kids);
488 0 : for (auto& kid : kids) {
489 : // Guarding against a child removing a sibling from the list during the iteration.
490 0 : if ((mManagedPGMPVideoDecoderChild).Contains(kid)) {
491 0 : (kid)->DestroySubtree(subtreewhy);
492 : }
493 : }
494 : }
495 : {
496 : // Recursively shutting down PGMPVideoEncoder kids
497 0 : nsTArray<PGMPVideoEncoderChild*> kids;
498 : // Accumulate kids into a stable structure to iterate over
499 0 : ManagedPGMPVideoEncoderChild(kids);
500 0 : for (auto& kid : kids) {
501 : // Guarding against a child removing a sibling from the list during the iteration.
502 0 : if ((mManagedPGMPVideoEncoderChild).Contains(kid)) {
503 0 : (kid)->DestroySubtree(subtreewhy);
504 : }
505 : }
506 : }
507 : {
508 : // Recursively shutting down PChromiumCDM kids
509 0 : nsTArray<PChromiumCDMChild*> kids;
510 : // Accumulate kids into a stable structure to iterate over
511 0 : ManagedPChromiumCDMChild(kids);
512 0 : for (auto& kid : kids) {
513 : // Guarding against a child removing a sibling from the list during the iteration.
514 0 : if ((mManagedPChromiumCDMChild).Contains(kid)) {
515 0 : (kid)->DestroySubtree(subtreewhy);
516 : }
517 : }
518 : }
519 :
520 : // Reject owning pending promises.
521 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
522 :
523 : // Finally, destroy "us".
524 0 : ActorDestroy(why);
525 0 : }
526 :
527 0 : auto PGMPContentChild::DeallocSubtree() -> void
528 : {
529 : {
530 : // Recursively deleting PGMPDecryptor kids
531 0 : for (auto iter = (mManagedPGMPDecryptorChild).Iter(); (!((iter).Done())); (iter).Next()) {
532 0 : (((iter).Get())->GetKey())->DeallocSubtree();
533 : }
534 :
535 0 : for (auto iter = (mManagedPGMPDecryptorChild).Iter(); (!((iter).Done())); (iter).Next()) {
536 0 : DeallocPGMPDecryptorChild(((iter).Get())->GetKey());
537 : }
538 0 : (mManagedPGMPDecryptorChild).Clear();
539 : }
540 : {
541 : // Recursively deleting PGMPVideoDecoder kids
542 0 : for (auto iter = (mManagedPGMPVideoDecoderChild).Iter(); (!((iter).Done())); (iter).Next()) {
543 0 : (((iter).Get())->GetKey())->DeallocSubtree();
544 : }
545 :
546 0 : for (auto iter = (mManagedPGMPVideoDecoderChild).Iter(); (!((iter).Done())); (iter).Next()) {
547 0 : DeallocPGMPVideoDecoderChild(((iter).Get())->GetKey());
548 : }
549 0 : (mManagedPGMPVideoDecoderChild).Clear();
550 : }
551 : {
552 : // Recursively deleting PGMPVideoEncoder kids
553 0 : for (auto iter = (mManagedPGMPVideoEncoderChild).Iter(); (!((iter).Done())); (iter).Next()) {
554 0 : (((iter).Get())->GetKey())->DeallocSubtree();
555 : }
556 :
557 0 : for (auto iter = (mManagedPGMPVideoEncoderChild).Iter(); (!((iter).Done())); (iter).Next()) {
558 0 : DeallocPGMPVideoEncoderChild(((iter).Get())->GetKey());
559 : }
560 0 : (mManagedPGMPVideoEncoderChild).Clear();
561 : }
562 : {
563 : // Recursively deleting PChromiumCDM kids
564 0 : for (auto iter = (mManagedPChromiumCDMChild).Iter(); (!((iter).Done())); (iter).Next()) {
565 0 : (((iter).Get())->GetKey())->DeallocSubtree();
566 : }
567 :
568 0 : for (auto iter = (mManagedPChromiumCDMChild).Iter(); (!((iter).Done())); (iter).Next()) {
569 0 : DeallocPChromiumCDMChild(((iter).Get())->GetKey());
570 : }
571 0 : (mManagedPChromiumCDMChild).Clear();
572 : }
573 0 : }
574 :
575 0 : auto PGMPContentChild::DeallocPGMPContentChild() -> void
576 : {
577 0 : }
578 :
579 0 : auto PGMPContentChild::Write(
580 : const PChromiumCDMChild* v__,
581 : Message* msg__,
582 : bool nullable__) -> void
583 : {
584 : int32_t id;
585 0 : if ((!(v__))) {
586 0 : if ((!(nullable__))) {
587 0 : FatalError("NULL actor value passed to non-nullable param");
588 : }
589 0 : id = 0;
590 : }
591 : else {
592 0 : id = (v__)->Id();
593 0 : if ((1) == (id)) {
594 0 : FatalError("actor has been |delete|d");
595 : }
596 : }
597 :
598 0 : Write(id, msg__);
599 0 : }
600 :
601 0 : auto PGMPContentChild::Read(
602 : PChromiumCDMChild** v__,
603 : const Message* msg__,
604 : PickleIterator* iter__,
605 : bool nullable__) -> bool
606 : {
607 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PChromiumCDM", PChromiumCDMMsgStart);
608 0 : if ((actor).isNothing()) {
609 0 : return false;
610 : }
611 :
612 0 : (*(v__)) = static_cast<PChromiumCDMChild*>((actor).value());
613 0 : return true;
614 : }
615 :
616 0 : auto PGMPContentChild::Write(
617 : const PGMPVideoEncoderChild* v__,
618 : Message* msg__,
619 : bool nullable__) -> void
620 : {
621 : int32_t id;
622 0 : if ((!(v__))) {
623 0 : if ((!(nullable__))) {
624 0 : FatalError("NULL actor value passed to non-nullable param");
625 : }
626 0 : id = 0;
627 : }
628 : else {
629 0 : id = (v__)->Id();
630 0 : if ((1) == (id)) {
631 0 : FatalError("actor has been |delete|d");
632 : }
633 : }
634 :
635 0 : Write(id, msg__);
636 0 : }
637 :
638 0 : auto PGMPContentChild::Read(
639 : PGMPVideoEncoderChild** v__,
640 : const Message* msg__,
641 : PickleIterator* iter__,
642 : bool nullable__) -> bool
643 : {
644 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PGMPVideoEncoder", PGMPVideoEncoderMsgStart);
645 0 : if ((actor).isNothing()) {
646 0 : return false;
647 : }
648 :
649 0 : (*(v__)) = static_cast<PGMPVideoEncoderChild*>((actor).value());
650 0 : return true;
651 : }
652 :
653 0 : auto PGMPContentChild::Write(
654 : const PGMPVideoDecoderChild* v__,
655 : Message* msg__,
656 : bool nullable__) -> void
657 : {
658 : int32_t id;
659 0 : if ((!(v__))) {
660 0 : if ((!(nullable__))) {
661 0 : FatalError("NULL actor value passed to non-nullable param");
662 : }
663 0 : id = 0;
664 : }
665 : else {
666 0 : id = (v__)->Id();
667 0 : if ((1) == (id)) {
668 0 : FatalError("actor has been |delete|d");
669 : }
670 : }
671 :
672 0 : Write(id, msg__);
673 0 : }
674 :
675 0 : auto PGMPContentChild::Read(
676 : PGMPVideoDecoderChild** v__,
677 : const Message* msg__,
678 : PickleIterator* iter__,
679 : bool nullable__) -> bool
680 : {
681 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PGMPVideoDecoder", PGMPVideoDecoderMsgStart);
682 0 : if ((actor).isNothing()) {
683 0 : return false;
684 : }
685 :
686 0 : (*(v__)) = static_cast<PGMPVideoDecoderChild*>((actor).value());
687 0 : return true;
688 : }
689 :
690 0 : auto PGMPContentChild::Write(
691 : const PGMPDecryptorChild* v__,
692 : Message* msg__,
693 : bool nullable__) -> void
694 : {
695 : int32_t id;
696 0 : if ((!(v__))) {
697 0 : if ((!(nullable__))) {
698 0 : FatalError("NULL actor value passed to non-nullable param");
699 : }
700 0 : id = 0;
701 : }
702 : else {
703 0 : id = (v__)->Id();
704 0 : if ((1) == (id)) {
705 0 : FatalError("actor has been |delete|d");
706 : }
707 : }
708 :
709 0 : Write(id, msg__);
710 0 : }
711 :
712 0 : auto PGMPContentChild::Read(
713 : PGMPDecryptorChild** v__,
714 : const Message* msg__,
715 : PickleIterator* iter__,
716 : bool nullable__) -> bool
717 : {
718 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PGMPDecryptor", PGMPDecryptorMsgStart);
719 0 : if ((actor).isNothing()) {
720 0 : return false;
721 : }
722 :
723 0 : (*(v__)) = static_cast<PGMPDecryptorChild*>((actor).value());
724 0 : return true;
725 : }
726 :
727 :
728 :
729 : } // namespace gmp
730 : } // namespace mozilla
|