Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PHalChild.cpp
Line
Count
Source (jump to first uncovered line)
1
//
2
// Automatically generated by ipdlc.
3
// Edit at your own risk
4
//
5
6
7
#include "mozilla/hal_sandbox/PHalChild.h"
8
9
#include "mozilla/dom/PContentChild.h"
10
#include "mozilla/dom/PBrowserChild.h"
11
12
#include "nsIFile.h"
13
#include "GeckoProfiler.h"
14
15
namespace mozilla {
16
namespace hal_sandbox {
17
18
19
auto PHalChild::ActorDestroy(ActorDestroyReason aWhy) -> void
20
0
{
21
0
}
22
23
MOZ_IMPLICIT PHalChild::PHalChild() :
24
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
25
    mLivenessState(mozilla::ipc::LivenessState::Dead)
26
0
{
27
0
    MOZ_COUNT_CTOR(PHalChild);
28
0
}
29
30
PHalChild::~PHalChild()
31
0
{
32
0
    MOZ_COUNT_DTOR(PHalChild);
33
0
}
34
35
auto PHalChild::Manager() const -> PContentChild*
36
0
{
37
0
    return static_cast<PContentChild*>(IProtocol::Manager());
38
0
}
39
40
auto PHalChild::SendVibrate(
41
        const nsTArray<uint32_t>& pattern,
42
        const nsTArray<uint64_t>& id,
43
        PBrowserChild* browser) -> bool
44
0
{
45
0
    IPC::Message* msg__ = PHal::Msg_Vibrate(Id());
46
0
47
0
    WriteIPDLParam(msg__, this, pattern);
48
0
    // Sentinel = 'pattern'
49
0
    (msg__)->WriteSentinel(2105892009);
50
0
    WriteIPDLParam(msg__, this, id);
51
0
    // Sentinel = 'id'
52
0
    (msg__)->WriteSentinel(2794505629);
53
0
    MOZ_RELEASE_ASSERT(browser, "NULL actor value passed to non-nullable param");
54
0
    WriteIPDLParam(msg__, this, browser);
55
0
    // Sentinel = 'browser'
56
0
    (msg__)->WriteSentinel(2836343679);
57
0
58
0
59
0
60
0
61
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
62
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
63
0
    }
64
0
    AUTO_PROFILER_LABEL("PHal::Msg_Vibrate", OTHER);
65
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
66
0
        mozilla::ipc::LogicError("Transition error");
67
0
    }
68
0
69
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
70
0
    return sendok__;
71
0
}
72
73
auto PHalChild::SendCancelVibrate(
74
        const nsTArray<uint64_t>& id,
75
        PBrowserChild* browser) -> bool
76
0
{
77
0
    IPC::Message* msg__ = PHal::Msg_CancelVibrate(Id());
78
0
79
0
    WriteIPDLParam(msg__, this, id);
80
0
    // Sentinel = 'id'
81
0
    (msg__)->WriteSentinel(2794505629);
82
0
    MOZ_RELEASE_ASSERT(browser, "NULL actor value passed to non-nullable param");
83
0
    WriteIPDLParam(msg__, this, browser);
84
0
    // Sentinel = 'browser'
85
0
    (msg__)->WriteSentinel(2836343679);
86
0
87
0
88
0
89
0
90
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
91
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
92
0
    }
93
0
    AUTO_PROFILER_LABEL("PHal::Msg_CancelVibrate", OTHER);
94
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
95
0
        mozilla::ipc::LogicError("Transition error");
96
0
    }
97
0
98
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
99
0
    return sendok__;
100
0
}
101
102
auto PHalChild::SendEnableBatteryNotifications() -> bool
103
0
{
104
0
    IPC::Message* msg__ = PHal::Msg_EnableBatteryNotifications(Id());
105
0
106
0
107
0
108
0
109
0
110
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
111
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
112
0
    }
113
0
    AUTO_PROFILER_LABEL("PHal::Msg_EnableBatteryNotifications", OTHER);
114
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
115
0
        mozilla::ipc::LogicError("Transition error");
116
0
    }
117
0
118
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
119
0
    return sendok__;
120
0
}
121
122
auto PHalChild::SendDisableBatteryNotifications() -> bool
123
0
{
124
0
    IPC::Message* msg__ = PHal::Msg_DisableBatteryNotifications(Id());
125
0
126
0
127
0
128
0
129
0
130
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
131
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
132
0
    }
133
0
    AUTO_PROFILER_LABEL("PHal::Msg_DisableBatteryNotifications", OTHER);
134
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
135
0
        mozilla::ipc::LogicError("Transition error");
136
0
    }
137
0
138
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
139
0
    return sendok__;
140
0
}
141
142
auto PHalChild::SendGetCurrentBatteryInformation(BatteryInformation* aBatteryInfo) -> bool
143
0
{
144
0
    IPC::Message* msg__ = PHal::Msg_GetCurrentBatteryInformation(Id());
145
0
146
0
147
0
148
0
149
0
    Message reply__;
150
0
151
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
152
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
153
0
    }
154
0
    AUTO_PROFILER_LABEL("PHal::Msg_GetCurrentBatteryInformation", OTHER);
155
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
156
0
        mozilla::ipc::LogicError("Transition error");
157
0
    }
158
0
159
0
    bool sendok__;
160
0
    {
161
0
        AUTO_PROFILER_TRACING("IPC", "PHal::Msg_GetCurrentBatteryInformation");
162
0
        sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__)));
163
0
    }
164
0
    if ((!(sendok__))) {
165
0
        return false;
166
0
    }
167
0
168
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
169
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
170
0
    }
171
0
172
0
    PickleIterator iter__(reply__);
173
0
174
0
    if ((!(ReadIPDLParam((&(reply__)), (&(iter__)), this, aBatteryInfo)))) {
175
0
        FatalError("Error deserializing 'BatteryInformation'");
176
0
        return false;
177
0
    }
178
0
    // Sentinel = 'aBatteryInfo'
179
0
    if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 2078351088)))) {
180
0
        mozilla::ipc::SentinelReadError("Error deserializing 'BatteryInformation'");
181
0
        return false;
182
0
    }
183
0
    (reply__).EndRead(iter__, (reply__).type());
184
0
185
0
    return true;
186
0
}
187
188
auto PHalChild::SendEnableNetworkNotifications() -> bool
189
0
{
190
0
    IPC::Message* msg__ = PHal::Msg_EnableNetworkNotifications(Id());
191
0
192
0
193
0
194
0
195
0
196
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
197
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
198
0
    }
199
0
    AUTO_PROFILER_LABEL("PHal::Msg_EnableNetworkNotifications", OTHER);
200
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
201
0
        mozilla::ipc::LogicError("Transition error");
202
0
    }
203
0
204
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
205
0
    return sendok__;
206
0
}
207
208
auto PHalChild::SendDisableNetworkNotifications() -> bool
209
0
{
210
0
    IPC::Message* msg__ = PHal::Msg_DisableNetworkNotifications(Id());
211
0
212
0
213
0
214
0
215
0
216
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
217
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
218
0
    }
219
0
    AUTO_PROFILER_LABEL("PHal::Msg_DisableNetworkNotifications", OTHER);
220
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
221
0
        mozilla::ipc::LogicError("Transition error");
222
0
    }
223
0
224
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
225
0
    return sendok__;
226
0
}
227
228
auto PHalChild::SendGetCurrentNetworkInformation(NetworkInformation* aNetworkInfo) -> bool
229
0
{
230
0
    IPC::Message* msg__ = PHal::Msg_GetCurrentNetworkInformation(Id());
231
0
232
0
233
0
234
0
235
0
    Message reply__;
236
0
237
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
238
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
239
0
    }
240
0
    AUTO_PROFILER_LABEL("PHal::Msg_GetCurrentNetworkInformation", OTHER);
241
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
242
0
        mozilla::ipc::LogicError("Transition error");
243
0
    }
244
0
245
0
    bool sendok__;
246
0
    {
247
0
        AUTO_PROFILER_TRACING("IPC", "PHal::Msg_GetCurrentNetworkInformation");
248
0
        sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__)));
249
0
    }
250
0
    if ((!(sendok__))) {
251
0
        return false;
252
0
    }
253
0
254
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
255
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
256
0
    }
257
0
258
0
    PickleIterator iter__(reply__);
259
0
260
0
    if ((!(ReadIPDLParam((&(reply__)), (&(iter__)), this, aNetworkInfo)))) {
261
0
        FatalError("Error deserializing 'NetworkInformation'");
262
0
        return false;
263
0
    }
264
0
    // Sentinel = 'aNetworkInfo'
265
0
    if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 1908218217)))) {
266
0
        mozilla::ipc::SentinelReadError("Error deserializing 'NetworkInformation'");
267
0
        return false;
268
0
    }
269
0
    (reply__).EndRead(iter__, (reply__).type());
270
0
271
0
    return true;
272
0
}
273
274
auto PHalChild::SendModifyWakeLock(
275
        const nsString& aTopic,
276
        const WakeLockControl& aLockAdjust,
277
        const WakeLockControl& aHiddenAdjust,
278
        const uint64_t& aProcessID) -> bool
279
0
{
280
0
    IPC::Message* msg__ = PHal::Msg_ModifyWakeLock(Id());
281
0
282
0
    WriteIPDLParam(msg__, this, aTopic);
283
0
    // Sentinel = 'aTopic'
284
0
    (msg__)->WriteSentinel(2759450316);
285
0
    WriteIPDLParam(msg__, this, aLockAdjust);
286
0
    // Sentinel = 'aLockAdjust'
287
0
    (msg__)->WriteSentinel(3857892778);
288
0
    WriteIPDLParam(msg__, this, aHiddenAdjust);
289
0
    // Sentinel = 'aHiddenAdjust'
290
0
    (msg__)->WriteSentinel(2900615369);
291
0
    WriteIPDLParam(msg__, this, aProcessID);
292
0
    // Sentinel = 'aProcessID'
293
0
    (msg__)->WriteSentinel(2181368637);
294
0
295
0
296
0
297
0
298
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
299
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
300
0
    }
301
0
    AUTO_PROFILER_LABEL("PHal::Msg_ModifyWakeLock", OTHER);
302
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
303
0
        mozilla::ipc::LogicError("Transition error");
304
0
    }
305
0
306
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
307
0
    return sendok__;
308
0
}
309
310
auto PHalChild::SendEnableWakeLockNotifications() -> bool
311
0
{
312
0
    IPC::Message* msg__ = PHal::Msg_EnableWakeLockNotifications(Id());
313
0
314
0
315
0
316
0
317
0
318
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
319
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
320
0
    }
321
0
    AUTO_PROFILER_LABEL("PHal::Msg_EnableWakeLockNotifications", OTHER);
322
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
323
0
        mozilla::ipc::LogicError("Transition error");
324
0
    }
325
0
326
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
327
0
    return sendok__;
328
0
}
329
330
auto PHalChild::SendDisableWakeLockNotifications() -> bool
331
0
{
332
0
    IPC::Message* msg__ = PHal::Msg_DisableWakeLockNotifications(Id());
333
0
334
0
335
0
336
0
337
0
338
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
339
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
340
0
    }
341
0
    AUTO_PROFILER_LABEL("PHal::Msg_DisableWakeLockNotifications", OTHER);
342
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
343
0
        mozilla::ipc::LogicError("Transition error");
344
0
    }
345
0
346
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
347
0
    return sendok__;
348
0
}
349
350
auto PHalChild::SendGetWakeLockInfo(
351
        const nsString& aTopic,
352
        WakeLockInformation* aWakeLockInfo) -> bool
353
0
{
354
0
    IPC::Message* msg__ = PHal::Msg_GetWakeLockInfo(Id());
355
0
356
0
    WriteIPDLParam(msg__, this, aTopic);
357
0
    // Sentinel = 'aTopic'
358
0
    (msg__)->WriteSentinel(2759450316);
359
0
360
0
361
0
362
0
    Message reply__;
363
0
364
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
365
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
366
0
    }
367
0
    AUTO_PROFILER_LABEL("PHal::Msg_GetWakeLockInfo", OTHER);
368
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
369
0
        mozilla::ipc::LogicError("Transition error");
370
0
    }
371
0
372
0
    bool sendok__;
373
0
    {
374
0
        AUTO_PROFILER_TRACING("IPC", "PHal::Msg_GetWakeLockInfo");
375
0
        sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__)));
376
0
    }
377
0
    if ((!(sendok__))) {
378
0
        return false;
379
0
    }
380
0
381
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
382
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
383
0
    }
384
0
385
0
    PickleIterator iter__(reply__);
386
0
387
0
    if ((!(ReadIPDLParam((&(reply__)), (&(iter__)), this, aWakeLockInfo)))) {
388
0
        FatalError("Error deserializing 'WakeLockInformation'");
389
0
        return false;
390
0
    }
391
0
    // Sentinel = 'aWakeLockInfo'
392
0
    if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 1498930717)))) {
393
0
        mozilla::ipc::SentinelReadError("Error deserializing 'WakeLockInformation'");
394
0
        return false;
395
0
    }
396
0
    (reply__).EndRead(iter__, (reply__).type());
397
0
398
0
    return true;
399
0
}
400
401
auto PHalChild::SendEnableScreenConfigurationNotifications() -> bool
402
0
{
403
0
    IPC::Message* msg__ = PHal::Msg_EnableScreenConfigurationNotifications(Id());
404
0
405
0
406
0
407
0
408
0
409
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
410
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
411
0
    }
412
0
    AUTO_PROFILER_LABEL("PHal::Msg_EnableScreenConfigurationNotifications", OTHER);
413
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
414
0
        mozilla::ipc::LogicError("Transition error");
415
0
    }
416
0
417
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
418
0
    return sendok__;
419
0
}
420
421
auto PHalChild::SendDisableScreenConfigurationNotifications() -> bool
422
0
{
423
0
    IPC::Message* msg__ = PHal::Msg_DisableScreenConfigurationNotifications(Id());
424
0
425
0
426
0
427
0
428
0
429
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
430
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
431
0
    }
432
0
    AUTO_PROFILER_LABEL("PHal::Msg_DisableScreenConfigurationNotifications", OTHER);
433
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
434
0
        mozilla::ipc::LogicError("Transition error");
435
0
    }
436
0
437
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
438
0
    return sendok__;
439
0
}
440
441
auto PHalChild::SendLockScreenOrientation(
442
        const ScreenOrientation& aOrientation,
443
        bool* allowed) -> bool
444
0
{
445
0
    IPC::Message* msg__ = PHal::Msg_LockScreenOrientation(Id());
446
0
447
0
    WriteIPDLParam(msg__, this, aOrientation);
448
0
    // Sentinel = 'aOrientation'
449
0
    (msg__)->WriteSentinel(1665072289);
450
0
451
0
452
0
453
0
    Message reply__;
454
0
455
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
456
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
457
0
    }
458
0
    AUTO_PROFILER_LABEL("PHal::Msg_LockScreenOrientation", OTHER);
459
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
460
0
        mozilla::ipc::LogicError("Transition error");
461
0
    }
462
0
463
0
    bool sendok__;
464
0
    {
465
0
        AUTO_PROFILER_TRACING("IPC", "PHal::Msg_LockScreenOrientation");
466
0
        sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__)));
467
0
    }
468
0
    if ((!(sendok__))) {
469
0
        return false;
470
0
    }
471
0
472
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
473
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
474
0
    }
475
0
476
0
    PickleIterator iter__(reply__);
477
0
478
0
    if ((!(ReadIPDLParam((&(reply__)), (&(iter__)), this, allowed)))) {
479
0
        FatalError("Error deserializing 'bool'");
480
0
        return false;
481
0
    }
482
0
    // Sentinel = 'allowed'
483
0
    if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 1297156503)))) {
484
0
        mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
485
0
        return false;
486
0
    }
487
0
    (reply__).EndRead(iter__, (reply__).type());
488
0
489
0
    return true;
490
0
}
491
492
auto PHalChild::SendUnlockScreenOrientation() -> bool
493
0
{
494
0
    IPC::Message* msg__ = PHal::Msg_UnlockScreenOrientation(Id());
495
0
496
0
497
0
498
0
499
0
500
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
501
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
502
0
    }
503
0
    AUTO_PROFILER_LABEL("PHal::Msg_UnlockScreenOrientation", OTHER);
504
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
505
0
        mozilla::ipc::LogicError("Transition error");
506
0
    }
507
0
508
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
509
0
    return sendok__;
510
0
}
511
512
auto PHalChild::SendEnableSensorNotifications(const SensorType& aSensor) -> bool
513
0
{
514
0
    IPC::Message* msg__ = PHal::Msg_EnableSensorNotifications(Id());
515
0
516
0
    WriteIPDLParam(msg__, this, aSensor);
517
0
    // Sentinel = 'aSensor'
518
0
    (msg__)->WriteSentinel(942615000);
519
0
520
0
521
0
522
0
523
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
524
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
525
0
    }
526
0
    AUTO_PROFILER_LABEL("PHal::Msg_EnableSensorNotifications", OTHER);
527
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
528
0
        mozilla::ipc::LogicError("Transition error");
529
0
    }
530
0
531
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
532
0
    return sendok__;
533
0
}
534
535
auto PHalChild::SendDisableSensorNotifications(const SensorType& aSensor) -> bool
536
0
{
537
0
    IPC::Message* msg__ = PHal::Msg_DisableSensorNotifications(Id());
538
0
539
0
    WriteIPDLParam(msg__, this, aSensor);
540
0
    // Sentinel = 'aSensor'
541
0
    (msg__)->WriteSentinel(942615000);
542
0
543
0
544
0
545
0
546
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
547
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
548
0
    }
549
0
    AUTO_PROFILER_LABEL("PHal::Msg_DisableSensorNotifications", OTHER);
550
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
551
0
        mozilla::ipc::LogicError("Transition error");
552
0
    }
553
0
554
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
555
0
    return sendok__;
556
0
}
557
558
auto PHalChild::Send__delete__(PHalChild* actor) -> bool
559
0
{
560
0
    if ((!(actor))) {
561
0
        return false;
562
0
    }
563
0
564
0
    IPC::Message* msg__ = PHal::Msg___delete__((actor)->Id());
565
0
566
0
    MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param");
567
0
    WriteIPDLParam(msg__, actor, actor);
568
0
    // Sentinel = 'actor'
569
0
    (msg__)->WriteSentinel(875202478);
570
0
571
0
572
0
573
0
    if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
574
0
        mozilla::ipc::LogMessageForProtocol("PHalChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
575
0
    }
576
0
    AUTO_PROFILER_LABEL("PHal::Msg___delete__", OTHER);
577
0
    if ((!(StateTransition(true, (&((actor)->mLivenessState)))))) {
578
0
        mozilla::ipc::LogicError("Transition error");
579
0
    }
580
0
581
0
    bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
582
0
583
0
    IProtocol* mgr = (actor)->Manager();
584
0
    (actor)->DestroySubtree(Deletion);
585
0
    (actor)->DeallocSubtree();
586
0
    (mgr)->RemoveManagee(PHalMsgStart, actor);
587
0
    return sendok__;
588
0
}
589
590
auto PHalChild::RemoveManagee(
591
        int32_t aProtocolId,
592
        IProtocol* aListener) -> void
593
0
{
594
0
    FatalError("unreached");
595
0
    return;
596
0
}
597
598
auto PHalChild::OnMessageReceived(const Message& msg__) -> PHalChild::Result
599
0
{
600
0
    switch ((msg__).type()) {
601
0
    case PHal::Msg_NotifyBatteryChange__ID:
602
0
        {
603
0
            if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
604
0
                mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
605
0
            }
606
0
            AUTO_PROFILER_LABEL("PHal::Msg_NotifyBatteryChange", OTHER);
607
0
608
0
            PickleIterator iter__(msg__);
609
0
            BatteryInformation aBatteryInfo;
610
0
611
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aBatteryInfo)))))) {
612
0
                FatalError("Error deserializing 'BatteryInformation'");
613
0
                return MsgValueError;
614
0
            }
615
0
            // Sentinel = 'aBatteryInfo'
616
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2078351088)))) {
617
0
                mozilla::ipc::SentinelReadError("Error deserializing 'BatteryInformation'");
618
0
                return MsgValueError;
619
0
            }
620
0
            (msg__).EndRead(iter__, (msg__).type());
621
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
622
0
                FatalError("Transition error");
623
0
                return MsgValueError;
624
0
            }
625
0
            if ((!(RecvNotifyBatteryChange(aBatteryInfo)))) {
626
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
627
0
                // Error handled in mozilla::ipc::IPCResult
628
0
                return MsgProcessingError;
629
0
            }
630
0
631
0
            return MsgProcessed;
632
0
        }
633
0
    case PHal::Msg_NotifyNetworkChange__ID:
634
0
        {
635
0
            if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
636
0
                mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
637
0
            }
638
0
            AUTO_PROFILER_LABEL("PHal::Msg_NotifyNetworkChange", OTHER);
639
0
640
0
            PickleIterator iter__(msg__);
641
0
            NetworkInformation aNetworkInfo;
642
0
643
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aNetworkInfo)))))) {
644
0
                FatalError("Error deserializing 'NetworkInformation'");
645
0
                return MsgValueError;
646
0
            }
647
0
            // Sentinel = 'aNetworkInfo'
648
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1908218217)))) {
649
0
                mozilla::ipc::SentinelReadError("Error deserializing 'NetworkInformation'");
650
0
                return MsgValueError;
651
0
            }
652
0
            (msg__).EndRead(iter__, (msg__).type());
653
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
654
0
                FatalError("Transition error");
655
0
                return MsgValueError;
656
0
            }
657
0
            if ((!(RecvNotifyNetworkChange(aNetworkInfo)))) {
658
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
659
0
                // Error handled in mozilla::ipc::IPCResult
660
0
                return MsgProcessingError;
661
0
            }
662
0
663
0
            return MsgProcessed;
664
0
        }
665
0
    case PHal::Msg_NotifyWakeLockChange__ID:
666
0
        {
667
0
            if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
668
0
                mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
669
0
            }
670
0
            AUTO_PROFILER_LABEL("PHal::Msg_NotifyWakeLockChange", OTHER);
671
0
672
0
            PickleIterator iter__(msg__);
673
0
            WakeLockInformation aWakeLockInfo;
674
0
675
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aWakeLockInfo)))))) {
676
0
                FatalError("Error deserializing 'WakeLockInformation'");
677
0
                return MsgValueError;
678
0
            }
679
0
            // Sentinel = 'aWakeLockInfo'
680
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1498930717)))) {
681
0
                mozilla::ipc::SentinelReadError("Error deserializing 'WakeLockInformation'");
682
0
                return MsgValueError;
683
0
            }
684
0
            (msg__).EndRead(iter__, (msg__).type());
685
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
686
0
                FatalError("Transition error");
687
0
                return MsgValueError;
688
0
            }
689
0
            if ((!(RecvNotifyWakeLockChange(aWakeLockInfo)))) {
690
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
691
0
                // Error handled in mozilla::ipc::IPCResult
692
0
                return MsgProcessingError;
693
0
            }
694
0
695
0
            return MsgProcessed;
696
0
        }
697
0
    case PHal::Msg_NotifyScreenConfigurationChange__ID:
698
0
        {
699
0
            if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
700
0
                mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
701
0
            }
702
0
            AUTO_PROFILER_LABEL("PHal::Msg_NotifyScreenConfigurationChange", OTHER);
703
0
704
0
            PickleIterator iter__(msg__);
705
0
            ScreenConfiguration aScreenOrientation;
706
0
707
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aScreenOrientation)))))) {
708
0
                FatalError("Error deserializing 'ScreenConfiguration'");
709
0
                return MsgValueError;
710
0
            }
711
0
            // Sentinel = 'aScreenOrientation'
712
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2886778787)))) {
713
0
                mozilla::ipc::SentinelReadError("Error deserializing 'ScreenConfiguration'");
714
0
                return MsgValueError;
715
0
            }
716
0
            (msg__).EndRead(iter__, (msg__).type());
717
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
718
0
                FatalError("Transition error");
719
0
                return MsgValueError;
720
0
            }
721
0
            if ((!(RecvNotifyScreenConfigurationChange(aScreenOrientation)))) {
722
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
723
0
                // Error handled in mozilla::ipc::IPCResult
724
0
                return MsgProcessingError;
725
0
            }
726
0
727
0
            return MsgProcessed;
728
0
        }
729
0
    case PHal::Msg_NotifySensorChange__ID:
730
0
        {
731
0
            if (mozilla::ipc::LoggingEnabledFor("PHalChild")) {
732
0
                mozilla::ipc::LogMessageForProtocol("PHalChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
733
0
            }
734
0
            AUTO_PROFILER_LABEL("PHal::Msg_NotifySensorChange", OTHER);
735
0
736
0
            PickleIterator iter__(msg__);
737
0
            SensorData aSensorData;
738
0
739
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aSensorData)))))) {
740
0
                FatalError("Error deserializing 'SensorData'");
741
0
                return MsgValueError;
742
0
            }
743
0
            // Sentinel = 'aSensorData'
744
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2949034804)))) {
745
0
                mozilla::ipc::SentinelReadError("Error deserializing 'SensorData'");
746
0
                return MsgValueError;
747
0
            }
748
0
            (msg__).EndRead(iter__, (msg__).type());
749
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
750
0
                FatalError("Transition error");
751
0
                return MsgValueError;
752
0
            }
753
0
            if ((!(RecvNotifySensorChange(aSensorData)))) {
754
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
755
0
                // Error handled in mozilla::ipc::IPCResult
756
0
                return MsgProcessingError;
757
0
            }
758
0
759
0
            return MsgProcessed;
760
0
        }
761
0
    case PHal::Reply___delete____ID:
762
0
        {
763
0
            return MsgProcessed;
764
0
        }
765
0
    default:
766
0
        {
767
0
            return MsgNotKnown;
768
0
        }
769
0
    }
770
0
}
771
772
auto PHalChild::OnMessageReceived(
773
        const Message& msg__,
774
        Message*& reply__) -> PHalChild::Result
775
0
{
776
0
    return MsgNotKnown;
777
0
}
778
779
auto PHalChild::OnCallReceived(
780
        const Message& msg__,
781
        Message*& reply__) -> PHalChild::Result
782
0
{
783
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
784
0
    return MsgNotKnown;
785
0
}
786
787
auto PHalChild::GetProtocolTypeId() -> int32_t
788
0
{
789
0
    return PHalMsgStart;
790
0
}
791
792
auto PHalChild::DestroySubtree(ActorDestroyReason why) -> void
793
0
{
794
0
    // Unregister from our manager.
795
0
    Unregister(Id());
796
0
797
0
    // Reject owning pending responses.
798
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
799
0
800
0
    // Finally, destroy "us".
801
0
    ActorDestroy(why);
802
0
}
803
804
auto PHalChild::DeallocSubtree() -> void
805
0
{
806
0
}
807
808
809
810
} // namespace hal_sandbox
811
} // namespace mozilla
812
namespace mozilla {
813
namespace ipc {
814
auto IPDLParamTraits<mozilla::hal_sandbox::PHalChild>::Write(
815
        IPC::Message* aMsg,
816
        mozilla::ipc::IProtocol* aActor,
817
        const paramType& aVar) -> void
818
0
{
819
0
    int32_t id;
820
0
    if ((!(aVar))) {
821
0
        id = 0;
822
0
    }
823
0
    else {
824
0
        id = (aVar)->Id();
825
0
        if ((1) == (id)) {
826
0
            (aActor)->FatalError("actor has been |delete|d");
827
0
        }
828
0
    }
829
0
    WriteIPDLParam(aMsg, aActor, id);
830
0
}
831
832
auto IPDLParamTraits<mozilla::hal_sandbox::PHalChild>::Read(
833
        const IPC::Message* aMsg,
834
        PickleIterator* aIter,
835
        mozilla::ipc::IProtocol* aActor,
836
        paramType* aVar) -> bool
837
0
{
838
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PHal", PHalMsgStart);
839
0
    if ((actor).isNothing()) {
840
0
        return false;
841
0
    }
842
0
843
0
    (*(aVar)) = static_cast<mozilla::hal_sandbox::PHalChild*>((actor).value());
844
0
    return true;
845
0
}
846
847
} // namespace ipc
848
} // namespace mozilla