Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/gmp/PGMPServiceParent.h"
8 : #ifdef MOZ_CRASHREPORTER
9 : # include "nsXULAppAPI.h"
10 : #endif
11 :
12 : #include "mozilla/gmp/PGMPContentParent.h"
13 :
14 : #include "nsIFile.h"
15 : #include "GeckoProfiler.h"
16 :
17 : namespace mozilla {
18 : namespace gmp {
19 :
20 :
21 :
22 0 : auto PGMPServiceParent::ProcessingError(
23 : Result aCode,
24 : const char* aReason) -> void
25 : {
26 0 : }
27 :
28 0 : auto PGMPServiceParent::ShouldContinueFromReplyTimeout() -> bool
29 : {
30 0 : return true;
31 : }
32 :
33 0 : auto PGMPServiceParent::EnteredCxxStack() -> void
34 : {
35 0 : }
36 :
37 0 : auto PGMPServiceParent::ExitedCxxStack() -> void
38 : {
39 0 : }
40 :
41 0 : auto PGMPServiceParent::EnteredCall() -> void
42 : {
43 0 : }
44 :
45 0 : auto PGMPServiceParent::ExitedCall() -> void
46 : {
47 0 : }
48 :
49 0 : MOZ_IMPLICIT PGMPServiceParent::PGMPServiceParent() :
50 : mozilla::ipc::IToplevelProtocol(PGMPServiceMsgStart, mozilla::ipc::ParentSide),
51 : mChannel("PGMPServiceParent", ALLOW_THIS_IN_INITIALIZER_LIST(this)),
52 0 : mState(PGMPService::__Start)
53 : {
54 0 : MOZ_COUNT_CTOR(PGMPServiceParent);
55 0 : }
56 :
57 0 : PGMPServiceParent::~PGMPServiceParent()
58 : {
59 0 : MOZ_COUNT_DTOR(PGMPServiceParent);
60 0 : }
61 :
62 0 : auto PGMPServiceParent::SendBeginShutdown() -> bool
63 : {
64 0 : IPC::Message* msg__ = PGMPService::Msg_BeginShutdown(MSG_ROUTING_CONTROL);
65 :
66 :
67 :
68 :
69 :
70 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPServiceParent")) {
71 0 : mozilla::ipc::LogMessageForProtocol("PGMPServiceParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
72 : }
73 0 : AUTO_PROFILER_LABEL("PGMPService::Msg_BeginShutdown", OTHER);
74 0 : PGMPService::Transition(PGMPService::Msg_BeginShutdown__ID, (&(mState)));
75 :
76 0 : bool sendok__ = (GetIPCChannel())->Send(msg__);
77 0 : return sendok__;
78 : }
79 :
80 0 : auto PGMPServiceParent::GetIPCChannel() -> MessageChannel*
81 : {
82 0 : return (&(mChannel));
83 : }
84 :
85 0 : auto PGMPServiceParent::GetIPCChannel() const -> const MessageChannel*
86 : {
87 0 : return (&(mChannel));
88 : }
89 :
90 0 : auto PGMPServiceParent::RemoveManagee(
91 : int32_t aProtocolId,
92 : ProtocolBase* aListener) -> void
93 : {
94 0 : FatalError("unreached");
95 0 : return;
96 : }
97 :
98 0 : auto PGMPServiceParent::OnMessageReceived(const Message& msg__) -> PGMPServiceParent::Result
99 : {
100 0 : switch ((msg__).type()) {
101 : default:
102 : {
103 0 : return MsgNotKnown;
104 : }
105 : case SHMEM_CREATED_MESSAGE_TYPE:
106 : {
107 0 : FatalError("this protocol tree does not use shmem");
108 0 : return MsgNotKnown;
109 : }
110 : case SHMEM_DESTROYED_MESSAGE_TYPE:
111 : {
112 0 : FatalError("this protocol tree does not use shmem");
113 0 : return MsgNotKnown;
114 : }
115 : }
116 : }
117 :
118 0 : auto PGMPServiceParent::OnMessageReceived(
119 : const Message& msg__,
120 : Message*& reply__) -> PGMPServiceParent::Result
121 : {
122 0 : switch ((msg__).type()) {
123 : case PGMPService::Msg_LaunchGMP__ID:
124 : {
125 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPServiceParent")) {
126 0 : mozilla::ipc::LogMessageForProtocol("PGMPServiceParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
127 : }
128 0 : AUTO_PROFILER_LABEL("PGMPService::Msg_LaunchGMP", OTHER);
129 :
130 0 : PickleIterator iter__(msg__);
131 0 : nsCString nodeId;
132 0 : nsCString api;
133 0 : nsTArray<nsCString> tags;
134 0 : nsTArray<ProcessId> alreadyBridgedTo;
135 :
136 0 : if ((!(Read((&(nodeId)), (&(msg__)), (&(iter__)))))) {
137 0 : FatalError("Error deserializing 'nsCString'");
138 0 : return MsgValueError;
139 : }
140 : // Sentinel = 'nodeId'
141 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 592730925)))) {
142 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
143 0 : return MsgValueError;
144 : }
145 0 : if ((!(Read((&(api)), (&(msg__)), (&(iter__)))))) {
146 0 : FatalError("Error deserializing 'nsCString'");
147 0 : return MsgValueError;
148 : }
149 : // Sentinel = 'api'
150 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2712041747)))) {
151 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
152 0 : return MsgValueError;
153 : }
154 0 : if ((!(Read((&(tags)), (&(msg__)), (&(iter__)))))) {
155 0 : FatalError("Error deserializing 'nsTArray'");
156 0 : return MsgValueError;
157 : }
158 : // Sentinel = 'tags'
159 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2697818311)))) {
160 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'");
161 0 : return MsgValueError;
162 : }
163 0 : if ((!(Read((&(alreadyBridgedTo)), (&(msg__)), (&(iter__)))))) {
164 0 : FatalError("Error deserializing 'nsTArray'");
165 0 : return MsgValueError;
166 : }
167 : // Sentinel = 'alreadyBridgedTo'
168 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3102476118)))) {
169 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'");
170 0 : return MsgValueError;
171 : }
172 0 : (msg__).EndRead(iter__, (msg__).type());
173 0 : PGMPService::Transition(PGMPService::Msg_LaunchGMP__ID, (&(mState)));
174 0 : int32_t id__ = MSG_ROUTING_CONTROL;
175 : uint32_t pluginId;
176 : ProcessId id;
177 0 : nsCString displayName;
178 0 : Endpoint<mozilla::gmp::PGMPContentParent> endpoint;
179 : nsresult aResult;
180 0 : if ((!(RecvLaunchGMP(mozilla::Move(nodeId), mozilla::Move(api), mozilla::Move(tags), mozilla::Move(alreadyBridgedTo), (&(pluginId)), (&(id)), (&(displayName)), (&(endpoint)), (&(aResult)))))) {
181 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
182 : // Error handled in mozilla::ipc::IPCResult
183 0 : return MsgProcessingError;
184 : }
185 :
186 0 : reply__ = PGMPService::Reply_LaunchGMP(id__);
187 :
188 0 : Write(pluginId, reply__);
189 : // Sentinel = 'pluginId'
190 0 : (reply__)->WriteSentinel(1563488274);
191 0 : Write(id, reply__);
192 : // Sentinel = 'id'
193 0 : (reply__)->WriteSentinel(2794505629);
194 0 : Write(displayName, reply__);
195 : // Sentinel = 'displayName'
196 0 : (reply__)->WriteSentinel(3335312356);
197 0 : Write(endpoint, reply__);
198 : // Sentinel = 'endpoint'
199 0 : (reply__)->WriteSentinel(3610972515);
200 0 : Write(aResult, reply__);
201 : // Sentinel = 'aResult'
202 0 : (reply__)->WriteSentinel(3888726089);
203 0 : (reply__)->set_sync();
204 0 : (reply__)->set_reply();
205 :
206 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPServiceParent")) {
207 0 : mozilla::ipc::LogMessageForProtocol("PGMPServiceParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
208 : }
209 0 : return MsgProcessed;
210 : }
211 : case PGMPService::Msg_LaunchGMPForNodeId__ID:
212 : {
213 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPServiceParent")) {
214 0 : mozilla::ipc::LogMessageForProtocol("PGMPServiceParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
215 : }
216 0 : AUTO_PROFILER_LABEL("PGMPService::Msg_LaunchGMPForNodeId", OTHER);
217 :
218 0 : PickleIterator iter__(msg__);
219 0 : NodeIdData nodeId;
220 0 : nsCString api;
221 0 : nsTArray<nsCString> tags;
222 0 : nsTArray<ProcessId> alreadyBridgedTo;
223 :
224 0 : if ((!(Read((&(nodeId)), (&(msg__)), (&(iter__)))))) {
225 0 : FatalError("Error deserializing 'NodeIdData'");
226 0 : return MsgValueError;
227 : }
228 : // Sentinel = 'nodeId'
229 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 592730925)))) {
230 0 : mozilla::ipc::SentinelReadError("Error deserializing 'NodeIdData'");
231 0 : return MsgValueError;
232 : }
233 0 : if ((!(Read((&(api)), (&(msg__)), (&(iter__)))))) {
234 0 : FatalError("Error deserializing 'nsCString'");
235 0 : return MsgValueError;
236 : }
237 : // Sentinel = 'api'
238 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2712041747)))) {
239 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
240 0 : return MsgValueError;
241 : }
242 0 : if ((!(Read((&(tags)), (&(msg__)), (&(iter__)))))) {
243 0 : FatalError("Error deserializing 'nsTArray'");
244 0 : return MsgValueError;
245 : }
246 : // Sentinel = 'tags'
247 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2697818311)))) {
248 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'");
249 0 : return MsgValueError;
250 : }
251 0 : if ((!(Read((&(alreadyBridgedTo)), (&(msg__)), (&(iter__)))))) {
252 0 : FatalError("Error deserializing 'nsTArray'");
253 0 : return MsgValueError;
254 : }
255 : // Sentinel = 'alreadyBridgedTo'
256 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3102476118)))) {
257 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsTArray'");
258 0 : return MsgValueError;
259 : }
260 0 : (msg__).EndRead(iter__, (msg__).type());
261 0 : PGMPService::Transition(PGMPService::Msg_LaunchGMPForNodeId__ID, (&(mState)));
262 0 : int32_t id__ = MSG_ROUTING_CONTROL;
263 : uint32_t pluginId;
264 : ProcessId id;
265 0 : nsCString displayName;
266 0 : Endpoint<mozilla::gmp::PGMPContentParent> endpoint;
267 : nsresult aResult;
268 0 : if ((!(RecvLaunchGMPForNodeId(mozilla::Move(nodeId), mozilla::Move(api), mozilla::Move(tags), mozilla::Move(alreadyBridgedTo), (&(pluginId)), (&(id)), (&(displayName)), (&(endpoint)), (&(aResult)))))) {
269 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
270 : // Error handled in mozilla::ipc::IPCResult
271 0 : return MsgProcessingError;
272 : }
273 :
274 0 : reply__ = PGMPService::Reply_LaunchGMPForNodeId(id__);
275 :
276 0 : Write(pluginId, reply__);
277 : // Sentinel = 'pluginId'
278 0 : (reply__)->WriteSentinel(1563488274);
279 0 : Write(id, reply__);
280 : // Sentinel = 'id'
281 0 : (reply__)->WriteSentinel(2794505629);
282 0 : Write(displayName, reply__);
283 : // Sentinel = 'displayName'
284 0 : (reply__)->WriteSentinel(3335312356);
285 0 : Write(endpoint, reply__);
286 : // Sentinel = 'endpoint'
287 0 : (reply__)->WriteSentinel(3610972515);
288 0 : Write(aResult, reply__);
289 : // Sentinel = 'aResult'
290 0 : (reply__)->WriteSentinel(3888726089);
291 0 : (reply__)->set_sync();
292 0 : (reply__)->set_reply();
293 :
294 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPServiceParent")) {
295 0 : mozilla::ipc::LogMessageForProtocol("PGMPServiceParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
296 : }
297 0 : return MsgProcessed;
298 : }
299 : case PGMPService::Msg_GetGMPNodeId__ID:
300 : {
301 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPServiceParent")) {
302 0 : mozilla::ipc::LogMessageForProtocol("PGMPServiceParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
303 : }
304 0 : AUTO_PROFILER_LABEL("PGMPService::Msg_GetGMPNodeId", OTHER);
305 :
306 0 : PickleIterator iter__(msg__);
307 0 : nsString origin;
308 0 : nsString topLevelOrigin;
309 0 : nsString gmpName;
310 :
311 0 : if ((!(Read((&(origin)), (&(msg__)), (&(iter__)))))) {
312 0 : FatalError("Error deserializing 'nsString'");
313 0 : return MsgValueError;
314 : }
315 : // Sentinel = 'origin'
316 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1429924608)))) {
317 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
318 0 : return MsgValueError;
319 : }
320 0 : if ((!(Read((&(topLevelOrigin)), (&(msg__)), (&(iter__)))))) {
321 0 : FatalError("Error deserializing 'nsString'");
322 0 : return MsgValueError;
323 : }
324 : // Sentinel = 'topLevelOrigin'
325 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2455035801)))) {
326 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
327 0 : return MsgValueError;
328 : }
329 0 : if ((!(Read((&(gmpName)), (&(msg__)), (&(iter__)))))) {
330 0 : FatalError("Error deserializing 'nsString'");
331 0 : return MsgValueError;
332 : }
333 : // Sentinel = 'gmpName'
334 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2256822302)))) {
335 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
336 0 : return MsgValueError;
337 : }
338 0 : (msg__).EndRead(iter__, (msg__).type());
339 0 : PGMPService::Transition(PGMPService::Msg_GetGMPNodeId__ID, (&(mState)));
340 0 : int32_t id__ = MSG_ROUTING_CONTROL;
341 0 : nsCString id;
342 0 : if ((!(RecvGetGMPNodeId(mozilla::Move(origin), mozilla::Move(topLevelOrigin), mozilla::Move(gmpName), (&(id)))))) {
343 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
344 : // Error handled in mozilla::ipc::IPCResult
345 0 : return MsgProcessingError;
346 : }
347 :
348 0 : reply__ = PGMPService::Reply_GetGMPNodeId(id__);
349 :
350 0 : Write(id, reply__);
351 : // Sentinel = 'id'
352 0 : (reply__)->WriteSentinel(2794505629);
353 0 : (reply__)->set_sync();
354 0 : (reply__)->set_reply();
355 :
356 0 : if (mozilla::ipc::LoggingEnabledFor("PGMPServiceParent")) {
357 0 : mozilla::ipc::LogMessageForProtocol("PGMPServiceParent", OtherPid(), "Sending reply ", (reply__)->type(), mozilla::ipc::MessageDirection::eSending);
358 : }
359 0 : return MsgProcessed;
360 : }
361 : default:
362 : {
363 0 : return MsgNotKnown;
364 : }
365 : }
366 : }
367 :
368 0 : auto PGMPServiceParent::OnCallReceived(
369 : const Message& msg__,
370 : Message*& reply__) -> PGMPServiceParent::Result
371 : {
372 0 : MOZ_ASSERT_UNREACHABLE("message protocol not supported");
373 : return MsgNotKnown;
374 : }
375 :
376 0 : auto PGMPServiceParent::GetProtocolTypeId() -> int32_t
377 : {
378 0 : return PGMPServiceMsgStart;
379 : }
380 :
381 0 : auto PGMPServiceParent::OnChannelClose() -> void
382 : {
383 0 : DestroySubtree(NormalShutdown);
384 0 : DeallocSubtree();
385 0 : DeallocShmems();
386 0 : DeallocPGMPServiceParent();
387 0 : }
388 :
389 0 : auto PGMPServiceParent::OnChannelError() -> void
390 : {
391 0 : DestroySubtree(AbnormalShutdown);
392 0 : DeallocSubtree();
393 0 : DeallocShmems();
394 0 : DeallocPGMPServiceParent();
395 0 : }
396 :
397 0 : auto PGMPServiceParent::ProtocolName() const -> const char*
398 : {
399 0 : return "PGMPServiceParent";
400 : }
401 :
402 0 : auto PGMPServiceParent::DestroySubtree(ActorDestroyReason why) -> void
403 : {
404 : // Reject owning pending promises.
405 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
406 :
407 : // Finally, destroy "us".
408 0 : ActorDestroy(why);
409 0 : }
410 :
411 0 : auto PGMPServiceParent::DeallocSubtree() -> void
412 : {
413 0 : }
414 :
415 0 : auto PGMPServiceParent::DeallocPGMPServiceParent() -> void
416 : {
417 0 : }
418 :
419 0 : auto PGMPServiceParent::Write(
420 : const NodeIdData& v__,
421 : Message* msg__) -> void
422 : {
423 0 : Write((v__).mOrigin(), msg__);
424 : // Sentinel = 'mOrigin'
425 0 : (msg__)->WriteSentinel(2379256900);
426 0 : Write((v__).mTopLevelOrigin(), msg__);
427 : // Sentinel = 'mTopLevelOrigin'
428 0 : (msg__)->WriteSentinel(1841310053);
429 0 : Write((v__).mGMPName(), msg__);
430 : // Sentinel = 'mGMPName'
431 0 : (msg__)->WriteSentinel(4228424074);
432 0 : }
433 :
434 0 : auto PGMPServiceParent::Read(
435 : NodeIdData* v__,
436 : const Message* msg__,
437 : PickleIterator* iter__) -> bool
438 : {
439 0 : if ((!(Read((&((v__)->mOrigin())), msg__, iter__)))) {
440 0 : FatalError("Error deserializing 'mOrigin' (nsString) member of 'NodeIdData'");
441 0 : return false;
442 : }
443 : // Sentinel = 'mOrigin'
444 0 : if ((!((msg__)->ReadSentinel(iter__, 2379256900)))) {
445 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mOrigin' (nsString) member of 'NodeIdData'");
446 0 : return false;
447 : }
448 0 : if ((!(Read((&((v__)->mTopLevelOrigin())), msg__, iter__)))) {
449 0 : FatalError("Error deserializing 'mTopLevelOrigin' (nsString) member of 'NodeIdData'");
450 0 : return false;
451 : }
452 : // Sentinel = 'mTopLevelOrigin'
453 0 : if ((!((msg__)->ReadSentinel(iter__, 1841310053)))) {
454 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mTopLevelOrigin' (nsString) member of 'NodeIdData'");
455 0 : return false;
456 : }
457 0 : if ((!(Read((&((v__)->mGMPName())), msg__, iter__)))) {
458 0 : FatalError("Error deserializing 'mGMPName' (nsString) member of 'NodeIdData'");
459 0 : return false;
460 : }
461 : // Sentinel = 'mGMPName'
462 0 : if ((!((msg__)->ReadSentinel(iter__, 4228424074)))) {
463 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mGMPName' (nsString) member of 'NodeIdData'");
464 0 : return false;
465 : }
466 0 : return true;
467 : }
468 :
469 :
470 :
471 : } // namespace gmp
472 : } // namespace mozilla
|