1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/hal_sandbox/PHalParent.h"
8 :
9 : #include "mozilla/dom/PContentParent.h"
10 : #include "mozilla/dom/PBrowserParent.h"
11 :
12 : typedef IPC::Message Message;
13 : typedef mozilla::ipc::RPCChannel Channel;
14 : typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
15 : typedef base::ProcessHandle ProcessHandle;
16 : typedef mozilla::ipc::AsyncChannel AsyncChannel;
17 : typedef mozilla::ipc::SharedMemory SharedMemory;
18 : typedef mozilla::ipc::Trigger Trigger;
19 : typedef mozilla::ipc::ActorHandle ActorHandle;
20 : typedef mozilla::hal::BatteryInformation BatteryInformation;
21 : typedef mozilla::hal::LightConfiguration LightConfiguration;
22 : typedef mozilla::hal::SensorData SensorData;
23 : typedef mozilla::hal::NetworkInformation NetworkInformation;
24 : typedef mozilla::hal::WakeLockInformation WakeLockInformation;
25 : typedef mozilla::ipc::Shmem Shmem;
26 : typedef mozilla::hal::FlashMode FlashMode;
27 : typedef mozilla::hal::LightType LightType;
28 : typedef mozilla::hal::LightMode LightMode;
29 : typedef mozilla::hal::SensorType SensorType;
30 : typedef mozilla::hal::WakeLockControl WakeLockControl;
31 : using mozilla::dom::PContentParent;
32 : using mozilla::dom::PBrowserParent;
33 :
34 : namespace mozilla {
35 : namespace hal_sandbox {
36 :
37 :
38 : bool
39 0 : PHalParent::Recv__delete__()
40 : {
41 0 : return true;
42 : }
43 :
44 : void
45 0 : PHalParent::ActorDestroy(ActorDestroyReason why)
46 : {
47 0 : }
48 :
49 0 : PHalParent::PHalParent() :
50 : mId(0),
51 0 : mState(PHal::__Dead)
52 : {
53 0 : MOZ_COUNT_CTOR(PHalParent);
54 0 : }
55 :
56 0 : PHalParent::~PHalParent()
57 : {
58 0 : MOZ_COUNT_DTOR(PHalParent);
59 0 : }
60 :
61 : PContentParent*
62 0 : PHalParent::Manager()
63 : {
64 0 : return static_cast<PContentParent*>(mManager);
65 : }
66 :
67 : PHal::State
68 0 : PHalParent::state()
69 : {
70 0 : return mState;
71 : }
72 :
73 : bool
74 0 : PHalParent::SendNotifyBatteryChange(const BatteryInformation& aBatteryInfo)
75 : {
76 0 : PHal::Msg_NotifyBatteryChange* __msg = new PHal::Msg_NotifyBatteryChange();
77 :
78 0 : Write(aBatteryInfo, __msg);
79 :
80 0 : (__msg)->set_routing_id(mId);
81 :
82 :
83 :
84 0 : if (mozilla::ipc::LoggingEnabled()) {
85 0 : (__msg)->Log("[PHalParent] Sending ", stderr);
86 : }
87 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Send, PHal::Msg_NotifyBatteryChange__ID), (&(mState)))))) {
88 0 : NS_WARNING("bad state transition!");
89 : }
90 :
91 0 : bool __sendok = (mChannel)->Send(__msg);
92 0 : return __sendok;
93 : }
94 :
95 : bool
96 0 : PHalParent::SendNotifyNetworkChange(const NetworkInformation& aNetworkInfo)
97 : {
98 0 : PHal::Msg_NotifyNetworkChange* __msg = new PHal::Msg_NotifyNetworkChange();
99 :
100 0 : Write(aNetworkInfo, __msg);
101 :
102 0 : (__msg)->set_routing_id(mId);
103 :
104 :
105 :
106 0 : if (mozilla::ipc::LoggingEnabled()) {
107 0 : (__msg)->Log("[PHalParent] Sending ", stderr);
108 : }
109 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Send, PHal::Msg_NotifyNetworkChange__ID), (&(mState)))))) {
110 0 : NS_WARNING("bad state transition!");
111 : }
112 :
113 0 : bool __sendok = (mChannel)->Send(__msg);
114 0 : return __sendok;
115 : }
116 :
117 : bool
118 0 : PHalParent::SendNotifyWakeLockChange(const WakeLockInformation& aWakeLockInfo)
119 : {
120 0 : PHal::Msg_NotifyWakeLockChange* __msg = new PHal::Msg_NotifyWakeLockChange();
121 :
122 0 : Write(aWakeLockInfo, __msg);
123 :
124 0 : (__msg)->set_routing_id(mId);
125 :
126 :
127 :
128 0 : if (mozilla::ipc::LoggingEnabled()) {
129 0 : (__msg)->Log("[PHalParent] Sending ", stderr);
130 : }
131 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Send, PHal::Msg_NotifyWakeLockChange__ID), (&(mState)))))) {
132 0 : NS_WARNING("bad state transition!");
133 : }
134 :
135 0 : bool __sendok = (mChannel)->Send(__msg);
136 0 : return __sendok;
137 : }
138 :
139 : bool
140 0 : PHalParent::SendNotifySensorChange(const SensorData& aSensorData)
141 : {
142 0 : PHal::Msg_NotifySensorChange* __msg = new PHal::Msg_NotifySensorChange();
143 :
144 0 : Write(aSensorData, __msg);
145 :
146 0 : (__msg)->set_routing_id(mId);
147 :
148 :
149 :
150 0 : if (mozilla::ipc::LoggingEnabled()) {
151 0 : (__msg)->Log("[PHalParent] Sending ", stderr);
152 : }
153 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Send, PHal::Msg_NotifySensorChange__ID), (&(mState)))))) {
154 0 : NS_WARNING("bad state transition!");
155 : }
156 :
157 0 : bool __sendok = (mChannel)->Send(__msg);
158 0 : return __sendok;
159 : }
160 :
161 : int32
162 0 : PHalParent::Register(ChannelListener* aRouted)
163 : {
164 0 : return (mManager)->Register(aRouted);
165 : }
166 :
167 : int32
168 0 : PHalParent::RegisterID(
169 : ChannelListener* aRouted,
170 : int32 aId)
171 : {
172 0 : return (mManager)->RegisterID(aRouted, aId);
173 : }
174 :
175 : ChannelListener*
176 0 : PHalParent::Lookup(int32 aId)
177 : {
178 0 : return (mManager)->Lookup(aId);
179 : }
180 :
181 : void
182 0 : PHalParent::Unregister(int32 aId)
183 : {
184 0 : return (mManager)->Unregister(aId);
185 : }
186 :
187 : void
188 0 : PHalParent::RemoveManagee(
189 : int32 aProtocolId,
190 : ChannelListener* aListener)
191 : {
192 0 : NS_RUNTIMEABORT("unreached");
193 : return;
194 : }
195 :
196 : Shmem::SharedMemory*
197 0 : PHalParent::CreateSharedMemory(
198 : size_t aSize,
199 : Shmem::SharedMemory::SharedMemoryType type,
200 : bool unsafe,
201 : Shmem::id_t* aId)
202 : {
203 0 : return (mManager)->CreateSharedMemory(aSize, type, unsafe, aId);
204 : }
205 :
206 : bool
207 0 : PHalParent::AdoptSharedMemory(
208 : Shmem::SharedMemory* segment,
209 : Shmem::id_t* aId)
210 : {
211 0 : return (mManager)->AdoptSharedMemory(segment, aId);
212 : }
213 :
214 : Shmem::SharedMemory*
215 0 : PHalParent::LookupSharedMemory(Shmem::id_t aId)
216 : {
217 0 : return (mManager)->LookupSharedMemory(aId);
218 : }
219 :
220 : bool
221 0 : PHalParent::IsTrackingSharedMemory(Shmem::SharedMemory* segment)
222 : {
223 0 : return (mManager)->IsTrackingSharedMemory(segment);
224 : }
225 :
226 : bool
227 0 : PHalParent::DestroySharedMemory(Shmem& aShmem)
228 : {
229 0 : return (mManager)->DestroySharedMemory(aShmem);
230 : }
231 :
232 : ProcessHandle
233 0 : PHalParent::OtherProcess() const
234 : {
235 0 : return (mManager)->OtherProcess();
236 : }
237 :
238 : AsyncChannel*
239 0 : PHalParent::GetIPCChannel()
240 : {
241 0 : return mChannel;
242 : }
243 :
244 : PHalParent::Result
245 0 : PHalParent::OnMessageReceived(const Message& __msg)
246 : {
247 0 : switch ((__msg).type()) {
248 : case PHal::Msg_Vibrate__ID:
249 : {
250 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_Vibrate");
251 0 : if (mozilla::ipc::LoggingEnabled()) {
252 0 : (static_cast<const PHal::Msg_Vibrate*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
253 : }
254 :
255 0 : void* __iter = 0;
256 0 : InfallibleTArray<uint32> pattern;
257 0 : InfallibleTArray<uint64> id;
258 : PBrowserParent* browser;
259 :
260 0 : if ((!(Read((&(pattern)), (&(__msg)), (&(__iter)))))) {
261 0 : FatalError("error deserializing (better message TODO)");
262 0 : return MsgValueError;
263 : }
264 0 : if ((!(Read((&(id)), (&(__msg)), (&(__iter)))))) {
265 0 : FatalError("error deserializing (better message TODO)");
266 0 : return MsgValueError;
267 : }
268 0 : if ((!(Read((&(browser)), (&(__msg)), (&(__iter)), false)))) {
269 0 : FatalError("error deserializing (better message TODO)");
270 0 : return MsgValueError;
271 : }
272 0 : (__msg).EndRead(__iter);
273 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_Vibrate__ID), (&(mState)))))) {
274 0 : NS_WARNING("bad state transition!");
275 : }
276 0 : if ((!(RecvVibrate(pattern, id, browser)))) {
277 0 : return MsgProcessingError;
278 : }
279 :
280 0 : return MsgProcessed;
281 : }
282 : case PHal::Msg_CancelVibrate__ID:
283 : {
284 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_CancelVibrate");
285 0 : if (mozilla::ipc::LoggingEnabled()) {
286 0 : (static_cast<const PHal::Msg_CancelVibrate*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
287 : }
288 :
289 0 : void* __iter = 0;
290 0 : InfallibleTArray<uint64> id;
291 : PBrowserParent* browser;
292 :
293 0 : if ((!(Read((&(id)), (&(__msg)), (&(__iter)))))) {
294 0 : FatalError("error deserializing (better message TODO)");
295 0 : return MsgValueError;
296 : }
297 0 : if ((!(Read((&(browser)), (&(__msg)), (&(__iter)), false)))) {
298 0 : FatalError("error deserializing (better message TODO)");
299 0 : return MsgValueError;
300 : }
301 0 : (__msg).EndRead(__iter);
302 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_CancelVibrate__ID), (&(mState)))))) {
303 0 : NS_WARNING("bad state transition!");
304 : }
305 0 : if ((!(RecvCancelVibrate(id, browser)))) {
306 0 : return MsgProcessingError;
307 : }
308 :
309 0 : return MsgProcessed;
310 : }
311 : case PHal::Msg_EnableBatteryNotifications__ID:
312 : {
313 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_EnableBatteryNotifications");
314 0 : if (mozilla::ipc::LoggingEnabled()) {
315 0 : (static_cast<const PHal::Msg_EnableBatteryNotifications*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
316 : }
317 :
318 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_EnableBatteryNotifications__ID), (&(mState)))))) {
319 0 : NS_WARNING("bad state transition!");
320 : }
321 0 : if ((!(RecvEnableBatteryNotifications()))) {
322 0 : return MsgProcessingError;
323 : }
324 :
325 0 : return MsgProcessed;
326 : }
327 : case PHal::Msg_DisableBatteryNotifications__ID:
328 : {
329 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_DisableBatteryNotifications");
330 0 : if (mozilla::ipc::LoggingEnabled()) {
331 0 : (static_cast<const PHal::Msg_DisableBatteryNotifications*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
332 : }
333 :
334 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_DisableBatteryNotifications__ID), (&(mState)))))) {
335 0 : NS_WARNING("bad state transition!");
336 : }
337 0 : if ((!(RecvDisableBatteryNotifications()))) {
338 0 : return MsgProcessingError;
339 : }
340 :
341 0 : return MsgProcessed;
342 : }
343 : case PHal::Msg_EnableNetworkNotifications__ID:
344 : {
345 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_EnableNetworkNotifications");
346 0 : if (mozilla::ipc::LoggingEnabled()) {
347 0 : (static_cast<const PHal::Msg_EnableNetworkNotifications*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
348 : }
349 :
350 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_EnableNetworkNotifications__ID), (&(mState)))))) {
351 0 : NS_WARNING("bad state transition!");
352 : }
353 0 : if ((!(RecvEnableNetworkNotifications()))) {
354 0 : return MsgProcessingError;
355 : }
356 :
357 0 : return MsgProcessed;
358 : }
359 : case PHal::Msg_DisableNetworkNotifications__ID:
360 : {
361 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_DisableNetworkNotifications");
362 0 : if (mozilla::ipc::LoggingEnabled()) {
363 0 : (static_cast<const PHal::Msg_DisableNetworkNotifications*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
364 : }
365 :
366 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_DisableNetworkNotifications__ID), (&(mState)))))) {
367 0 : NS_WARNING("bad state transition!");
368 : }
369 0 : if ((!(RecvDisableNetworkNotifications()))) {
370 0 : return MsgProcessingError;
371 : }
372 :
373 0 : return MsgProcessed;
374 : }
375 : case PHal::Msg_SetScreenEnabled__ID:
376 : {
377 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_SetScreenEnabled");
378 0 : if (mozilla::ipc::LoggingEnabled()) {
379 0 : (static_cast<const PHal::Msg_SetScreenEnabled*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
380 : }
381 :
382 0 : void* __iter = 0;
383 : bool enabled;
384 :
385 0 : if ((!(Read((&(enabled)), (&(__msg)), (&(__iter)))))) {
386 0 : FatalError("error deserializing (better message TODO)");
387 0 : return MsgValueError;
388 : }
389 0 : (__msg).EndRead(__iter);
390 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_SetScreenEnabled__ID), (&(mState)))))) {
391 0 : NS_WARNING("bad state transition!");
392 : }
393 0 : if ((!(RecvSetScreenEnabled(enabled)))) {
394 0 : return MsgProcessingError;
395 : }
396 :
397 0 : return MsgProcessed;
398 : }
399 : case PHal::Msg_SetScreenBrightness__ID:
400 : {
401 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_SetScreenBrightness");
402 0 : if (mozilla::ipc::LoggingEnabled()) {
403 0 : (static_cast<const PHal::Msg_SetScreenBrightness*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
404 : }
405 :
406 0 : void* __iter = 0;
407 : double brightness;
408 :
409 0 : if ((!(Read((&(brightness)), (&(__msg)), (&(__iter)))))) {
410 0 : FatalError("error deserializing (better message TODO)");
411 0 : return MsgValueError;
412 : }
413 0 : (__msg).EndRead(__iter);
414 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_SetScreenBrightness__ID), (&(mState)))))) {
415 0 : NS_WARNING("bad state transition!");
416 : }
417 0 : if ((!(RecvSetScreenBrightness(brightness)))) {
418 0 : return MsgProcessingError;
419 : }
420 :
421 0 : return MsgProcessed;
422 : }
423 : case PHal::Msg_AdjustSystemClock__ID:
424 : {
425 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_AdjustSystemClock");
426 0 : if (mozilla::ipc::LoggingEnabled()) {
427 0 : (static_cast<const PHal::Msg_AdjustSystemClock*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
428 : }
429 :
430 0 : void* __iter = 0;
431 : int32 aDeltaMilliseconds;
432 :
433 0 : if ((!(Read((&(aDeltaMilliseconds)), (&(__msg)), (&(__iter)))))) {
434 0 : FatalError("error deserializing (better message TODO)");
435 0 : return MsgValueError;
436 : }
437 0 : (__msg).EndRead(__iter);
438 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_AdjustSystemClock__ID), (&(mState)))))) {
439 0 : NS_WARNING("bad state transition!");
440 : }
441 0 : if ((!(RecvAdjustSystemClock(aDeltaMilliseconds)))) {
442 0 : return MsgProcessingError;
443 : }
444 :
445 0 : return MsgProcessed;
446 : }
447 : case PHal::Msg_SetTimezone__ID:
448 : {
449 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_SetTimezone");
450 0 : if (mozilla::ipc::LoggingEnabled()) {
451 0 : (static_cast<const PHal::Msg_SetTimezone*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
452 : }
453 :
454 0 : void* __iter = 0;
455 0 : nsCString aTimezoneSpec;
456 :
457 0 : if ((!(Read((&(aTimezoneSpec)), (&(__msg)), (&(__iter)))))) {
458 0 : FatalError("error deserializing (better message TODO)");
459 0 : return MsgValueError;
460 : }
461 0 : (__msg).EndRead(__iter);
462 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_SetTimezone__ID), (&(mState)))))) {
463 0 : NS_WARNING("bad state transition!");
464 : }
465 0 : if ((!(RecvSetTimezone(aTimezoneSpec)))) {
466 0 : return MsgProcessingError;
467 : }
468 :
469 0 : return MsgProcessed;
470 : }
471 : case PHal::Msg_Reboot__ID:
472 : {
473 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_Reboot");
474 0 : if (mozilla::ipc::LoggingEnabled()) {
475 0 : (static_cast<const PHal::Msg_Reboot*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
476 : }
477 :
478 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_Reboot__ID), (&(mState)))))) {
479 0 : NS_WARNING("bad state transition!");
480 : }
481 0 : if ((!(RecvReboot()))) {
482 0 : return MsgProcessingError;
483 : }
484 :
485 0 : return MsgProcessed;
486 : }
487 : case PHal::Msg_PowerOff__ID:
488 : {
489 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_PowerOff");
490 0 : if (mozilla::ipc::LoggingEnabled()) {
491 0 : (static_cast<const PHal::Msg_PowerOff*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
492 : }
493 :
494 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_PowerOff__ID), (&(mState)))))) {
495 0 : NS_WARNING("bad state transition!");
496 : }
497 0 : if ((!(RecvPowerOff()))) {
498 0 : return MsgProcessingError;
499 : }
500 :
501 0 : return MsgProcessed;
502 : }
503 : case PHal::Msg_ModifyWakeLock__ID:
504 : {
505 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_ModifyWakeLock");
506 0 : if (mozilla::ipc::LoggingEnabled()) {
507 0 : (static_cast<const PHal::Msg_ModifyWakeLock*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
508 : }
509 :
510 0 : void* __iter = 0;
511 0 : nsString aTopic;
512 : WakeLockControl aLockAdjust;
513 : WakeLockControl aHiddenAdjust;
514 :
515 0 : if ((!(Read((&(aTopic)), (&(__msg)), (&(__iter)))))) {
516 0 : FatalError("error deserializing (better message TODO)");
517 0 : return MsgValueError;
518 : }
519 0 : if ((!(Read((&(aLockAdjust)), (&(__msg)), (&(__iter)))))) {
520 0 : FatalError("error deserializing (better message TODO)");
521 0 : return MsgValueError;
522 : }
523 0 : if ((!(Read((&(aHiddenAdjust)), (&(__msg)), (&(__iter)))))) {
524 0 : FatalError("error deserializing (better message TODO)");
525 0 : return MsgValueError;
526 : }
527 0 : (__msg).EndRead(__iter);
528 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_ModifyWakeLock__ID), (&(mState)))))) {
529 0 : NS_WARNING("bad state transition!");
530 : }
531 0 : if ((!(RecvModifyWakeLock(aTopic, aLockAdjust, aHiddenAdjust)))) {
532 0 : return MsgProcessingError;
533 : }
534 :
535 0 : return MsgProcessed;
536 : }
537 : case PHal::Msg_EnableWakeLockNotifications__ID:
538 : {
539 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_EnableWakeLockNotifications");
540 0 : if (mozilla::ipc::LoggingEnabled()) {
541 0 : (static_cast<const PHal::Msg_EnableWakeLockNotifications*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
542 : }
543 :
544 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_EnableWakeLockNotifications__ID), (&(mState)))))) {
545 0 : NS_WARNING("bad state transition!");
546 : }
547 0 : if ((!(RecvEnableWakeLockNotifications()))) {
548 0 : return MsgProcessingError;
549 : }
550 :
551 0 : return MsgProcessed;
552 : }
553 : case PHal::Msg_DisableWakeLockNotifications__ID:
554 : {
555 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_DisableWakeLockNotifications");
556 0 : if (mozilla::ipc::LoggingEnabled()) {
557 0 : (static_cast<const PHal::Msg_DisableWakeLockNotifications*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
558 : }
559 :
560 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_DisableWakeLockNotifications__ID), (&(mState)))))) {
561 0 : NS_WARNING("bad state transition!");
562 : }
563 0 : if ((!(RecvDisableWakeLockNotifications()))) {
564 0 : return MsgProcessingError;
565 : }
566 :
567 0 : return MsgProcessed;
568 : }
569 : case PHal::Msg_EnableSensorNotifications__ID:
570 : {
571 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_EnableSensorNotifications");
572 0 : if (mozilla::ipc::LoggingEnabled()) {
573 0 : (static_cast<const PHal::Msg_EnableSensorNotifications*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
574 : }
575 :
576 0 : void* __iter = 0;
577 : SensorType aSensor;
578 :
579 0 : if ((!(Read((&(aSensor)), (&(__msg)), (&(__iter)))))) {
580 0 : FatalError("error deserializing (better message TODO)");
581 0 : return MsgValueError;
582 : }
583 0 : (__msg).EndRead(__iter);
584 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_EnableSensorNotifications__ID), (&(mState)))))) {
585 0 : NS_WARNING("bad state transition!");
586 : }
587 0 : if ((!(RecvEnableSensorNotifications(aSensor)))) {
588 0 : return MsgProcessingError;
589 : }
590 :
591 0 : return MsgProcessed;
592 : }
593 : case PHal::Msg_DisableSensorNotifications__ID:
594 : {
595 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_DisableSensorNotifications");
596 0 : if (mozilla::ipc::LoggingEnabled()) {
597 0 : (static_cast<const PHal::Msg_DisableSensorNotifications*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
598 : }
599 :
600 0 : void* __iter = 0;
601 : SensorType aSensor;
602 :
603 0 : if ((!(Read((&(aSensor)), (&(__msg)), (&(__iter)))))) {
604 0 : FatalError("error deserializing (better message TODO)");
605 0 : return MsgValueError;
606 : }
607 0 : (__msg).EndRead(__iter);
608 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_DisableSensorNotifications__ID), (&(mState)))))) {
609 0 : NS_WARNING("bad state transition!");
610 : }
611 0 : if ((!(RecvDisableSensorNotifications(aSensor)))) {
612 0 : return MsgProcessingError;
613 : }
614 :
615 0 : return MsgProcessed;
616 : }
617 : case PHal::Msg___delete____ID:
618 : {
619 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg___delete__");
620 0 : if (mozilla::ipc::LoggingEnabled()) {
621 0 : (static_cast<const PHal::Msg___delete__*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
622 : }
623 :
624 0 : void* __iter = 0;
625 : PHalParent* actor;
626 :
627 0 : if ((!(Read((&(actor)), (&(__msg)), (&(__iter)), false)))) {
628 0 : FatalError("error deserializing (better message TODO)");
629 0 : return MsgValueError;
630 : }
631 0 : (__msg).EndRead(__iter);
632 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg___delete____ID), (&(mState)))))) {
633 0 : NS_WARNING("bad state transition!");
634 : }
635 0 : if ((!(Recv__delete__()))) {
636 0 : return MsgProcessingError;
637 : }
638 :
639 0 : (actor)->DestroySubtree(Deletion);
640 0 : (actor)->DeallocSubtree();
641 0 : ((actor)->mManager)->RemoveManagee(PHalMsgStart, actor);
642 :
643 :
644 0 : return MsgProcessed;
645 : }
646 : default:
647 : {
648 0 : return MsgNotKnown;
649 : }
650 : }
651 : }
652 :
653 : PHalParent::Result
654 0 : PHalParent::OnMessageReceived(
655 : const Message& __msg,
656 : Message*& __reply)
657 : {
658 0 : switch ((__msg).type()) {
659 : case PHal::Msg_GetCurrentBatteryInformation__ID:
660 : {
661 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_GetCurrentBatteryInformation");
662 0 : if (mozilla::ipc::LoggingEnabled()) {
663 0 : (static_cast<const PHal::Msg_GetCurrentBatteryInformation*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
664 : }
665 :
666 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_GetCurrentBatteryInformation__ID), (&(mState)))))) {
667 0 : NS_WARNING("bad state transition!");
668 : }
669 0 : BatteryInformation aBatteryInfo;
670 0 : int32 __id = mId;
671 0 : if ((!(RecvGetCurrentBatteryInformation((&(aBatteryInfo)))))) {
672 0 : return MsgProcessingError;
673 : }
674 :
675 0 : __reply = new PHal::Reply_GetCurrentBatteryInformation();
676 :
677 0 : Write(aBatteryInfo, __reply);
678 0 : (__reply)->set_routing_id(__id);
679 0 : (__reply)->set_sync();
680 0 : (__reply)->set_reply();
681 :
682 0 : if (mozilla::ipc::LoggingEnabled()) {
683 0 : (static_cast<const PHal::Reply_GetCurrentBatteryInformation*>(__reply))->Log("[PHalParent] Sending reply ", stderr);
684 : }
685 0 : return MsgProcessed;
686 : }
687 : case PHal::Msg_GetCurrentNetworkInformation__ID:
688 : {
689 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_GetCurrentNetworkInformation");
690 0 : if (mozilla::ipc::LoggingEnabled()) {
691 0 : (static_cast<const PHal::Msg_GetCurrentNetworkInformation*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
692 : }
693 :
694 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_GetCurrentNetworkInformation__ID), (&(mState)))))) {
695 0 : NS_WARNING("bad state transition!");
696 : }
697 0 : NetworkInformation aNetworkInfo;
698 0 : int32 __id = mId;
699 0 : if ((!(RecvGetCurrentNetworkInformation((&(aNetworkInfo)))))) {
700 0 : return MsgProcessingError;
701 : }
702 :
703 0 : __reply = new PHal::Reply_GetCurrentNetworkInformation();
704 :
705 0 : Write(aNetworkInfo, __reply);
706 0 : (__reply)->set_routing_id(__id);
707 0 : (__reply)->set_sync();
708 0 : (__reply)->set_reply();
709 :
710 0 : if (mozilla::ipc::LoggingEnabled()) {
711 0 : (static_cast<const PHal::Reply_GetCurrentNetworkInformation*>(__reply))->Log("[PHalParent] Sending reply ", stderr);
712 : }
713 0 : return MsgProcessed;
714 : }
715 : case PHal::Msg_GetScreenEnabled__ID:
716 : {
717 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_GetScreenEnabled");
718 0 : if (mozilla::ipc::LoggingEnabled()) {
719 0 : (static_cast<const PHal::Msg_GetScreenEnabled*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
720 : }
721 :
722 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_GetScreenEnabled__ID), (&(mState)))))) {
723 0 : NS_WARNING("bad state transition!");
724 : }
725 : bool enabled;
726 0 : int32 __id = mId;
727 0 : if ((!(RecvGetScreenEnabled((&(enabled)))))) {
728 0 : return MsgProcessingError;
729 : }
730 :
731 0 : __reply = new PHal::Reply_GetScreenEnabled();
732 :
733 0 : Write(enabled, __reply);
734 0 : (__reply)->set_routing_id(__id);
735 0 : (__reply)->set_sync();
736 0 : (__reply)->set_reply();
737 :
738 0 : if (mozilla::ipc::LoggingEnabled()) {
739 0 : (static_cast<const PHal::Reply_GetScreenEnabled*>(__reply))->Log("[PHalParent] Sending reply ", stderr);
740 : }
741 0 : return MsgProcessed;
742 : }
743 : case PHal::Msg_GetScreenBrightness__ID:
744 : {
745 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_GetScreenBrightness");
746 0 : if (mozilla::ipc::LoggingEnabled()) {
747 0 : (static_cast<const PHal::Msg_GetScreenBrightness*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
748 : }
749 :
750 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_GetScreenBrightness__ID), (&(mState)))))) {
751 0 : NS_WARNING("bad state transition!");
752 : }
753 : double brightness;
754 0 : int32 __id = mId;
755 0 : if ((!(RecvGetScreenBrightness((&(brightness)))))) {
756 0 : return MsgProcessingError;
757 : }
758 :
759 0 : __reply = new PHal::Reply_GetScreenBrightness();
760 :
761 0 : Write(brightness, __reply);
762 0 : (__reply)->set_routing_id(__id);
763 0 : (__reply)->set_sync();
764 0 : (__reply)->set_reply();
765 :
766 0 : if (mozilla::ipc::LoggingEnabled()) {
767 0 : (static_cast<const PHal::Reply_GetScreenBrightness*>(__reply))->Log("[PHalParent] Sending reply ", stderr);
768 : }
769 0 : return MsgProcessed;
770 : }
771 : case PHal::Msg_SetLight__ID:
772 : {
773 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_SetLight");
774 0 : if (mozilla::ipc::LoggingEnabled()) {
775 0 : (static_cast<const PHal::Msg_SetLight*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
776 : }
777 :
778 0 : void* __iter = 0;
779 : LightType light;
780 0 : LightConfiguration aConfig;
781 :
782 0 : if ((!(Read((&(light)), (&(__msg)), (&(__iter)))))) {
783 0 : FatalError("error deserializing (better message TODO)");
784 0 : return MsgValueError;
785 : }
786 0 : if ((!(Read((&(aConfig)), (&(__msg)), (&(__iter)))))) {
787 0 : FatalError("error deserializing (better message TODO)");
788 0 : return MsgValueError;
789 : }
790 0 : (__msg).EndRead(__iter);
791 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_SetLight__ID), (&(mState)))))) {
792 0 : NS_WARNING("bad state transition!");
793 : }
794 : bool status;
795 0 : int32 __id = mId;
796 0 : if ((!(RecvSetLight(light, aConfig, (&(status)))))) {
797 0 : return MsgProcessingError;
798 : }
799 :
800 0 : __reply = new PHal::Reply_SetLight();
801 :
802 0 : Write(status, __reply);
803 0 : (__reply)->set_routing_id(__id);
804 0 : (__reply)->set_sync();
805 0 : (__reply)->set_reply();
806 :
807 0 : if (mozilla::ipc::LoggingEnabled()) {
808 0 : (static_cast<const PHal::Reply_SetLight*>(__reply))->Log("[PHalParent] Sending reply ", stderr);
809 : }
810 0 : return MsgProcessed;
811 : }
812 : case PHal::Msg_GetLight__ID:
813 : {
814 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_GetLight");
815 0 : if (mozilla::ipc::LoggingEnabled()) {
816 0 : (static_cast<const PHal::Msg_GetLight*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
817 : }
818 :
819 0 : void* __iter = 0;
820 : LightType light;
821 :
822 0 : if ((!(Read((&(light)), (&(__msg)), (&(__iter)))))) {
823 0 : FatalError("error deserializing (better message TODO)");
824 0 : return MsgValueError;
825 : }
826 0 : (__msg).EndRead(__iter);
827 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_GetLight__ID), (&(mState)))))) {
828 0 : NS_WARNING("bad state transition!");
829 : }
830 0 : LightConfiguration aConfig;
831 : bool status;
832 0 : int32 __id = mId;
833 0 : if ((!(RecvGetLight(light, (&(aConfig)), (&(status)))))) {
834 0 : return MsgProcessingError;
835 : }
836 :
837 0 : __reply = new PHal::Reply_GetLight();
838 :
839 0 : Write(aConfig, __reply);
840 0 : Write(status, __reply);
841 0 : (__reply)->set_routing_id(__id);
842 0 : (__reply)->set_sync();
843 0 : (__reply)->set_reply();
844 :
845 0 : if (mozilla::ipc::LoggingEnabled()) {
846 0 : (static_cast<const PHal::Reply_GetLight*>(__reply))->Log("[PHalParent] Sending reply ", stderr);
847 : }
848 0 : return MsgProcessed;
849 : }
850 : case PHal::Msg_GetWakeLockInfo__ID:
851 : {
852 0 : (const_cast<Message&>(__msg)).set_name("PHal::Msg_GetWakeLockInfo");
853 0 : if (mozilla::ipc::LoggingEnabled()) {
854 0 : (static_cast<const PHal::Msg_GetWakeLockInfo*>((&(__msg))))->Log("[PHalParent] Received ", stderr);
855 : }
856 :
857 0 : void* __iter = 0;
858 0 : nsString aTopic;
859 :
860 0 : if ((!(Read((&(aTopic)), (&(__msg)), (&(__iter)))))) {
861 0 : FatalError("error deserializing (better message TODO)");
862 0 : return MsgValueError;
863 : }
864 0 : (__msg).EndRead(__iter);
865 0 : if ((!(PHal::Transition(mState, Trigger(Trigger::Recv, PHal::Msg_GetWakeLockInfo__ID), (&(mState)))))) {
866 0 : NS_WARNING("bad state transition!");
867 : }
868 0 : WakeLockInformation aWakeLockInfo;
869 0 : int32 __id = mId;
870 0 : if ((!(RecvGetWakeLockInfo(aTopic, (&(aWakeLockInfo)))))) {
871 0 : return MsgProcessingError;
872 : }
873 :
874 0 : __reply = new PHal::Reply_GetWakeLockInfo();
875 :
876 0 : Write(aWakeLockInfo, __reply);
877 0 : (__reply)->set_routing_id(__id);
878 0 : (__reply)->set_sync();
879 0 : (__reply)->set_reply();
880 :
881 0 : if (mozilla::ipc::LoggingEnabled()) {
882 0 : (static_cast<const PHal::Reply_GetWakeLockInfo*>(__reply))->Log("[PHalParent] Sending reply ", stderr);
883 : }
884 0 : return MsgProcessed;
885 : }
886 : default:
887 : {
888 0 : return MsgNotKnown;
889 : }
890 : }
891 : }
892 :
893 : PHalParent::Result
894 0 : PHalParent::OnCallReceived(
895 : const Message& __msg,
896 : Message*& __reply)
897 : {
898 0 : return MsgNotKnown;
899 : }
900 :
901 : void
902 0 : PHalParent::OnProcessingError(Result code)
903 : {
904 0 : NS_RUNTIMEABORT("`OnProcessingError' called on non-toplevel actor");
905 0 : }
906 :
907 : bool
908 0 : PHalParent::OnReplyTimeout()
909 : {
910 0 : NS_RUNTIMEABORT("`OnReplyTimeout' called on non-toplevel actor");
911 0 : return false;
912 : }
913 :
914 : void
915 0 : PHalParent::OnChannelClose()
916 : {
917 0 : NS_RUNTIMEABORT("`OnClose' called on non-toplevel actor");
918 0 : }
919 :
920 : void
921 0 : PHalParent::OnChannelError()
922 : {
923 0 : NS_RUNTIMEABORT("`OnError' called on non-toplevel actor");
924 0 : }
925 :
926 : void
927 0 : PHalParent::OnChannelConnected(int32 pid)
928 : {
929 0 : NS_RUNTIMEABORT("'OnConnected' called on non-toplevel actor");
930 0 : }
931 :
932 : bool
933 0 : PHalParent::AllocShmem(
934 : size_t aSize,
935 : Shmem::SharedMemory::SharedMemoryType aType,
936 : Shmem* aMem)
937 : {
938 : Shmem::id_t aId;
939 0 : nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, false, (&(aId))));
940 0 : if ((!(rawmem))) {
941 0 : return false;
942 : }
943 :
944 0 : (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
945 0 : return true;
946 : }
947 :
948 : bool
949 0 : PHalParent::AllocUnsafeShmem(
950 : size_t aSize,
951 : Shmem::SharedMemory::SharedMemoryType aType,
952 : Shmem* aMem)
953 : {
954 : Shmem::id_t aId;
955 0 : nsAutoPtr<Shmem::SharedMemory> rawmem(CreateSharedMemory(aSize, aType, true, (&(aId))));
956 0 : if ((!(rawmem))) {
957 0 : return false;
958 : }
959 :
960 0 : (*(aMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), (rawmem).forget(), aId);
961 0 : return true;
962 : }
963 :
964 : bool
965 0 : PHalParent::AdoptShmem(
966 : Shmem& aMem,
967 : Shmem* aOutMem)
968 : {
969 0 : Shmem::SharedMemory* rawmem = (aMem).Segment(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
970 0 : if (((!(rawmem))) || (IsTrackingSharedMemory(rawmem))) {
971 0 : NS_RUNTIMEABORT("bad Shmem");
972 : }
973 :
974 : Shmem::id_t aId;
975 0 : if ((!(AdoptSharedMemory(rawmem, (&(aId)))))) {
976 0 : return false;
977 : }
978 :
979 0 : (*(aOutMem)) = Shmem(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead(), rawmem, aId);
980 0 : return true;
981 : }
982 :
983 : bool
984 0 : PHalParent::DeallocShmem(Shmem& aMem)
985 : {
986 0 : bool ok = DestroySharedMemory(aMem);
987 0 : (aMem).forget(Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead());
988 0 : return ok;
989 : }
990 :
991 : void
992 0 : PHalParent::FatalError(const char* const msg) const
993 : {
994 : // Virtual method to prevent inlining.
995 : // This give us better error reporting.
996 : // See bug 589371
997 :
998 0 : NS_ERROR("IPDL error:");
999 0 : NS_ERROR(msg);
1000 :
1001 0 : NS_ERROR("[PHalParent] killing child side as a result");
1002 :
1003 0 : if ((!(base::KillProcess(OtherProcess(), base::PROCESS_END_KILLED_BY_USER, false)))) {
1004 0 : NS_ERROR(" may have failed to kill child!");
1005 : }
1006 0 : }
1007 :
1008 : void
1009 0 : PHalParent::DestroySubtree(ActorDestroyReason why)
1010 : {
1011 : // Unregister from our manager.
1012 0 : Unregister(mId);
1013 0 : mId = 1;
1014 :
1015 : // Finally, destroy "us".
1016 0 : ActorDestroy(why);
1017 0 : }
1018 :
1019 : void
1020 0 : PHalParent::DeallocSubtree()
1021 : {
1022 0 : }
1023 :
1024 : void
1025 0 : PHalParent::Write(
1026 : const LightConfiguration& __v,
1027 : Message* __msg)
1028 : {
1029 0 : Write((__v).light(), __msg);
1030 0 : Write((__v).mode(), __msg);
1031 0 : Write((__v).flash(), __msg);
1032 0 : Write((__v).flashOnMS(), __msg);
1033 0 : Write((__v).flashOffMS(), __msg);
1034 0 : Write((__v).color(), __msg);
1035 0 : }
1036 :
1037 : bool
1038 0 : PHalParent::Read(
1039 : LightConfiguration* __v,
1040 : const Message* __msg,
1041 : void** __iter)
1042 : {
1043 0 : if ((!(Read((&((__v)->light())), __msg, __iter)))) {
1044 0 : return false;
1045 : }
1046 0 : if ((!(Read((&((__v)->mode())), __msg, __iter)))) {
1047 0 : return false;
1048 : }
1049 0 : if ((!(Read((&((__v)->flash())), __msg, __iter)))) {
1050 0 : return false;
1051 : }
1052 0 : if ((!(Read((&((__v)->flashOnMS())), __msg, __iter)))) {
1053 0 : return false;
1054 : }
1055 0 : if ((!(Read((&((__v)->flashOffMS())), __msg, __iter)))) {
1056 0 : return false;
1057 : }
1058 0 : if ((!(Read((&((__v)->color())), __msg, __iter)))) {
1059 0 : return false;
1060 : }
1061 0 : return true;
1062 : }
1063 :
1064 : void
1065 0 : PHalParent::Write(
1066 : PBrowserParent* __v,
1067 : Message* __msg,
1068 : bool __nullable)
1069 : {
1070 : int32 id;
1071 0 : if ((!(__v))) {
1072 0 : if ((!(__nullable))) {
1073 0 : NS_RUNTIMEABORT("NULL actor value passed to non-nullable param");
1074 : }
1075 0 : id = 0;
1076 : }
1077 : else {
1078 0 : id = (__v)->mId;
1079 0 : if ((1) == (id)) {
1080 0 : NS_RUNTIMEABORT("actor has been |delete|d");
1081 : }
1082 : }
1083 :
1084 0 : Write(id, __msg);
1085 0 : }
1086 :
1087 : bool
1088 0 : PHalParent::Read(
1089 : PBrowserParent** __v,
1090 : const Message* __msg,
1091 : void** __iter,
1092 : bool __nullable)
1093 : {
1094 : int32 id;
1095 0 : if ((!(Read((&(id)), __msg, __iter)))) {
1096 0 : return false;
1097 : }
1098 0 : if (((1) == (id)) || (((0) == (id)) && ((!(__nullable))))) {
1099 0 : return false;
1100 : }
1101 :
1102 0 : if ((0) == (id)) {
1103 0 : (*(__v)) = 0;
1104 : }
1105 : else {
1106 0 : (*(__v)) = static_cast<PBrowserParent*>(Lookup(id));
1107 0 : if ((!((*(__v))))) {
1108 0 : return false;
1109 : }
1110 : }
1111 0 : return true;
1112 : }
1113 :
1114 : void
1115 0 : PHalParent::Write(
1116 : const BatteryInformation& __v,
1117 : Message* __msg)
1118 : {
1119 0 : Write((__v).level(), __msg);
1120 0 : Write((__v).charging(), __msg);
1121 0 : Write((__v).remainingTime(), __msg);
1122 0 : }
1123 :
1124 : bool
1125 0 : PHalParent::Read(
1126 : BatteryInformation* __v,
1127 : const Message* __msg,
1128 : void** __iter)
1129 : {
1130 0 : if ((!(Read((&((__v)->level())), __msg, __iter)))) {
1131 0 : return false;
1132 : }
1133 0 : if ((!(Read((&((__v)->charging())), __msg, __iter)))) {
1134 0 : return false;
1135 : }
1136 0 : if ((!(Read((&((__v)->remainingTime())), __msg, __iter)))) {
1137 0 : return false;
1138 : }
1139 0 : return true;
1140 : }
1141 :
1142 : void
1143 0 : PHalParent::Write(
1144 : const WakeLockInformation& __v,
1145 : Message* __msg)
1146 : {
1147 0 : Write((__v).numLocks(), __msg);
1148 0 : Write((__v).numHidden(), __msg);
1149 0 : Write((__v).topic(), __msg);
1150 0 : }
1151 :
1152 : bool
1153 0 : PHalParent::Read(
1154 : WakeLockInformation* __v,
1155 : const Message* __msg,
1156 : void** __iter)
1157 : {
1158 0 : if ((!(Read((&((__v)->numLocks())), __msg, __iter)))) {
1159 0 : return false;
1160 : }
1161 0 : if ((!(Read((&((__v)->numHidden())), __msg, __iter)))) {
1162 0 : return false;
1163 : }
1164 0 : if ((!(Read((&((__v)->topic())), __msg, __iter)))) {
1165 0 : return false;
1166 : }
1167 0 : return true;
1168 : }
1169 :
1170 : void
1171 0 : PHalParent::Write(
1172 : const NetworkInformation& __v,
1173 : Message* __msg)
1174 : {
1175 0 : Write((__v).bandwidth(), __msg);
1176 0 : Write((__v).canBeMetered(), __msg);
1177 0 : }
1178 :
1179 : bool
1180 0 : PHalParent::Read(
1181 : NetworkInformation* __v,
1182 : const Message* __msg,
1183 : void** __iter)
1184 : {
1185 0 : if ((!(Read((&((__v)->bandwidth())), __msg, __iter)))) {
1186 0 : return false;
1187 : }
1188 0 : if ((!(Read((&((__v)->canBeMetered())), __msg, __iter)))) {
1189 0 : return false;
1190 : }
1191 0 : return true;
1192 : }
1193 :
1194 : void
1195 0 : PHalParent::Write(
1196 : const SensorData& __v,
1197 : Message* __msg)
1198 : {
1199 0 : Write((__v).sensor(), __msg);
1200 0 : Write((__v).timestamp(), __msg);
1201 0 : Write((__v).values(), __msg);
1202 0 : }
1203 :
1204 : bool
1205 0 : PHalParent::Read(
1206 : SensorData* __v,
1207 : const Message* __msg,
1208 : void** __iter)
1209 : {
1210 0 : if ((!(Read((&((__v)->sensor())), __msg, __iter)))) {
1211 0 : return false;
1212 : }
1213 0 : if ((!(Read((&((__v)->timestamp())), __msg, __iter)))) {
1214 0 : return false;
1215 : }
1216 0 : if ((!(Read((&((__v)->values())), __msg, __iter)))) {
1217 0 : return false;
1218 : }
1219 0 : return true;
1220 : }
1221 :
1222 : void
1223 0 : PHalParent::Write(
1224 : PHalParent* __v,
1225 : Message* __msg,
1226 : bool __nullable)
1227 : {
1228 : int32 id;
1229 0 : if ((!(__v))) {
1230 0 : if ((!(__nullable))) {
1231 0 : NS_RUNTIMEABORT("NULL actor value passed to non-nullable param");
1232 : }
1233 0 : id = 0;
1234 : }
1235 : else {
1236 0 : id = (__v)->mId;
1237 0 : if ((1) == (id)) {
1238 0 : NS_RUNTIMEABORT("actor has been |delete|d");
1239 : }
1240 : }
1241 :
1242 0 : Write(id, __msg);
1243 0 : }
1244 :
1245 : bool
1246 0 : PHalParent::Read(
1247 : PHalParent** __v,
1248 : const Message* __msg,
1249 : void** __iter,
1250 : bool __nullable)
1251 : {
1252 : int32 id;
1253 0 : if ((!(Read((&(id)), __msg, __iter)))) {
1254 0 : return false;
1255 : }
1256 0 : if (((1) == (id)) || (((0) == (id)) && ((!(__nullable))))) {
1257 0 : return false;
1258 : }
1259 :
1260 0 : if ((0) == (id)) {
1261 0 : (*(__v)) = 0;
1262 : }
1263 : else {
1264 0 : (*(__v)) = static_cast<PHalParent*>(Lookup(id));
1265 0 : if ((!((*(__v))))) {
1266 0 : return false;
1267 : }
1268 : }
1269 0 : return true;
1270 : }
1271 :
1272 :
1273 :
1274 : } // namespace hal_sandbox
1275 : } // namespace mozilla
|