Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PAPZChild.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/layers/PAPZChild.h"
8
#include "FrameMetrics.h"
9
#include "nsRegion.h"
10
11
#include "mozilla/layers/PCompositorBridgeChild.h"
12
13
#include "nsIFile.h"
14
#include "GeckoProfiler.h"
15
16
namespace mozilla {
17
namespace layers {
18
19
20
auto PAPZChild::ActorDestroy(ActorDestroyReason aWhy) -> void
21
0
{
22
0
}
23
24
MOZ_IMPLICIT PAPZChild::PAPZChild() :
25
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
26
    mLivenessState(mozilla::ipc::LivenessState::Dead)
27
0
{
28
0
    MOZ_COUNT_CTOR(PAPZChild);
29
0
}
30
31
PAPZChild::~PAPZChild()
32
0
{
33
0
    MOZ_COUNT_DTOR(PAPZChild);
34
0
}
35
36
auto PAPZChild::Manager() const -> PCompositorBridgeChild*
37
0
{
38
0
    return static_cast<PCompositorBridgeChild*>(IProtocol::Manager());
39
0
}
40
41
auto PAPZChild::Send__delete__(PAPZChild* actor) -> bool
42
0
{
43
0
    if ((!(actor))) {
44
0
        return false;
45
0
    }
46
0
47
0
    IPC::Message* msg__ = PAPZ::Msg___delete__((actor)->Id());
48
0
49
0
    MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param");
50
0
    WriteIPDLParam(msg__, actor, actor);
51
0
    // Sentinel = 'actor'
52
0
    (msg__)->WriteSentinel(875202478);
53
0
54
0
55
0
56
0
    if (mozilla::ipc::LoggingEnabledFor("PAPZChild")) {
57
0
        mozilla::ipc::LogMessageForProtocol("PAPZChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
58
0
    }
59
0
    AUTO_PROFILER_LABEL("PAPZ::Msg___delete__", OTHER);
60
0
    if ((!(StateTransition(true, (&((actor)->mLivenessState)))))) {
61
0
        mozilla::ipc::LogicError("Transition error");
62
0
    }
63
0
64
0
    bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
65
0
66
0
    IProtocol* mgr = (actor)->Manager();
67
0
    (actor)->DestroySubtree(Deletion);
68
0
    (actor)->DeallocSubtree();
69
0
    (mgr)->RemoveManagee(PAPZMsgStart, actor);
70
0
    return sendok__;
71
0
}
72
73
auto PAPZChild::RemoveManagee(
74
        int32_t aProtocolId,
75
        IProtocol* aListener) -> void
76
0
{
77
0
    FatalError("unreached");
78
0
    return;
79
0
}
80
81
auto PAPZChild::OnMessageReceived(const Message& msg__) -> PAPZChild::Result
82
0
{
83
0
    switch ((msg__).type()) {
84
0
    case PAPZ::Reply___delete____ID:
85
0
        {
86
0
            return MsgProcessed;
87
0
        }
88
0
    case PAPZ::Msg_RequestContentRepaint__ID:
89
0
        {
90
0
            if (mozilla::ipc::LoggingEnabledFor("PAPZChild")) {
91
0
                mozilla::ipc::LogMessageForProtocol("PAPZChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
92
0
            }
93
0
            AUTO_PROFILER_LABEL("PAPZ::Msg_RequestContentRepaint", OTHER);
94
0
95
0
            PickleIterator iter__(msg__);
96
0
            FrameMetrics frame;
97
0
98
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(frame)))))) {
99
0
                FatalError("Error deserializing 'FrameMetrics'");
100
0
                return MsgValueError;
101
0
            }
102
0
            // Sentinel = 'frame'
103
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 66854026)))) {
104
0
                mozilla::ipc::SentinelReadError("Error deserializing 'FrameMetrics'");
105
0
                return MsgValueError;
106
0
            }
107
0
            (msg__).EndRead(iter__, (msg__).type());
108
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
109
0
                FatalError("Transition error");
110
0
                return MsgValueError;
111
0
            }
112
0
            if ((!(RecvRequestContentRepaint(frame)))) {
113
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
114
0
                // Error handled in mozilla::ipc::IPCResult
115
0
                return MsgProcessingError;
116
0
            }
117
0
118
0
            return MsgProcessed;
119
0
        }
120
0
    case PAPZ::Msg_UpdateOverscrollVelocity__ID:
121
0
        {
122
0
            if (mozilla::ipc::LoggingEnabledFor("PAPZChild")) {
123
0
                mozilla::ipc::LogMessageForProtocol("PAPZChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
124
0
            }
125
0
            AUTO_PROFILER_LABEL("PAPZ::Msg_UpdateOverscrollVelocity", OTHER);
126
0
127
0
            PickleIterator iter__(msg__);
128
0
            float aX;
129
0
            float aY;
130
0
            bool aIsRootContent;
131
0
132
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aX)))))) {
133
0
                FatalError("Error deserializing 'float'");
134
0
                return MsgValueError;
135
0
            }
136
0
            // Sentinel = 'aX'
137
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2745208761)))) {
138
0
                mozilla::ipc::SentinelReadError("Error deserializing 'float'");
139
0
                return MsgValueError;
140
0
            }
141
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aY)))))) {
142
0
                FatalError("Error deserializing 'float'");
143
0
                return MsgValueError;
144
0
            }
145
0
            // Sentinel = 'aY'
146
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2745208760)))) {
147
0
                mozilla::ipc::SentinelReadError("Error deserializing 'float'");
148
0
                return MsgValueError;
149
0
            }
150
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aIsRootContent)))))) {
151
0
                FatalError("Error deserializing 'bool'");
152
0
                return MsgValueError;
153
0
            }
154
0
            // Sentinel = 'aIsRootContent'
155
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 332943914)))) {
156
0
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
157
0
                return MsgValueError;
158
0
            }
159
0
            (msg__).EndRead(iter__, (msg__).type());
160
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
161
0
                FatalError("Transition error");
162
0
                return MsgValueError;
163
0
            }
164
0
            if ((!(RecvUpdateOverscrollVelocity(aX, aY, aIsRootContent)))) {
165
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
166
0
                // Error handled in mozilla::ipc::IPCResult
167
0
                return MsgProcessingError;
168
0
            }
169
0
170
0
            return MsgProcessed;
171
0
        }
172
0
    case PAPZ::Msg_UpdateOverscrollOffset__ID:
173
0
        {
174
0
            if (mozilla::ipc::LoggingEnabledFor("PAPZChild")) {
175
0
                mozilla::ipc::LogMessageForProtocol("PAPZChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
176
0
            }
177
0
            AUTO_PROFILER_LABEL("PAPZ::Msg_UpdateOverscrollOffset", OTHER);
178
0
179
0
            PickleIterator iter__(msg__);
180
0
            float aX;
181
0
            float aY;
182
0
            bool aIsRootContent;
183
0
184
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aX)))))) {
185
0
                FatalError("Error deserializing 'float'");
186
0
                return MsgValueError;
187
0
            }
188
0
            // Sentinel = 'aX'
189
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2745208761)))) {
190
0
                mozilla::ipc::SentinelReadError("Error deserializing 'float'");
191
0
                return MsgValueError;
192
0
            }
193
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aY)))))) {
194
0
                FatalError("Error deserializing 'float'");
195
0
                return MsgValueError;
196
0
            }
197
0
            // Sentinel = 'aY'
198
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2745208760)))) {
199
0
                mozilla::ipc::SentinelReadError("Error deserializing 'float'");
200
0
                return MsgValueError;
201
0
            }
202
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aIsRootContent)))))) {
203
0
                FatalError("Error deserializing 'bool'");
204
0
                return MsgValueError;
205
0
            }
206
0
            // Sentinel = 'aIsRootContent'
207
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 332943914)))) {
208
0
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
209
0
                return MsgValueError;
210
0
            }
211
0
            (msg__).EndRead(iter__, (msg__).type());
212
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
213
0
                FatalError("Transition error");
214
0
                return MsgValueError;
215
0
            }
216
0
            if ((!(RecvUpdateOverscrollOffset(aX, aY, aIsRootContent)))) {
217
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
218
0
                // Error handled in mozilla::ipc::IPCResult
219
0
                return MsgProcessingError;
220
0
            }
221
0
222
0
            return MsgProcessed;
223
0
        }
224
0
    case PAPZ::Msg_NotifyMozMouseScrollEvent__ID:
225
0
        {
226
0
            if (mozilla::ipc::LoggingEnabledFor("PAPZChild")) {
227
0
                mozilla::ipc::LogMessageForProtocol("PAPZChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
228
0
            }
229
0
            AUTO_PROFILER_LABEL("PAPZ::Msg_NotifyMozMouseScrollEvent", OTHER);
230
0
231
0
            PickleIterator iter__(msg__);
232
0
            ViewID aScrollId;
233
0
            nsString aEvent;
234
0
235
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aScrollId)))))) {
236
0
                FatalError("Error deserializing 'ViewID'");
237
0
                return MsgValueError;
238
0
            }
239
0
            // Sentinel = 'aScrollId'
240
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4217802004)))) {
241
0
                mozilla::ipc::SentinelReadError("Error deserializing 'ViewID'");
242
0
                return MsgValueError;
243
0
            }
244
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aEvent)))))) {
245
0
                FatalError("Error deserializing 'nsString'");
246
0
                return MsgValueError;
247
0
            }
248
0
            // Sentinel = 'aEvent'
249
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3531117325)))) {
250
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
251
0
                return MsgValueError;
252
0
            }
253
0
            (msg__).EndRead(iter__, (msg__).type());
254
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
255
0
                FatalError("Transition error");
256
0
                return MsgValueError;
257
0
            }
258
0
            if ((!(RecvNotifyMozMouseScrollEvent(aScrollId, aEvent)))) {
259
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
260
0
                // Error handled in mozilla::ipc::IPCResult
261
0
                return MsgProcessingError;
262
0
            }
263
0
264
0
            return MsgProcessed;
265
0
        }
266
0
    case PAPZ::Msg_NotifyAPZStateChange__ID:
267
0
        {
268
0
            if (mozilla::ipc::LoggingEnabledFor("PAPZChild")) {
269
0
                mozilla::ipc::LogMessageForProtocol("PAPZChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
270
0
            }
271
0
            AUTO_PROFILER_LABEL("PAPZ::Msg_NotifyAPZStateChange", OTHER);
272
0
273
0
            PickleIterator iter__(msg__);
274
0
            ScrollableLayerGuid aGuid;
275
0
            APZStateChange aChange;
276
0
            int aArg;
277
0
278
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aGuid)))))) {
279
0
                FatalError("Error deserializing 'ScrollableLayerGuid'");
280
0
                return MsgValueError;
281
0
            }
282
0
            // Sentinel = 'aGuid'
283
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2369323719)))) {
284
0
                mozilla::ipc::SentinelReadError("Error deserializing 'ScrollableLayerGuid'");
285
0
                return MsgValueError;
286
0
            }
287
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aChange)))))) {
288
0
                FatalError("Error deserializing 'APZStateChange'");
289
0
                return MsgValueError;
290
0
            }
291
0
            // Sentinel = 'aChange'
292
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1262903642)))) {
293
0
                mozilla::ipc::SentinelReadError("Error deserializing 'APZStateChange'");
294
0
                return MsgValueError;
295
0
            }
296
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aArg)))))) {
297
0
                FatalError("Error deserializing 'int'");
298
0
                return MsgValueError;
299
0
            }
300
0
            // Sentinel = 'aArg'
301
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3458203231)))) {
302
0
                mozilla::ipc::SentinelReadError("Error deserializing 'int'");
303
0
                return MsgValueError;
304
0
            }
305
0
            (msg__).EndRead(iter__, (msg__).type());
306
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
307
0
                FatalError("Transition error");
308
0
                return MsgValueError;
309
0
            }
310
0
            if ((!(RecvNotifyAPZStateChange(aGuid, aChange, aArg)))) {
311
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
312
0
                // Error handled in mozilla::ipc::IPCResult
313
0
                return MsgProcessingError;
314
0
            }
315
0
316
0
            return MsgProcessed;
317
0
        }
318
0
    case PAPZ::Msg_NotifyFlushComplete__ID:
319
0
        {
320
0
            if (mozilla::ipc::LoggingEnabledFor("PAPZChild")) {
321
0
                mozilla::ipc::LogMessageForProtocol("PAPZChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
322
0
            }
323
0
            AUTO_PROFILER_LABEL("PAPZ::Msg_NotifyFlushComplete", OTHER);
324
0
325
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
326
0
                FatalError("Transition error");
327
0
                return MsgValueError;
328
0
            }
329
0
            if ((!(RecvNotifyFlushComplete()))) {
330
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
331
0
                // Error handled in mozilla::ipc::IPCResult
332
0
                return MsgProcessingError;
333
0
            }
334
0
335
0
            return MsgProcessed;
336
0
        }
337
0
    case PAPZ::Msg_NotifyAsyncScrollbarDragRejected__ID:
338
0
        {
339
0
            if (mozilla::ipc::LoggingEnabledFor("PAPZChild")) {
340
0
                mozilla::ipc::LogMessageForProtocol("PAPZChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
341
0
            }
342
0
            AUTO_PROFILER_LABEL("PAPZ::Msg_NotifyAsyncScrollbarDragRejected", OTHER);
343
0
344
0
            PickleIterator iter__(msg__);
345
0
            ViewID aScrollId;
346
0
347
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aScrollId)))))) {
348
0
                FatalError("Error deserializing 'ViewID'");
349
0
                return MsgValueError;
350
0
            }
351
0
            // Sentinel = 'aScrollId'
352
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4217802004)))) {
353
0
                mozilla::ipc::SentinelReadError("Error deserializing 'ViewID'");
354
0
                return MsgValueError;
355
0
            }
356
0
            (msg__).EndRead(iter__, (msg__).type());
357
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
358
0
                FatalError("Transition error");
359
0
                return MsgValueError;
360
0
            }
361
0
            if ((!(RecvNotifyAsyncScrollbarDragRejected(aScrollId)))) {
362
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
363
0
                // Error handled in mozilla::ipc::IPCResult
364
0
                return MsgProcessingError;
365
0
            }
366
0
367
0
            return MsgProcessed;
368
0
        }
369
0
    case PAPZ::Msg_NotifyAsyncAutoscrollRejected__ID:
370
0
        {
371
0
            if (mozilla::ipc::LoggingEnabledFor("PAPZChild")) {
372
0
                mozilla::ipc::LogMessageForProtocol("PAPZChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
373
0
            }
374
0
            AUTO_PROFILER_LABEL("PAPZ::Msg_NotifyAsyncAutoscrollRejected", OTHER);
375
0
376
0
            PickleIterator iter__(msg__);
377
0
            ViewID aScrollId;
378
0
379
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aScrollId)))))) {
380
0
                FatalError("Error deserializing 'ViewID'");
381
0
                return MsgValueError;
382
0
            }
383
0
            // Sentinel = 'aScrollId'
384
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4217802004)))) {
385
0
                mozilla::ipc::SentinelReadError("Error deserializing 'ViewID'");
386
0
                return MsgValueError;
387
0
            }
388
0
            (msg__).EndRead(iter__, (msg__).type());
389
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
390
0
                FatalError("Transition error");
391
0
                return MsgValueError;
392
0
            }
393
0
            if ((!(RecvNotifyAsyncAutoscrollRejected(aScrollId)))) {
394
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
395
0
                // Error handled in mozilla::ipc::IPCResult
396
0
                return MsgProcessingError;
397
0
            }
398
0
399
0
            return MsgProcessed;
400
0
        }
401
0
    case PAPZ::Msg_Destroy__ID:
402
0
        {
403
0
            if (mozilla::ipc::LoggingEnabledFor("PAPZChild")) {
404
0
                mozilla::ipc::LogMessageForProtocol("PAPZChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
405
0
            }
406
0
            AUTO_PROFILER_LABEL("PAPZ::Msg_Destroy", OTHER);
407
0
408
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
409
0
                FatalError("Transition error");
410
0
                return MsgValueError;
411
0
            }
412
0
            if ((!(RecvDestroy()))) {
413
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
414
0
                // Error handled in mozilla::ipc::IPCResult
415
0
                return MsgProcessingError;
416
0
            }
417
0
418
0
            return MsgProcessed;
419
0
        }
420
0
    default:
421
0
        {
422
0
            return MsgNotKnown;
423
0
        }
424
0
    }
425
0
}
426
427
auto PAPZChild::OnMessageReceived(
428
        const Message& msg__,
429
        Message*& reply__) -> PAPZChild::Result
430
0
{
431
0
    return MsgNotKnown;
432
0
}
433
434
auto PAPZChild::OnCallReceived(
435
        const Message& msg__,
436
        Message*& reply__) -> PAPZChild::Result
437
0
{
438
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
439
0
    return MsgNotKnown;
440
0
}
441
442
auto PAPZChild::GetProtocolTypeId() -> int32_t
443
0
{
444
0
    return PAPZMsgStart;
445
0
}
446
447
auto PAPZChild::DestroySubtree(ActorDestroyReason why) -> void
448
0
{
449
0
    // Unregister from our manager.
450
0
    Unregister(Id());
451
0
452
0
    // Reject owning pending responses.
453
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
454
0
455
0
    // Finally, destroy "us".
456
0
    ActorDestroy(why);
457
0
}
458
459
auto PAPZChild::DeallocSubtree() -> void
460
0
{
461
0
}
462
463
464
465
} // namespace layers
466
} // namespace mozilla
467
namespace mozilla {
468
namespace ipc {
469
auto IPDLParamTraits<mozilla::layers::PAPZChild>::Write(
470
        IPC::Message* aMsg,
471
        mozilla::ipc::IProtocol* aActor,
472
        const paramType& aVar) -> void
473
0
{
474
0
    int32_t id;
475
0
    if ((!(aVar))) {
476
0
        id = 0;
477
0
    }
478
0
    else {
479
0
        id = (aVar)->Id();
480
0
        if ((1) == (id)) {
481
0
            (aActor)->FatalError("actor has been |delete|d");
482
0
        }
483
0
    }
484
0
    WriteIPDLParam(aMsg, aActor, id);
485
0
}
486
487
auto IPDLParamTraits<mozilla::layers::PAPZChild>::Read(
488
        const IPC::Message* aMsg,
489
        PickleIterator* aIter,
490
        mozilla::ipc::IProtocol* aActor,
491
        paramType* aVar) -> bool
492
0
{
493
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PAPZ", PAPZMsgStart);
494
0
    if ((actor).isNothing()) {
495
0
        return false;
496
0
    }
497
0
498
0
    (*(aVar)) = static_cast<mozilla::layers::PAPZChild*>((actor).value());
499
0
    return true;
500
0
}
501
502
} // namespace ipc
503
} // namespace mozilla