1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/dom/sms/PSmsParent.h"
8 :
9 : #include "mozilla/dom/PContentParent.h"
10 :
11 : typedef IPC::Message Message;
12 : typedef mozilla::ipc::RPCChannel Channel;
13 : typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
14 : typedef base::ProcessHandle ProcessHandle;
15 : typedef mozilla::ipc::AsyncChannel AsyncChannel;
16 : typedef mozilla::ipc::SharedMemory SharedMemory;
17 : typedef mozilla::ipc::Trigger Trigger;
18 : typedef mozilla::ipc::ActorHandle ActorHandle;
19 : typedef mozilla::dom::sms::SmsMessageData SmsMessageData;
20 : typedef mozilla::dom::sms::SmsFilterData SmsFilterData;
21 : typedef mozilla::ipc::Shmem Shmem;
22 : using mozilla::dom::PContentParent;
23 :
24 : namespace mozilla {
25 : namespace dom {
26 : namespace sms {
27 :
28 :
29 : bool
30 0 : PSmsParent::Recv__delete__()
31 : {
32 0 : return true;
33 : }
34 :
35 : void
36 0 : PSmsParent::ActorDestroy(ActorDestroyReason why)
37 : {
38 0 : }
39 :
40 0 : PSmsParent::PSmsParent() :
41 : mId(0),
42 0 : mState(PSms::__Dead)
43 : {
44 0 : MOZ_COUNT_CTOR(PSmsParent);
45 0 : }
46 :
47 0 : PSmsParent::~PSmsParent()
48 : {
49 0 : MOZ_COUNT_DTOR(PSmsParent);
50 0 : }
51 :
52 : PContentParent*
53 0 : PSmsParent::Manager()
54 : {
55 0 : return static_cast<PContentParent*>(mManager);
56 : }
57 :
58 : PSms::State
59 0 : PSmsParent::state()
60 : {
61 0 : return mState;
62 : }
63 :
64 : bool
65 0 : PSmsParent::SendNotifyReceivedMessage(const SmsMessageData& aMessageData)
66 : {
67 0 : PSms::Msg_NotifyReceivedMessage* __msg = new PSms::Msg_NotifyReceivedMessage();
68 :
69 0 : Write(aMessageData, __msg);
70 :
71 0 : (__msg)->set_routing_id(mId);
72 :
73 :
74 :
75 0 : if (mozilla::ipc::LoggingEnabled()) {
76 0 : (__msg)->Log("[PSmsParent] Sending ", stderr);
77 : }
78 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Send, PSms::Msg_NotifyReceivedMessage__ID), (&(mState)))))) {
79 0 : NS_WARNING("bad state transition!");
80 : }
81 :
82 0 : bool __sendok = (mChannel)->Send(__msg);
83 0 : return __sendok;
84 : }
85 :
86 : bool
87 0 : PSmsParent::SendNotifySentMessage(const SmsMessageData& aMessageData)
88 : {
89 0 : PSms::Msg_NotifySentMessage* __msg = new PSms::Msg_NotifySentMessage();
90 :
91 0 : Write(aMessageData, __msg);
92 :
93 0 : (__msg)->set_routing_id(mId);
94 :
95 :
96 :
97 0 : if (mozilla::ipc::LoggingEnabled()) {
98 0 : (__msg)->Log("[PSmsParent] Sending ", stderr);
99 : }
100 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Send, PSms::Msg_NotifySentMessage__ID), (&(mState)))))) {
101 0 : NS_WARNING("bad state transition!");
102 : }
103 :
104 0 : bool __sendok = (mChannel)->Send(__msg);
105 0 : return __sendok;
106 : }
107 :
108 : bool
109 0 : PSmsParent::SendNotifyDeliveredMessage(const SmsMessageData& aMessageData)
110 : {
111 0 : PSms::Msg_NotifyDeliveredMessage* __msg = new PSms::Msg_NotifyDeliveredMessage();
112 :
113 0 : Write(aMessageData, __msg);
114 :
115 0 : (__msg)->set_routing_id(mId);
116 :
117 :
118 :
119 0 : if (mozilla::ipc::LoggingEnabled()) {
120 0 : (__msg)->Log("[PSmsParent] Sending ", stderr);
121 : }
122 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Send, PSms::Msg_NotifyDeliveredMessage__ID), (&(mState)))))) {
123 0 : NS_WARNING("bad state transition!");
124 : }
125 :
126 0 : bool __sendok = (mChannel)->Send(__msg);
127 0 : return __sendok;
128 : }
129 :
130 : bool
131 0 : PSmsParent::SendNotifyRequestSmsSent(
132 : const SmsMessageData& aMessageData,
133 : const PRInt32& aRequestId,
134 : const PRUint64& aProcessId)
135 : {
136 0 : PSms::Msg_NotifyRequestSmsSent* __msg = new PSms::Msg_NotifyRequestSmsSent();
137 :
138 0 : Write(aMessageData, __msg);
139 0 : Write(aRequestId, __msg);
140 0 : Write(aProcessId, __msg);
141 :
142 0 : (__msg)->set_routing_id(mId);
143 :
144 :
145 :
146 0 : if (mozilla::ipc::LoggingEnabled()) {
147 0 : (__msg)->Log("[PSmsParent] Sending ", stderr);
148 : }
149 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Send, PSms::Msg_NotifyRequestSmsSent__ID), (&(mState)))))) {
150 0 : NS_WARNING("bad state transition!");
151 : }
152 :
153 0 : bool __sendok = (mChannel)->Send(__msg);
154 0 : return __sendok;
155 : }
156 :
157 : bool
158 0 : PSmsParent::SendNotifyRequestSmsSendFailed(
159 : const PRInt32& aError,
160 : const PRInt32& aRequestId,
161 : const PRUint64& aProcessId)
162 : {
163 0 : PSms::Msg_NotifyRequestSmsSendFailed* __msg = new PSms::Msg_NotifyRequestSmsSendFailed();
164 :
165 0 : Write(aError, __msg);
166 0 : Write(aRequestId, __msg);
167 0 : Write(aProcessId, __msg);
168 :
169 0 : (__msg)->set_routing_id(mId);
170 :
171 :
172 :
173 0 : if (mozilla::ipc::LoggingEnabled()) {
174 0 : (__msg)->Log("[PSmsParent] Sending ", stderr);
175 : }
176 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Send, PSms::Msg_NotifyRequestSmsSendFailed__ID), (&(mState)))))) {
177 0 : NS_WARNING("bad state transition!");
178 : }
179 :
180 0 : bool __sendok = (mChannel)->Send(__msg);
181 0 : return __sendok;
182 : }
183 :
184 : bool
185 0 : PSmsParent::SendNotifyRequestGotSms(
186 : const SmsMessageData& aMessageData,
187 : const PRInt32& aRequestId,
188 : const PRUint64& aProcessId)
189 : {
190 0 : PSms::Msg_NotifyRequestGotSms* __msg = new PSms::Msg_NotifyRequestGotSms();
191 :
192 0 : Write(aMessageData, __msg);
193 0 : Write(aRequestId, __msg);
194 0 : Write(aProcessId, __msg);
195 :
196 0 : (__msg)->set_routing_id(mId);
197 :
198 :
199 :
200 0 : if (mozilla::ipc::LoggingEnabled()) {
201 0 : (__msg)->Log("[PSmsParent] Sending ", stderr);
202 : }
203 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Send, PSms::Msg_NotifyRequestGotSms__ID), (&(mState)))))) {
204 0 : NS_WARNING("bad state transition!");
205 : }
206 :
207 0 : bool __sendok = (mChannel)->Send(__msg);
208 0 : return __sendok;
209 : }
210 :
211 : bool
212 0 : PSmsParent::SendNotifyRequestGetSmsFailed(
213 : const PRInt32& aError,
214 : const PRInt32& aRequestId,
215 : const PRUint64& aProcessId)
216 : {
217 0 : PSms::Msg_NotifyRequestGetSmsFailed* __msg = new PSms::Msg_NotifyRequestGetSmsFailed();
218 :
219 0 : Write(aError, __msg);
220 0 : Write(aRequestId, __msg);
221 0 : Write(aProcessId, __msg);
222 :
223 0 : (__msg)->set_routing_id(mId);
224 :
225 :
226 :
227 0 : if (mozilla::ipc::LoggingEnabled()) {
228 0 : (__msg)->Log("[PSmsParent] Sending ", stderr);
229 : }
230 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Send, PSms::Msg_NotifyRequestGetSmsFailed__ID), (&(mState)))))) {
231 0 : NS_WARNING("bad state transition!");
232 : }
233 :
234 0 : bool __sendok = (mChannel)->Send(__msg);
235 0 : return __sendok;
236 : }
237 :
238 : bool
239 0 : PSmsParent::SendNotifyRequestSmsDeleted(
240 : const bool& aDeleted,
241 : const PRInt32& aRequestId,
242 : const PRUint64& aProcessId)
243 : {
244 0 : PSms::Msg_NotifyRequestSmsDeleted* __msg = new PSms::Msg_NotifyRequestSmsDeleted();
245 :
246 0 : Write(aDeleted, __msg);
247 0 : Write(aRequestId, __msg);
248 0 : Write(aProcessId, __msg);
249 :
250 0 : (__msg)->set_routing_id(mId);
251 :
252 :
253 :
254 0 : if (mozilla::ipc::LoggingEnabled()) {
255 0 : (__msg)->Log("[PSmsParent] Sending ", stderr);
256 : }
257 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Send, PSms::Msg_NotifyRequestSmsDeleted__ID), (&(mState)))))) {
258 0 : NS_WARNING("bad state transition!");
259 : }
260 :
261 0 : bool __sendok = (mChannel)->Send(__msg);
262 0 : return __sendok;
263 : }
264 :
265 : bool
266 0 : PSmsParent::SendNotifyRequestSmsDeleteFailed(
267 : const PRInt32& aError,
268 : const PRInt32& aRequestId,
269 : const PRUint64& aProcessId)
270 : {
271 0 : PSms::Msg_NotifyRequestSmsDeleteFailed* __msg = new PSms::Msg_NotifyRequestSmsDeleteFailed();
272 :
273 0 : Write(aError, __msg);
274 0 : Write(aRequestId, __msg);
275 0 : Write(aProcessId, __msg);
276 :
277 0 : (__msg)->set_routing_id(mId);
278 :
279 :
280 :
281 0 : if (mozilla::ipc::LoggingEnabled()) {
282 0 : (__msg)->Log("[PSmsParent] Sending ", stderr);
283 : }
284 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Send, PSms::Msg_NotifyRequestSmsDeleteFailed__ID), (&(mState)))))) {
285 0 : NS_WARNING("bad state transition!");
286 : }
287 :
288 0 : bool __sendok = (mChannel)->Send(__msg);
289 0 : return __sendok;
290 : }
291 :
292 : bool
293 0 : PSmsParent::SendNotifyRequestNoMessageInList(
294 : const PRInt32& aRequestId,
295 : const PRUint64& aProcessId)
296 : {
297 0 : PSms::Msg_NotifyRequestNoMessageInList* __msg = new PSms::Msg_NotifyRequestNoMessageInList();
298 :
299 0 : Write(aRequestId, __msg);
300 0 : Write(aProcessId, __msg);
301 :
302 0 : (__msg)->set_routing_id(mId);
303 :
304 :
305 :
306 0 : if (mozilla::ipc::LoggingEnabled()) {
307 0 : (__msg)->Log("[PSmsParent] Sending ", stderr);
308 : }
309 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Send, PSms::Msg_NotifyRequestNoMessageInList__ID), (&(mState)))))) {
310 0 : NS_WARNING("bad state transition!");
311 : }
312 :
313 0 : bool __sendok = (mChannel)->Send(__msg);
314 0 : return __sendok;
315 : }
316 :
317 : bool
318 0 : PSmsParent::SendNotifyRequestCreateMessageList(
319 : const PRInt32& aListId,
320 : const SmsMessageData& aMessageData,
321 : const PRInt32& aRequestId,
322 : const PRUint64& aProcessId)
323 : {
324 0 : PSms::Msg_NotifyRequestCreateMessageList* __msg = new PSms::Msg_NotifyRequestCreateMessageList();
325 :
326 0 : Write(aListId, __msg);
327 0 : Write(aMessageData, __msg);
328 0 : Write(aRequestId, __msg);
329 0 : Write(aProcessId, __msg);
330 :
331 0 : (__msg)->set_routing_id(mId);
332 :
333 :
334 :
335 0 : if (mozilla::ipc::LoggingEnabled()) {
336 0 : (__msg)->Log("[PSmsParent] Sending ", stderr);
337 : }
338 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Send, PSms::Msg_NotifyRequestCreateMessageList__ID), (&(mState)))))) {
339 0 : NS_WARNING("bad state transition!");
340 : }
341 :
342 0 : bool __sendok = (mChannel)->Send(__msg);
343 0 : return __sendok;
344 : }
345 :
346 : bool
347 0 : PSmsParent::SendNotifyRequestGotNextMessage(
348 : const SmsMessageData& aMessageData,
349 : const PRInt32& aRequestId,
350 : const PRUint64& aProcessId)
351 : {
352 0 : PSms::Msg_NotifyRequestGotNextMessage* __msg = new PSms::Msg_NotifyRequestGotNextMessage();
353 :
354 0 : Write(aMessageData, __msg);
355 0 : Write(aRequestId, __msg);
356 0 : Write(aProcessId, __msg);
357 :
358 0 : (__msg)->set_routing_id(mId);
359 :
360 :
361 :
362 0 : if (mozilla::ipc::LoggingEnabled()) {
363 0 : (__msg)->Log("[PSmsParent] Sending ", stderr);
364 : }
365 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Send, PSms::Msg_NotifyRequestGotNextMessage__ID), (&(mState)))))) {
366 0 : NS_WARNING("bad state transition!");
367 : }
368 :
369 0 : bool __sendok = (mChannel)->Send(__msg);
370 0 : return __sendok;
371 : }
372 :
373 : bool
374 0 : PSmsParent::SendNotifyRequestReadListFailed(
375 : const PRInt32& aError,
376 : const PRInt32& aRequestId,
377 : const PRUint64& aProcessId)
378 : {
379 0 : PSms::Msg_NotifyRequestReadListFailed* __msg = new PSms::Msg_NotifyRequestReadListFailed();
380 :
381 0 : Write(aError, __msg);
382 0 : Write(aRequestId, __msg);
383 0 : Write(aProcessId, __msg);
384 :
385 0 : (__msg)->set_routing_id(mId);
386 :
387 :
388 :
389 0 : if (mozilla::ipc::LoggingEnabled()) {
390 0 : (__msg)->Log("[PSmsParent] Sending ", stderr);
391 : }
392 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Send, PSms::Msg_NotifyRequestReadListFailed__ID), (&(mState)))))) {
393 0 : NS_WARNING("bad state transition!");
394 : }
395 :
396 0 : bool __sendok = (mChannel)->Send(__msg);
397 0 : return __sendok;
398 : }
399 :
400 : int32
401 0 : PSmsParent::Register(ChannelListener* aRouted)
402 : {
403 0 : return (mManager)->Register(aRouted);
404 : }
405 :
406 : int32
407 0 : PSmsParent::RegisterID(
408 : ChannelListener* aRouted,
409 : int32 aId)
410 : {
411 0 : return (mManager)->RegisterID(aRouted, aId);
412 : }
413 :
414 : ChannelListener*
415 0 : PSmsParent::Lookup(int32 aId)
416 : {
417 0 : return (mManager)->Lookup(aId);
418 : }
419 :
420 : void
421 0 : PSmsParent::Unregister(int32 aId)
422 : {
423 0 : return (mManager)->Unregister(aId);
424 : }
425 :
426 : void
427 0 : PSmsParent::RemoveManagee(
428 : int32 aProtocolId,
429 : ChannelListener* aListener)
430 : {
431 0 : NS_RUNTIMEABORT("unreached");
432 : return;
433 : }
434 :
435 : Shmem::SharedMemory*
436 0 : PSmsParent::CreateSharedMemory(
437 : size_t aSize,
438 : Shmem::SharedMemory::SharedMemoryType type,
439 : bool unsafe,
440 : Shmem::id_t* aId)
441 : {
442 0 : return (mManager)->CreateSharedMemory(aSize, type, unsafe, aId);
443 : }
444 :
445 : bool
446 0 : PSmsParent::AdoptSharedMemory(
447 : Shmem::SharedMemory* segment,
448 : Shmem::id_t* aId)
449 : {
450 0 : return (mManager)->AdoptSharedMemory(segment, aId);
451 : }
452 :
453 : Shmem::SharedMemory*
454 0 : PSmsParent::LookupSharedMemory(Shmem::id_t aId)
455 : {
456 0 : return (mManager)->LookupSharedMemory(aId);
457 : }
458 :
459 : bool
460 0 : PSmsParent::IsTrackingSharedMemory(Shmem::SharedMemory* segment)
461 : {
462 0 : return (mManager)->IsTrackingSharedMemory(segment);
463 : }
464 :
465 : bool
466 0 : PSmsParent::DestroySharedMemory(Shmem& aShmem)
467 : {
468 0 : return (mManager)->DestroySharedMemory(aShmem);
469 : }
470 :
471 : ProcessHandle
472 0 : PSmsParent::OtherProcess() const
473 : {
474 0 : return (mManager)->OtherProcess();
475 : }
476 :
477 : AsyncChannel*
478 0 : PSmsParent::GetIPCChannel()
479 : {
480 0 : return mChannel;
481 : }
482 :
483 : PSmsParent::Result
484 0 : PSmsParent::OnMessageReceived(const Message& __msg)
485 : {
486 0 : switch ((__msg).type()) {
487 : case PSms::Msg_SendMessage__ID:
488 : {
489 0 : (const_cast<Message&>(__msg)).set_name("PSms::Msg_SendMessage");
490 0 : if (mozilla::ipc::LoggingEnabled()) {
491 0 : (static_cast<const PSms::Msg_SendMessage*>((&(__msg))))->Log("[PSmsParent] Received ", stderr);
492 : }
493 :
494 0 : void* __iter = 0;
495 0 : nsString aNumber;
496 0 : nsString aMessage;
497 : PRInt32 aRequestId;
498 : PRUint64 aProcessId;
499 :
500 0 : if ((!(Read((&(aNumber)), (&(__msg)), (&(__iter)))))) {
501 0 : FatalError("error deserializing (better message TODO)");
502 0 : return MsgValueError;
503 : }
504 0 : if ((!(Read((&(aMessage)), (&(__msg)), (&(__iter)))))) {
505 0 : FatalError("error deserializing (better message TODO)");
506 0 : return MsgValueError;
507 : }
508 0 : if ((!(Read((&(aRequestId)), (&(__msg)), (&(__iter)))))) {
509 0 : FatalError("error deserializing (better message TODO)");
510 0 : return MsgValueError;
511 : }
512 0 : if ((!(Read((&(aProcessId)), (&(__msg)), (&(__iter)))))) {
513 0 : FatalError("error deserializing (better message TODO)");
514 0 : return MsgValueError;
515 : }
516 0 : (__msg).EndRead(__iter);
517 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Recv, PSms::Msg_SendMessage__ID), (&(mState)))))) {
518 0 : NS_WARNING("bad state transition!");
519 : }
520 0 : if ((!(RecvSendMessage(aNumber, aMessage, aRequestId, aProcessId)))) {
521 0 : return MsgProcessingError;
522 : }
523 :
524 0 : return MsgProcessed;
525 : }
526 : case PSms::Msg_GetMessage__ID:
527 : {
528 0 : (const_cast<Message&>(__msg)).set_name("PSms::Msg_GetMessage");
529 0 : if (mozilla::ipc::LoggingEnabled()) {
530 0 : (static_cast<const PSms::Msg_GetMessage*>((&(__msg))))->Log("[PSmsParent] Received ", stderr);
531 : }
532 :
533 0 : void* __iter = 0;
534 : PRInt32 aMessageId;
535 : PRInt32 aRequestId;
536 : PRUint64 aProcessId;
537 :
538 0 : if ((!(Read((&(aMessageId)), (&(__msg)), (&(__iter)))))) {
539 0 : FatalError("error deserializing (better message TODO)");
540 0 : return MsgValueError;
541 : }
542 0 : if ((!(Read((&(aRequestId)), (&(__msg)), (&(__iter)))))) {
543 0 : FatalError("error deserializing (better message TODO)");
544 0 : return MsgValueError;
545 : }
546 0 : if ((!(Read((&(aProcessId)), (&(__msg)), (&(__iter)))))) {
547 0 : FatalError("error deserializing (better message TODO)");
548 0 : return MsgValueError;
549 : }
550 0 : (__msg).EndRead(__iter);
551 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Recv, PSms::Msg_GetMessage__ID), (&(mState)))))) {
552 0 : NS_WARNING("bad state transition!");
553 : }
554 0 : if ((!(RecvGetMessage(aMessageId, aRequestId, aProcessId)))) {
555 0 : return MsgProcessingError;
556 : }
557 :
558 0 : return MsgProcessed;
559 : }
560 : case PSms::Msg_DeleteMessage__ID:
561 : {
562 0 : (const_cast<Message&>(__msg)).set_name("PSms::Msg_DeleteMessage");
563 0 : if (mozilla::ipc::LoggingEnabled()) {
564 0 : (static_cast<const PSms::Msg_DeleteMessage*>((&(__msg))))->Log("[PSmsParent] Received ", stderr);
565 : }
566 :
567 0 : void* __iter = 0;
568 : PRInt32 aMessageId;
569 : PRInt32 aRequestId;
570 : PRUint64 aProcessId;
571 :
572 0 : if ((!(Read((&(aMessageId)), (&(__msg)), (&(__iter)))))) {
573 0 : FatalError("error deserializing (better message TODO)");
574 0 : return MsgValueError;
575 : }
576 0 : if ((!(Read((&(aRequestId)), (&(__msg)), (&(__iter)))))) {
577 0 : FatalError("error deserializing (better message TODO)");
578 0 : return MsgValueError;
579 : }
580 0 : if ((!(Read((&(aProcessId)), (&(__msg)), (&(__iter)))))) {
581 0 : FatalError("error deserializing (better message TODO)");
582 0 : return MsgValueError;
583 : }
584 0 : (__msg).EndRead(__iter);
585 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Recv, PSms::Msg_DeleteMessage__ID), (&(mState)))))) {
586 0 : NS_WARNING("bad state transition!");
587 : }
588 0 : if ((!(RecvDeleteMessage(aMessageId, aRequestId, aProcessId)))) {
589 0 : return MsgProcessingError;
590 : }
591 :
592 0 : return MsgProcessed;
593 : }
594 : case PSms::Msg_CreateMessageList__ID:
595 : {
596 0 : (const_cast<Message&>(__msg)).set_name("PSms::Msg_CreateMessageList");
597 0 : if (mozilla::ipc::LoggingEnabled()) {
598 0 : (static_cast<const PSms::Msg_CreateMessageList*>((&(__msg))))->Log("[PSmsParent] Received ", stderr);
599 : }
600 :
601 0 : void* __iter = 0;
602 0 : SmsFilterData aFilter;
603 : bool aReverse;
604 : PRInt32 aRequestId;
605 : PRUint64 aProcessId;
606 :
607 0 : if ((!(Read((&(aFilter)), (&(__msg)), (&(__iter)))))) {
608 0 : FatalError("error deserializing (better message TODO)");
609 0 : return MsgValueError;
610 : }
611 0 : if ((!(Read((&(aReverse)), (&(__msg)), (&(__iter)))))) {
612 0 : FatalError("error deserializing (better message TODO)");
613 0 : return MsgValueError;
614 : }
615 0 : if ((!(Read((&(aRequestId)), (&(__msg)), (&(__iter)))))) {
616 0 : FatalError("error deserializing (better message TODO)");
617 0 : return MsgValueError;
618 : }
619 0 : if ((!(Read((&(aProcessId)), (&(__msg)), (&(__iter)))))) {
620 0 : FatalError("error deserializing (better message TODO)");
621 0 : return MsgValueError;
622 : }
623 0 : (__msg).EndRead(__iter);
624 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Recv, PSms::Msg_CreateMessageList__ID), (&(mState)))))) {
625 0 : NS_WARNING("bad state transition!");
626 : }
627 0 : if ((!(RecvCreateMessageList(aFilter, aReverse, aRequestId, aProcessId)))) {
628 0 : return MsgProcessingError;
629 : }
630 :
631 0 : return MsgProcessed;
632 : }
633 : case PSms::Msg_GetNextMessageInList__ID:
634 : {
635 0 : (const_cast<Message&>(__msg)).set_name("PSms::Msg_GetNextMessageInList");
636 0 : if (mozilla::ipc::LoggingEnabled()) {
637 0 : (static_cast<const PSms::Msg_GetNextMessageInList*>((&(__msg))))->Log("[PSmsParent] Received ", stderr);
638 : }
639 :
640 0 : void* __iter = 0;
641 : PRInt32 aListId;
642 : PRInt32 aRequestId;
643 : PRUint64 aProcessId;
644 :
645 0 : if ((!(Read((&(aListId)), (&(__msg)), (&(__iter)))))) {
646 0 : FatalError("error deserializing (better message TODO)");
647 0 : return MsgValueError;
648 : }
649 0 : if ((!(Read((&(aRequestId)), (&(__msg)), (&(__iter)))))) {
650 0 : FatalError("error deserializing (better message TODO)");
651 0 : return MsgValueError;
652 : }
653 0 : if ((!(Read((&(aProcessId)), (&(__msg)), (&(__iter)))))) {
654 0 : FatalError("error deserializing (better message TODO)");
655 0 : return MsgValueError;
656 : }
657 0 : (__msg).EndRead(__iter);
658 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Recv, PSms::Msg_GetNextMessageInList__ID), (&(mState)))))) {
659 0 : NS_WARNING("bad state transition!");
660 : }
661 0 : if ((!(RecvGetNextMessageInList(aListId, aRequestId, aProcessId)))) {
662 0 : return MsgProcessingError;
663 : }
664 :
665 0 : return MsgProcessed;
666 : }
667 : case PSms::Msg_ClearMessageList__ID:
668 : {
669 0 : (const_cast<Message&>(__msg)).set_name("PSms::Msg_ClearMessageList");
670 0 : if (mozilla::ipc::LoggingEnabled()) {
671 0 : (static_cast<const PSms::Msg_ClearMessageList*>((&(__msg))))->Log("[PSmsParent] Received ", stderr);
672 : }
673 :
674 0 : void* __iter = 0;
675 : PRInt32 aListId;
676 :
677 0 : if ((!(Read((&(aListId)), (&(__msg)), (&(__iter)))))) {
678 0 : FatalError("error deserializing (better message TODO)");
679 0 : return MsgValueError;
680 : }
681 0 : (__msg).EndRead(__iter);
682 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Recv, PSms::Msg_ClearMessageList__ID), (&(mState)))))) {
683 0 : NS_WARNING("bad state transition!");
684 : }
685 0 : if ((!(RecvClearMessageList(aListId)))) {
686 0 : return MsgProcessingError;
687 : }
688 :
689 0 : return MsgProcessed;
690 : }
691 : case PSms::Msg___delete____ID:
692 : {
693 0 : (const_cast<Message&>(__msg)).set_name("PSms::Msg___delete__");
694 0 : if (mozilla::ipc::LoggingEnabled()) {
695 0 : (static_cast<const PSms::Msg___delete__*>((&(__msg))))->Log("[PSmsParent] Received ", stderr);
696 : }
697 :
698 0 : void* __iter = 0;
699 : PSmsParent* actor;
700 :
701 0 : if ((!(Read((&(actor)), (&(__msg)), (&(__iter)), false)))) {
702 0 : FatalError("error deserializing (better message TODO)");
703 0 : return MsgValueError;
704 : }
705 0 : (__msg).EndRead(__iter);
706 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Recv, PSms::Msg___delete____ID), (&(mState)))))) {
707 0 : NS_WARNING("bad state transition!");
708 : }
709 0 : if ((!(Recv__delete__()))) {
710 0 : return MsgProcessingError;
711 : }
712 :
713 0 : (actor)->DestroySubtree(Deletion);
714 0 : (actor)->DeallocSubtree();
715 0 : ((actor)->mManager)->RemoveManagee(PSmsMsgStart, actor);
716 :
717 :
718 0 : return MsgProcessed;
719 : }
720 : default:
721 : {
722 0 : return MsgNotKnown;
723 : }
724 : }
725 : }
726 :
727 : PSmsParent::Result
728 0 : PSmsParent::OnMessageReceived(
729 : const Message& __msg,
730 : Message*& __reply)
731 : {
732 0 : switch ((__msg).type()) {
733 : case PSms::Msg_HasSupport__ID:
734 : {
735 0 : (const_cast<Message&>(__msg)).set_name("PSms::Msg_HasSupport");
736 0 : if (mozilla::ipc::LoggingEnabled()) {
737 0 : (static_cast<const PSms::Msg_HasSupport*>((&(__msg))))->Log("[PSmsParent] Received ", stderr);
738 : }
739 :
740 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Recv, PSms::Msg_HasSupport__ID), (&(mState)))))) {
741 0 : NS_WARNING("bad state transition!");
742 : }
743 : bool aHasSupport;
744 0 : int32 __id = mId;
745 0 : if ((!(RecvHasSupport((&(aHasSupport)))))) {
746 0 : return MsgProcessingError;
747 : }
748 :
749 0 : __reply = new PSms::Reply_HasSupport();
750 :
751 0 : Write(aHasSupport, __reply);
752 0 : (__reply)->set_routing_id(__id);
753 0 : (__reply)->set_sync();
754 0 : (__reply)->set_reply();
755 :
756 0 : if (mozilla::ipc::LoggingEnabled()) {
757 0 : (static_cast<const PSms::Reply_HasSupport*>(__reply))->Log("[PSmsParent] Sending reply ", stderr);
758 : }
759 0 : return MsgProcessed;
760 : }
761 : case PSms::Msg_GetNumberOfMessagesForText__ID:
762 : {
763 0 : (const_cast<Message&>(__msg)).set_name("PSms::Msg_GetNumberOfMessagesForText");
764 0 : if (mozilla::ipc::LoggingEnabled()) {
765 0 : (static_cast<const PSms::Msg_GetNumberOfMessagesForText*>((&(__msg))))->Log("[PSmsParent] Received ", stderr);
766 : }
767 :
768 0 : void* __iter = 0;
769 0 : nsString aText;
770 :
771 0 : if ((!(Read((&(aText)), (&(__msg)), (&(__iter)))))) {
772 0 : FatalError("error deserializing (better message TODO)");
773 0 : return MsgValueError;
774 : }
775 0 : (__msg).EndRead(__iter);
776 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Recv, PSms::Msg_GetNumberOfMessagesForText__ID), (&(mState)))))) {
777 0 : NS_WARNING("bad state transition!");
778 : }
779 : PRUint16 aNumber;
780 0 : int32 __id = mId;
781 0 : if ((!(RecvGetNumberOfMessagesForText(aText, (&(aNumber)))))) {
782 0 : return MsgProcessingError;
783 : }
784 :
785 0 : __reply = new PSms::Reply_GetNumberOfMessagesForText();
786 :
787 0 : Write(aNumber, __reply);
788 0 : (__reply)->set_routing_id(__id);
789 0 : (__reply)->set_sync();
790 0 : (__reply)->set_reply();
791 :
792 0 : if (mozilla::ipc::LoggingEnabled()) {
793 0 : (static_cast<const PSms::Reply_GetNumberOfMessagesForText*>(__reply))->Log("[PSmsParent] Sending reply ", stderr);
794 : }
795 0 : return MsgProcessed;
796 : }
797 : case PSms::Msg_SaveReceivedMessage__ID:
798 : {
799 0 : (const_cast<Message&>(__msg)).set_name("PSms::Msg_SaveReceivedMessage");
800 0 : if (mozilla::ipc::LoggingEnabled()) {
801 0 : (static_cast<const PSms::Msg_SaveReceivedMessage*>((&(__msg))))->Log("[PSmsParent] Received ", stderr);
802 : }
803 :
804 0 : void* __iter = 0;
805 0 : nsString aSender;
806 0 : nsString aBody;
807 : PRUint64 aDate;
808 :
809 0 : if ((!(Read((&(aSender)), (&(__msg)), (&(__iter)))))) {
810 0 : FatalError("error deserializing (better message TODO)");
811 0 : return MsgValueError;
812 : }
813 0 : if ((!(Read((&(aBody)), (&(__msg)), (&(__iter)))))) {
814 0 : FatalError("error deserializing (better message TODO)");
815 0 : return MsgValueError;
816 : }
817 0 : if ((!(Read((&(aDate)), (&(__msg)), (&(__iter)))))) {
818 0 : FatalError("error deserializing (better message TODO)");
819 0 : return MsgValueError;
820 : }
821 0 : (__msg).EndRead(__iter);
822 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Recv, PSms::Msg_SaveReceivedMessage__ID), (&(mState)))))) {
823 0 : NS_WARNING("bad state transition!");
824 : }
825 : PRInt32 aId;
826 0 : int32 __id = mId;
827 0 : if ((!(RecvSaveReceivedMessage(aSender, aBody, aDate, (&(aId)))))) {
828 0 : return MsgProcessingError;
829 : }
830 :
831 0 : __reply = new PSms::Reply_SaveReceivedMessage();
832 :
833 0 : Write(aId, __reply);
834 0 : (__reply)->set_routing_id(__id);
835 0 : (__reply)->set_sync();
836 0 : (__reply)->set_reply();
837 :
838 0 : if (mozilla::ipc::LoggingEnabled()) {
839 0 : (static_cast<const PSms::Reply_SaveReceivedMessage*>(__reply))->Log("[PSmsParent] Sending reply ", stderr);
840 : }
841 0 : return MsgProcessed;
842 : }
843 : case PSms::Msg_SaveSentMessage__ID:
844 : {
845 0 : (const_cast<Message&>(__msg)).set_name("PSms::Msg_SaveSentMessage");
846 0 : if (mozilla::ipc::LoggingEnabled()) {
847 0 : (static_cast<const PSms::Msg_SaveSentMessage*>((&(__msg))))->Log("[PSmsParent] Received ", stderr);
848 : }
849 :
850 0 : void* __iter = 0;
851 0 : nsString aReceiver;
852 0 : nsString aBody;
853 : PRUint64 aDate;
854 :
855 0 : if ((!(Read((&(aReceiver)), (&(__msg)), (&(__iter)))))) {
856 0 : FatalError("error deserializing (better message TODO)");
857 0 : return MsgValueError;
858 : }
859 0 : if ((!(Read((&(aBody)), (&(__msg)), (&(__iter)))))) {
860 0 : FatalError("error deserializing (better message TODO)");
861 0 : return MsgValueError;
862 : }
863 0 : if ((!(Read((&(aDate)), (&(__msg)), (&(__iter)))))) {
864 0 : FatalError("error deserializing (better message TODO)");
865 0 : return MsgValueError;
866 : }
867 0 : (__msg).EndRead(__iter);
868 0 : if ((!(PSms::Transition(mState, Trigger(Trigger::Recv, PSms::Msg_SaveSentMessage__ID), (&(mState)))))) {
869 0 : NS_WARNING("bad state transition!");
870 : }
871 : PRInt32 aId;
872 0 : int32 __id = mId;
873 0 : if ((!(RecvSaveSentMessage(aReceiver, aBody, aDate, (&(aId)))))) {
874 0 : return MsgProcessingError;
875 : }
876 :
877 0 : __reply = new PSms::Reply_SaveSentMessage();
878 :
879 0 : Write(aId, __reply);
880 0 : (__reply)->set_routing_id(__id);
881 0 : (__reply)->set_sync();
882 0 : (__reply)->set_reply();
883 :
884 0 : if (mozilla::ipc::LoggingEnabled()) {
885 0 : (static_cast<const PSms::Reply_SaveSentMessage*>(__reply))->Log("[PSmsParent] Sending reply ", stderr);
886 : }
887 0 : return MsgProcessed;
888 : }
889 : default:
890 : {
891 0 : return MsgNotKnown;
892 : }
893 : }
894 : }
895 :
896 : PSmsParent::Result
897 0 : PSmsParent::OnCallReceived(
898 : const Message& __msg,
899 : Message*& __reply)
900 : {
901 0 : return MsgNotKnown;
902 : }
903 :
904 : void
905 0 : PSmsParent::OnProcessingError(Result code)
906 : {
907 0 : NS_RUNTIMEABORT("`OnProcessingError' called on non-toplevel actor");
908 0 : }
909 :
910 : bool
911 0 : PSmsParent::OnReplyTimeout()
912 : {
913 0 : NS_RUNTIMEABORT("`OnReplyTimeout' called on non-toplevel actor");
914 0 : return false;
915 : }
916 :
917 : void
918 0 : PSmsParent::OnChannelClose()
919 : {
920 0 : NS_RUNTIMEABORT("`OnClose' called on non-toplevel actor");
921 0 : }
922 :
923 : void
924 0 : PSmsParent::OnChannelError()
925 : {
926 0 : NS_RUNTIMEABORT("`OnError' called on non-toplevel actor");
927 0 : }
928 :
929 : void
930 0 : PSmsParent::OnChannelConnected(int32 pid)
931 : {
932 0 : NS_RUNTIMEABORT("'OnConnected' called on non-toplevel actor");
933 0 : }
934 :
935 : bool
936 0 : PSmsParent::AllocShmem(
937 : size_t aSize,
938 : Shmem::SharedMemory::SharedMemoryType aType,
939 : Shmem* aMem)
940 : {
941 : Shmem::id_t aId;
942 0 : nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, false, (&(aId))));
943 0 : if ((!(rawmem))) {
944 0 : return false;
945 : }
946 :
947 0 : (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
948 0 : return true;
949 : }
950 :
951 : bool
952 0 : PSmsParent::AllocUnsafeShmem(
953 : size_t aSize,
954 : Shmem::SharedMemory::SharedMemoryType aType,
955 : Shmem* aMem)
956 : {
957 : Shmem::id_t aId;
958 0 : nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, true, (&(aId))));
959 0 : if ((!(rawmem))) {
960 0 : return false;
961 : }
962 :
963 0 : (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
964 0 : return true;
965 : }
966 :
967 : bool
968 0 : PSmsParent::AdoptShmem(
969 : Shmem& aMem,
970 : Shmem* aOutMem)
971 : {
972 0 : Shmem::SharedMemory* rawmem = (aMem).Segment(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
973 0 : if (((!(rawmem))) || (IsTrackingSharedMemory(rawmem))) {
974 0 : NS_RUNTIMEABORT("bad Shmem");
975 : }
976 :
977 : Shmem::id_t aId;
978 0 : if ((!(AdoptSharedMemory(rawmem, (&(aId)))))) {
979 0 : return false;
980 : }
981 :
982 0 : (*(aOutMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), rawmem, aId);
983 0 : return true;
984 : }
985 :
986 : bool
987 0 : PSmsParent::DeallocShmem(Shmem& aMem)
988 : {
989 0 : bool ok = DestroySharedMemory(aMem);
990 0 : (aMem).forget(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
991 0 : return ok;
992 : }
993 :
994 : void
995 0 : PSmsParent::FatalError(const char* const msg) const
996 : {
997 : // Virtual method to prevent inlining.
998 : // This give us better error reporting.
999 : // See bug 589371
1000 :
1001 0 : NS_ERROR("IPDL error:");
1002 0 : NS_ERROR(msg);
1003 :
1004 0 : NS_ERROR("[PSmsParent] killing child side as a result");
1005 :
1006 0 : if ((!(base::KillProcess(OtherProcess(), base::PROCESS_END_KILLED_BY_USER, false)))) {
1007 0 : NS_ERROR(" may have failed to kill child!");
1008 : }
1009 0 : }
1010 :
1011 : void
1012 0 : PSmsParent::DestroySubtree(ActorDestroyReason why)
1013 : {
1014 : // Unregister from our manager.
1015 0 : Unregister(mId);
1016 0 : mId = 1;
1017 :
1018 : // Finally, destroy "us".
1019 0 : ActorDestroy(why);
1020 0 : }
1021 :
1022 : void
1023 0 : PSmsParent::DeallocSubtree()
1024 : {
1025 0 : }
1026 :
1027 : void
1028 0 : PSmsParent::Write(
1029 : const SmsMessageData& __v,
1030 : Message* __msg)
1031 : {
1032 0 : Write((__v).id(), __msg);
1033 0 : Write((__v).delivery(), __msg);
1034 0 : Write((__v).sender(), __msg);
1035 0 : Write((__v).receiver(), __msg);
1036 0 : Write((__v).body(), __msg);
1037 0 : Write((__v).timestamp(), __msg);
1038 0 : }
1039 :
1040 : bool
1041 0 : PSmsParent::Read(
1042 : SmsMessageData* __v,
1043 : const Message* __msg,
1044 : void** __iter)
1045 : {
1046 0 : if ((!(Read((&((__v)->id())), __msg, __iter)))) {
1047 0 : return false;
1048 : }
1049 0 : if ((!(Read((&((__v)->delivery())), __msg, __iter)))) {
1050 0 : return false;
1051 : }
1052 0 : if ((!(Read((&((__v)->sender())), __msg, __iter)))) {
1053 0 : return false;
1054 : }
1055 0 : if ((!(Read((&((__v)->receiver())), __msg, __iter)))) {
1056 0 : return false;
1057 : }
1058 0 : if ((!(Read((&((__v)->body())), __msg, __iter)))) {
1059 0 : return false;
1060 : }
1061 0 : if ((!(Read((&((__v)->timestamp())), __msg, __iter)))) {
1062 0 : return false;
1063 : }
1064 0 : return true;
1065 : }
1066 :
1067 : void
1068 0 : PSmsParent::Write(
1069 : const SmsFilterData& __v,
1070 : Message* __msg)
1071 : {
1072 0 : Write((__v).startDate(), __msg);
1073 0 : Write((__v).endDate(), __msg);
1074 0 : Write((__v).numbers(), __msg);
1075 0 : Write((__v).delivery(), __msg);
1076 0 : }
1077 :
1078 : bool
1079 0 : PSmsParent::Read(
1080 : SmsFilterData* __v,
1081 : const Message* __msg,
1082 : void** __iter)
1083 : {
1084 0 : if ((!(Read((&((__v)->startDate())), __msg, __iter)))) {
1085 0 : return false;
1086 : }
1087 0 : if ((!(Read((&((__v)->endDate())), __msg, __iter)))) {
1088 0 : return false;
1089 : }
1090 0 : if ((!(Read((&((__v)->numbers())), __msg, __iter)))) {
1091 0 : return false;
1092 : }
1093 0 : if ((!(Read((&((__v)->delivery())), __msg, __iter)))) {
1094 0 : return false;
1095 : }
1096 0 : return true;
1097 : }
1098 :
1099 : void
1100 0 : PSmsParent::Write(
1101 : PSmsParent* __v,
1102 : Message* __msg,
1103 : bool __nullable)
1104 : {
1105 : int32 id;
1106 0 : if ((!(__v))) {
1107 0 : if ((!(__nullable))) {
1108 0 : NS_RUNTIMEABORT("NULL actor value passed to non-nullable param");
1109 : }
1110 0 : id = 0;
1111 : }
1112 : else {
1113 0 : id = (__v)->mId;
1114 0 : if ((1) == (id)) {
1115 0 : NS_RUNTIMEABORT("actor has been |delete|d");
1116 : }
1117 : }
1118 :
1119 0 : Write(id, __msg);
1120 0 : }
1121 :
1122 : bool
1123 0 : PSmsParent::Read(
1124 : PSmsParent** __v,
1125 : const Message* __msg,
1126 : void** __iter,
1127 : bool __nullable)
1128 : {
1129 : int32 id;
1130 0 : if ((!(Read((&(id)), __msg, __iter)))) {
1131 0 : return false;
1132 : }
1133 0 : if (((1) == (id)) || (((0) == (id)) && ((!(__nullable))))) {
1134 0 : return false;
1135 : }
1136 :
1137 0 : if ((0) == (id)) {
1138 0 : (*(__v)) = 0;
1139 : }
1140 : else {
1141 0 : (*(__v)) = static_cast<PSmsParent*>(Lookup(id));
1142 0 : if ((!((*(__v))))) {
1143 0 : return false;
1144 : }
1145 : }
1146 0 : return true;
1147 : }
1148 :
1149 :
1150 :
1151 : } // namespace sms
1152 : } // namespace dom
1153 : } // namespace mozilla
|