Coverage Report

Created: 2018-09-25 14:53

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