Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/dom/PHandlerServiceChild.h"
8 :
9 : #include "mozilla/dom/PContentChild.h"
10 :
11 : #include "nsIFile.h"
12 : #include "GeckoProfiler.h"
13 :
14 : namespace mozilla {
15 : namespace dom {
16 :
17 :
18 0 : auto PHandlerServiceChild::ActorDestroy(ActorDestroyReason aWhy) -> void
19 : {
20 0 : }
21 :
22 0 : MOZ_IMPLICIT PHandlerServiceChild::PHandlerServiceChild() :
23 : mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
24 0 : mState(PHandlerService::__Dead)
25 : {
26 0 : MOZ_COUNT_CTOR(PHandlerServiceChild);
27 0 : }
28 :
29 0 : PHandlerServiceChild::~PHandlerServiceChild()
30 : {
31 0 : MOZ_COUNT_DTOR(PHandlerServiceChild);
32 0 : }
33 :
34 0 : auto PHandlerServiceChild::Manager() const -> PContentChild*
35 : {
36 0 : return static_cast<PContentChild*>(IProtocol::Manager());
37 : }
38 :
39 0 : auto PHandlerServiceChild::SendFillHandlerInfo(
40 : const HandlerInfo& aHandlerInfoData,
41 : const nsCString& aOverrideType,
42 : HandlerInfo* handlerInfoData) -> bool
43 : {
44 0 : IPC::Message* msg__ = PHandlerService::Msg_FillHandlerInfo(Id());
45 :
46 0 : Write(aHandlerInfoData, msg__);
47 : // Sentinel = 'aHandlerInfoData'
48 0 : (msg__)->WriteSentinel(818541303);
49 0 : Write(aOverrideType, msg__);
50 : // Sentinel = 'aOverrideType'
51 0 : (msg__)->WriteSentinel(923193756);
52 :
53 0 : (msg__)->set_sync();
54 :
55 :
56 0 : Message reply__;
57 :
58 0 : if (mozilla::ipc::LoggingEnabledFor("PHandlerServiceChild")) {
59 0 : mozilla::ipc::LogMessageForProtocol("PHandlerServiceChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
60 : }
61 0 : AUTO_PROFILER_LABEL("PHandlerService::Msg_FillHandlerInfo", OTHER);
62 0 : PHandlerService::Transition(PHandlerService::Msg_FillHandlerInfo__ID, (&(mState)));
63 :
64 : bool sendok__;
65 : {
66 : AutoProfilerTracing syncIPCTracer(
67 : "IPC",
68 0 : "PHandlerService::Msg_FillHandlerInfo");
69 0 : sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__)));
70 : }
71 0 : if ((!(sendok__))) {
72 0 : return false;
73 : }
74 :
75 0 : if (mozilla::ipc::LoggingEnabledFor("PHandlerServiceChild")) {
76 0 : mozilla::ipc::LogMessageForProtocol("PHandlerServiceChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
77 : }
78 :
79 0 : PickleIterator iter__(reply__);
80 :
81 0 : if ((!(Read(handlerInfoData, (&(reply__)), (&(iter__)))))) {
82 0 : FatalError("Error deserializing 'HandlerInfo'");
83 0 : return false;
84 : }
85 : // Sentinel = 'handlerInfoData'
86 0 : if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 49315047)))) {
87 0 : mozilla::ipc::SentinelReadError("Error deserializing 'HandlerInfo'");
88 0 : return false;
89 : }
90 0 : (reply__).EndRead(iter__, (reply__).type());
91 :
92 0 : return true;
93 : }
94 :
95 0 : auto PHandlerServiceChild::SendExists(
96 : const HandlerInfo& aHandlerInfo,
97 : bool* exists) -> bool
98 : {
99 0 : IPC::Message* msg__ = PHandlerService::Msg_Exists(Id());
100 :
101 0 : Write(aHandlerInfo, msg__);
102 : // Sentinel = 'aHandlerInfo'
103 0 : (msg__)->WriteSentinel(1227275979);
104 :
105 0 : (msg__)->set_sync();
106 :
107 :
108 0 : Message reply__;
109 :
110 0 : if (mozilla::ipc::LoggingEnabledFor("PHandlerServiceChild")) {
111 0 : mozilla::ipc::LogMessageForProtocol("PHandlerServiceChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
112 : }
113 0 : AUTO_PROFILER_LABEL("PHandlerService::Msg_Exists", OTHER);
114 0 : PHandlerService::Transition(PHandlerService::Msg_Exists__ID, (&(mState)));
115 :
116 : bool sendok__;
117 : {
118 : AutoProfilerTracing syncIPCTracer(
119 : "IPC",
120 0 : "PHandlerService::Msg_Exists");
121 0 : sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__)));
122 : }
123 0 : if ((!(sendok__))) {
124 0 : return false;
125 : }
126 :
127 0 : if (mozilla::ipc::LoggingEnabledFor("PHandlerServiceChild")) {
128 0 : mozilla::ipc::LogMessageForProtocol("PHandlerServiceChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
129 : }
130 :
131 0 : PickleIterator iter__(reply__);
132 :
133 0 : if ((!(Read(exists, (&(reply__)), (&(iter__)))))) {
134 0 : FatalError("Error deserializing 'bool'");
135 0 : return false;
136 : }
137 : // Sentinel = 'exists'
138 0 : if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 351132806)))) {
139 0 : mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
140 0 : return false;
141 : }
142 0 : (reply__).EndRead(iter__, (reply__).type());
143 :
144 0 : return true;
145 : }
146 :
147 0 : auto PHandlerServiceChild::SendGetTypeFromExtension(
148 : const nsCString& aFileExtension,
149 : nsCString* type) -> bool
150 : {
151 0 : IPC::Message* msg__ = PHandlerService::Msg_GetTypeFromExtension(Id());
152 :
153 0 : Write(aFileExtension, msg__);
154 : // Sentinel = 'aFileExtension'
155 0 : (msg__)->WriteSentinel(2406627352);
156 :
157 0 : (msg__)->set_sync();
158 :
159 :
160 0 : Message reply__;
161 :
162 0 : if (mozilla::ipc::LoggingEnabledFor("PHandlerServiceChild")) {
163 0 : mozilla::ipc::LogMessageForProtocol("PHandlerServiceChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
164 : }
165 0 : AUTO_PROFILER_LABEL("PHandlerService::Msg_GetTypeFromExtension", OTHER);
166 0 : PHandlerService::Transition(PHandlerService::Msg_GetTypeFromExtension__ID, (&(mState)));
167 :
168 : bool sendok__;
169 : {
170 : AutoProfilerTracing syncIPCTracer(
171 : "IPC",
172 0 : "PHandlerService::Msg_GetTypeFromExtension");
173 0 : sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__)));
174 : }
175 0 : if ((!(sendok__))) {
176 0 : return false;
177 : }
178 :
179 0 : if (mozilla::ipc::LoggingEnabledFor("PHandlerServiceChild")) {
180 0 : mozilla::ipc::LogMessageForProtocol("PHandlerServiceChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
181 : }
182 :
183 0 : PickleIterator iter__(reply__);
184 :
185 0 : if ((!(Read(type, (&(reply__)), (&(iter__)))))) {
186 0 : FatalError("Error deserializing 'nsCString'");
187 0 : return false;
188 : }
189 : // Sentinel = 'type'
190 0 : if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 2982068540)))) {
191 0 : mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
192 0 : return false;
193 : }
194 0 : (reply__).EndRead(iter__, (reply__).type());
195 :
196 0 : return true;
197 : }
198 :
199 0 : auto PHandlerServiceChild::Send__delete__(PHandlerServiceChild* actor) -> bool
200 : {
201 0 : if ((!(actor))) {
202 0 : return false;
203 : }
204 :
205 0 : IPC::Message* msg__ = PHandlerService::Msg___delete__((actor)->Id());
206 :
207 0 : (actor)->Write(actor, msg__, false);
208 : // Sentinel = 'actor'
209 0 : (msg__)->WriteSentinel(875202478);
210 :
211 :
212 :
213 0 : if (mozilla::ipc::LoggingEnabledFor("PHandlerServiceChild")) {
214 0 : mozilla::ipc::LogMessageForProtocol("PHandlerServiceChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
215 : }
216 0 : AUTO_PROFILER_LABEL("PHandlerService::Msg___delete__", OTHER);
217 0 : PHandlerService::Transition(PHandlerService::Msg___delete____ID, (&((actor)->mState)));
218 :
219 0 : bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
220 :
221 0 : IProtocol* mgr = (actor)->Manager();
222 0 : (actor)->DestroySubtree(Deletion);
223 0 : (actor)->DeallocSubtree();
224 0 : (mgr)->RemoveManagee(PHandlerServiceMsgStart, actor);
225 0 : return sendok__;
226 : }
227 :
228 0 : auto PHandlerServiceChild::RemoveManagee(
229 : int32_t aProtocolId,
230 : ProtocolBase* aListener) -> void
231 : {
232 0 : FatalError("unreached");
233 0 : return;
234 : }
235 :
236 0 : auto PHandlerServiceChild::OnMessageReceived(const Message& msg__) -> PHandlerServiceChild::Result
237 : {
238 0 : switch ((msg__).type()) {
239 : case PHandlerService::Reply___delete____ID:
240 : {
241 0 : return MsgProcessed;
242 : }
243 : default:
244 : {
245 0 : return MsgNotKnown;
246 : }
247 : }
248 : }
249 :
250 0 : auto PHandlerServiceChild::OnMessageReceived(
251 : const Message& msg__,
252 : Message*& reply__) -> PHandlerServiceChild::Result
253 : {
254 0 : return MsgNotKnown;
255 : }
256 :
257 0 : auto PHandlerServiceChild::OnCallReceived(
258 : const Message& msg__,
259 : Message*& reply__) -> PHandlerServiceChild::Result
260 : {
261 0 : MOZ_ASSERT_UNREACHABLE("message protocol not supported");
262 : return MsgNotKnown;
263 : }
264 :
265 0 : auto PHandlerServiceChild::GetProtocolTypeId() -> int32_t
266 : {
267 0 : return PHandlerServiceMsgStart;
268 : }
269 :
270 0 : auto PHandlerServiceChild::ProtocolName() const -> const char*
271 : {
272 0 : return "PHandlerServiceChild";
273 : }
274 :
275 0 : auto PHandlerServiceChild::DestroySubtree(ActorDestroyReason why) -> void
276 : {
277 : // Unregister from our manager.
278 0 : Unregister(Id());
279 :
280 : // Reject owning pending promises.
281 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
282 :
283 : // Finally, destroy "us".
284 0 : ActorDestroy(why);
285 0 : }
286 :
287 0 : auto PHandlerServiceChild::DeallocSubtree() -> void
288 : {
289 0 : }
290 :
291 0 : auto PHandlerServiceChild::Write(
292 : const PHandlerServiceChild* v__,
293 : Message* msg__,
294 : bool nullable__) -> void
295 : {
296 : int32_t id;
297 0 : if ((!(v__))) {
298 0 : if ((!(nullable__))) {
299 0 : FatalError("NULL actor value passed to non-nullable param");
300 : }
301 0 : id = 0;
302 : }
303 : else {
304 0 : id = (v__)->Id();
305 0 : if ((1) == (id)) {
306 0 : FatalError("actor has been |delete|d");
307 : }
308 : }
309 :
310 0 : Write(id, msg__);
311 0 : }
312 :
313 0 : auto PHandlerServiceChild::Read(
314 : PHandlerServiceChild** v__,
315 : const Message* msg__,
316 : PickleIterator* iter__,
317 : bool nullable__) -> bool
318 : {
319 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PHandlerService", PHandlerServiceMsgStart);
320 0 : if ((actor).isNothing()) {
321 0 : return false;
322 : }
323 :
324 0 : (*(v__)) = static_cast<PHandlerServiceChild*>((actor).value());
325 0 : return true;
326 : }
327 :
328 0 : auto PHandlerServiceChild::Write(
329 : const HandlerInfo& v__,
330 : Message* msg__) -> void
331 : {
332 0 : Write((v__).type(), msg__);
333 : // Sentinel = 'type'
334 0 : (msg__)->WriteSentinel(2982068540);
335 0 : Write((v__).isMIMEInfo(), msg__);
336 : // Sentinel = 'isMIMEInfo'
337 0 : (msg__)->WriteSentinel(1069536950);
338 0 : Write((v__).description(), msg__);
339 : // Sentinel = 'description'
340 0 : (msg__)->WriteSentinel(962879941);
341 0 : Write((v__).alwaysAskBeforeHandling(), msg__);
342 : // Sentinel = 'alwaysAskBeforeHandling'
343 0 : (msg__)->WriteSentinel(1120635835);
344 0 : Write((v__).preferredApplicationHandler(), msg__);
345 : // Sentinel = 'preferredApplicationHandler'
346 0 : (msg__)->WriteSentinel(2543375802);
347 0 : Write((v__).possibleApplicationHandlers(), msg__);
348 : // Sentinel = 'possibleApplicationHandlers'
349 0 : (msg__)->WriteSentinel(608941865);
350 0 : Write((v__).preferredAction(), msg__);
351 : // Sentinel = 'preferredAction'
352 0 : (msg__)->WriteSentinel(3465546922);
353 0 : }
354 :
355 0 : auto PHandlerServiceChild::Read(
356 : HandlerInfo* v__,
357 : const Message* msg__,
358 : PickleIterator* iter__) -> bool
359 : {
360 0 : if ((!(Read((&((v__)->type())), msg__, iter__)))) {
361 0 : FatalError("Error deserializing 'type' (nsCString) member of 'HandlerInfo'");
362 0 : return false;
363 : }
364 : // Sentinel = 'type'
365 0 : if ((!((msg__)->ReadSentinel(iter__, 2982068540)))) {
366 0 : mozilla::ipc::SentinelReadError("Error deserializing 'type' (nsCString) member of 'HandlerInfo'");
367 0 : return false;
368 : }
369 0 : if ((!(Read((&((v__)->isMIMEInfo())), msg__, iter__)))) {
370 0 : FatalError("Error deserializing 'isMIMEInfo' (bool) member of 'HandlerInfo'");
371 0 : return false;
372 : }
373 : // Sentinel = 'isMIMEInfo'
374 0 : if ((!((msg__)->ReadSentinel(iter__, 1069536950)))) {
375 0 : mozilla::ipc::SentinelReadError("Error deserializing 'isMIMEInfo' (bool) member of 'HandlerInfo'");
376 0 : return false;
377 : }
378 0 : if ((!(Read((&((v__)->description())), msg__, iter__)))) {
379 0 : FatalError("Error deserializing 'description' (nsString) member of 'HandlerInfo'");
380 0 : return false;
381 : }
382 : // Sentinel = 'description'
383 0 : if ((!((msg__)->ReadSentinel(iter__, 962879941)))) {
384 0 : mozilla::ipc::SentinelReadError("Error deserializing 'description' (nsString) member of 'HandlerInfo'");
385 0 : return false;
386 : }
387 0 : if ((!(Read((&((v__)->alwaysAskBeforeHandling())), msg__, iter__)))) {
388 0 : FatalError("Error deserializing 'alwaysAskBeforeHandling' (bool) member of 'HandlerInfo'");
389 0 : return false;
390 : }
391 : // Sentinel = 'alwaysAskBeforeHandling'
392 0 : if ((!((msg__)->ReadSentinel(iter__, 1120635835)))) {
393 0 : mozilla::ipc::SentinelReadError("Error deserializing 'alwaysAskBeforeHandling' (bool) member of 'HandlerInfo'");
394 0 : return false;
395 : }
396 0 : if ((!(Read((&((v__)->preferredApplicationHandler())), msg__, iter__)))) {
397 0 : FatalError("Error deserializing 'preferredApplicationHandler' (HandlerApp) member of 'HandlerInfo'");
398 0 : return false;
399 : }
400 : // Sentinel = 'preferredApplicationHandler'
401 0 : if ((!((msg__)->ReadSentinel(iter__, 2543375802)))) {
402 0 : mozilla::ipc::SentinelReadError("Error deserializing 'preferredApplicationHandler' (HandlerApp) member of 'HandlerInfo'");
403 0 : return false;
404 : }
405 0 : if ((!(Read((&((v__)->possibleApplicationHandlers())), msg__, iter__)))) {
406 0 : FatalError("Error deserializing 'possibleApplicationHandlers' (HandlerApp[]) member of 'HandlerInfo'");
407 0 : return false;
408 : }
409 : // Sentinel = 'possibleApplicationHandlers'
410 0 : if ((!((msg__)->ReadSentinel(iter__, 608941865)))) {
411 0 : mozilla::ipc::SentinelReadError("Error deserializing 'possibleApplicationHandlers' (HandlerApp[]) member of 'HandlerInfo'");
412 0 : return false;
413 : }
414 0 : if ((!(Read((&((v__)->preferredAction())), msg__, iter__)))) {
415 0 : FatalError("Error deserializing 'preferredAction' (long) member of 'HandlerInfo'");
416 0 : return false;
417 : }
418 : // Sentinel = 'preferredAction'
419 0 : if ((!((msg__)->ReadSentinel(iter__, 3465546922)))) {
420 0 : mozilla::ipc::SentinelReadError("Error deserializing 'preferredAction' (long) member of 'HandlerInfo'");
421 0 : return false;
422 : }
423 0 : return true;
424 : }
425 :
426 0 : auto PHandlerServiceChild::Write(
427 : const nsTArray<HandlerApp>& v__,
428 : Message* msg__) -> void
429 : {
430 0 : uint32_t length = (v__).Length();
431 0 : Write(length, msg__);
432 : // Sentinel = ('length', 'HandlerApp[]')
433 0 : (msg__)->WriteSentinel(2475415906);
434 :
435 0 : for (auto& elem : v__) {
436 0 : Write(elem, msg__);
437 : // Sentinel = 'HandlerApp[]'
438 0 : (msg__)->WriteSentinel(3933538253);
439 : }
440 0 : }
441 :
442 0 : auto PHandlerServiceChild::Read(
443 : nsTArray<HandlerApp>* v__,
444 : const Message* msg__,
445 : PickleIterator* iter__) -> bool
446 : {
447 0 : nsTArray<HandlerApp> fa;
448 : uint32_t length;
449 0 : if ((!(Read((&(length)), msg__, iter__)))) {
450 0 : mozilla::ipc::ArrayLengthReadError("HandlerApp[]");
451 0 : return false;
452 : }
453 : // Sentinel = ('length', 'HandlerApp[]')
454 0 : if ((!((msg__)->ReadSentinel(iter__, 2475415906)))) {
455 0 : mozilla::ipc::SentinelReadError("HandlerApp[]");
456 0 : return false;
457 : }
458 :
459 0 : HandlerApp* elems = (fa).AppendElements(length);
460 0 : for (uint32_t i = 0; (i) < (length); (++(i))) {
461 0 : if ((!(Read((&(elems[i])), msg__, iter__)))) {
462 0 : FatalError("Error deserializing 'HandlerApp[i]'");
463 0 : return false;
464 : }
465 : // Sentinel = 'HandlerApp[]'
466 0 : if ((!((msg__)->ReadSentinel(iter__, 3933538253)))) {
467 0 : mozilla::ipc::SentinelReadError("Error deserializing 'HandlerApp[i]'");
468 0 : return false;
469 : }
470 : }
471 0 : (v__)->SwapElements(fa);
472 0 : return true;
473 : }
474 :
475 0 : auto PHandlerServiceChild::Write(
476 : const HandlerApp& v__,
477 : Message* msg__) -> void
478 : {
479 0 : Write((v__).name(), msg__);
480 : // Sentinel = 'name'
481 0 : (msg__)->WriteSentinel(15034981);
482 0 : Write((v__).detailedDescription(), msg__);
483 : // Sentinel = 'detailedDescription'
484 0 : (msg__)->WriteSentinel(4289276469);
485 0 : }
486 :
487 0 : auto PHandlerServiceChild::Read(
488 : HandlerApp* v__,
489 : const Message* msg__,
490 : PickleIterator* iter__) -> bool
491 : {
492 0 : if ((!(Read((&((v__)->name())), msg__, iter__)))) {
493 0 : FatalError("Error deserializing 'name' (nsString) member of 'HandlerApp'");
494 0 : return false;
495 : }
496 : // Sentinel = 'name'
497 0 : if ((!((msg__)->ReadSentinel(iter__, 15034981)))) {
498 0 : mozilla::ipc::SentinelReadError("Error deserializing 'name' (nsString) member of 'HandlerApp'");
499 0 : return false;
500 : }
501 0 : if ((!(Read((&((v__)->detailedDescription())), msg__, iter__)))) {
502 0 : FatalError("Error deserializing 'detailedDescription' (nsString) member of 'HandlerApp'");
503 0 : return false;
504 : }
505 : // Sentinel = 'detailedDescription'
506 0 : if ((!((msg__)->ReadSentinel(iter__, 4289276469)))) {
507 0 : mozilla::ipc::SentinelReadError("Error deserializing 'detailedDescription' (nsString) member of 'HandlerApp'");
508 0 : return false;
509 : }
510 0 : return true;
511 : }
512 :
513 :
514 :
515 : } // namespace dom
516 : } // namespace mozilla
|