Coverage Report

Created: 2018-09-25 14:53

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