Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PVsyncParent.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/layout/PVsyncParent.h"
8
#include "mozilla/TimeStamp.h"
9
10
#include "mozilla/ipc/PBackgroundParent.h"
11
12
#include "nsIFile.h"
13
#include "GeckoProfiler.h"
14
15
namespace mozilla {
16
namespace layout {
17
18
19
auto PVsyncParent::Recv__delete__() -> mozilla::ipc::IPCResult
20
0
{
21
0
    return IPC_OK();
22
0
}
23
24
auto PVsyncParent::ActorDestroy(ActorDestroyReason aWhy) -> void
25
0
{
26
0
}
27
28
MOZ_IMPLICIT PVsyncParent::PVsyncParent() :
29
    mozilla::ipc::IProtocol(mozilla::ipc::ParentSide),
30
    mLivenessState(mozilla::ipc::LivenessState::Dead)
31
0
{
32
0
    MOZ_COUNT_CTOR(PVsyncParent);
33
0
}
34
35
PVsyncParent::~PVsyncParent()
36
0
{
37
0
    MOZ_COUNT_DTOR(PVsyncParent);
38
0
}
39
40
auto PVsyncParent::Manager() const -> PBackgroundParent*
41
0
{
42
0
    return static_cast<PBackgroundParent*>(IProtocol::Manager());
43
0
}
44
45
auto PVsyncParent::SendNotify(const TimeStamp& aVsyncTimestamp) -> bool
46
0
{
47
0
    IPC::Message* msg__ = PVsync::Msg_Notify(Id());
48
0
49
0
    WriteIPDLParam(msg__, this, aVsyncTimestamp);
50
0
    // Sentinel = 'aVsyncTimestamp'
51
0
    (msg__)->WriteSentinel(4125926023);
52
0
53
0
54
0
55
0
56
0
    if (mozilla::ipc::LoggingEnabledFor("PVsyncParent")) {
57
0
        mozilla::ipc::LogMessageForProtocol("PVsyncParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
58
0
    }
59
0
    AUTO_PROFILER_LABEL("PVsync::Msg_Notify", 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 PVsyncParent::SendVsyncRate(const float& aVsyncRate) -> bool
69
0
{
70
0
    IPC::Message* msg__ = PVsync::Msg_VsyncRate(Id());
71
0
72
0
    WriteIPDLParam(msg__, this, aVsyncRate);
73
0
    // Sentinel = 'aVsyncRate'
74
0
    (msg__)->WriteSentinel(4032022932);
75
0
76
0
77
0
78
0
79
0
    if (mozilla::ipc::LoggingEnabledFor("PVsyncParent")) {
80
0
        mozilla::ipc::LogMessageForProtocol("PVsyncParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
81
0
    }
82
0
    AUTO_PROFILER_LABEL("PVsync::Msg_VsyncRate", 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 PVsyncParent::RemoveManagee(
92
        int32_t aProtocolId,
93
        IProtocol* aListener) -> void
94
0
{
95
0
    FatalError("unreached");
96
0
    return;
97
0
}
98
99
auto PVsyncParent::OnMessageReceived(const Message& msg__) -> PVsyncParent::Result
100
0
{
101
0
    switch ((msg__).type()) {
102
0
    case PVsync::Msg_Observe__ID:
103
0
        {
104
0
            if (mozilla::ipc::LoggingEnabledFor("PVsyncParent")) {
105
0
                mozilla::ipc::LogMessageForProtocol("PVsyncParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
106
0
            }
107
0
            AUTO_PROFILER_LABEL("PVsync::Msg_Observe", OTHER);
108
0
109
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
110
0
                FatalError("Transition error");
111
0
                return MsgValueError;
112
0
            }
113
0
            if ((!(RecvObserve()))) {
114
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
115
0
                // Error handled in mozilla::ipc::IPCResult
116
0
                return MsgProcessingError;
117
0
            }
118
0
119
0
            return MsgProcessed;
120
0
        }
121
0
    case PVsync::Msg_Unobserve__ID:
122
0
        {
123
0
            if (mozilla::ipc::LoggingEnabledFor("PVsyncParent")) {
124
0
                mozilla::ipc::LogMessageForProtocol("PVsyncParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
125
0
            }
126
0
            AUTO_PROFILER_LABEL("PVsync::Msg_Unobserve", OTHER);
127
0
128
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
129
0
                FatalError("Transition error");
130
0
                return MsgValueError;
131
0
            }
132
0
            if ((!(RecvUnobserve()))) {
133
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
134
0
                // Error handled in mozilla::ipc::IPCResult
135
0
                return MsgProcessingError;
136
0
            }
137
0
138
0
            return MsgProcessed;
139
0
        }
140
0
    case PVsync::Msg_RequestVsyncRate__ID:
141
0
        {
142
0
            if (mozilla::ipc::LoggingEnabledFor("PVsyncParent")) {
143
0
                mozilla::ipc::LogMessageForProtocol("PVsyncParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
144
0
            }
145
0
            AUTO_PROFILER_LABEL("PVsync::Msg_RequestVsyncRate", OTHER);
146
0
147
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
148
0
                FatalError("Transition error");
149
0
                return MsgValueError;
150
0
            }
151
0
            if ((!(RecvRequestVsyncRate()))) {
152
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
153
0
                // Error handled in mozilla::ipc::IPCResult
154
0
                return MsgProcessingError;
155
0
            }
156
0
157
0
            return MsgProcessed;
158
0
        }
159
0
    case PVsync::Msg___delete____ID:
160
0
        {
161
0
            if (mozilla::ipc::LoggingEnabledFor("PVsyncParent")) {
162
0
                mozilla::ipc::LogMessageForProtocol("PVsyncParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
163
0
            }
164
0
            AUTO_PROFILER_LABEL("PVsync::Msg___delete__", OTHER);
165
0
166
0
            PickleIterator iter__(msg__);
167
0
            PVsyncParent* actor;
168
0
169
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
170
0
                FatalError("Error deserializing 'PVsyncParent'");
171
0
                return MsgValueError;
172
0
            }
173
0
            if ((!((*((&(actor))))))) {
174
0
                FatalError("Error deserializing 'PVsyncParent'");
175
0
                return MsgValueError;
176
0
            }
177
0
            // Sentinel = 'actor'
178
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
179
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PVsyncParent'");
180
0
                return MsgValueError;
181
0
            }
182
0
            (msg__).EndRead(iter__, (msg__).type());
183
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
184
0
                FatalError("Transition error");
185
0
                return MsgValueError;
186
0
            }
187
0
            if ((!(Recv__delete__()))) {
188
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
189
0
                // Error handled in mozilla::ipc::IPCResult
190
0
                return MsgProcessingError;
191
0
            }
192
0
193
0
194
0
            IProtocol* mgr = (actor)->Manager();
195
0
            (actor)->DestroySubtree(Deletion);
196
0
            (actor)->DeallocSubtree();
197
0
            (mgr)->RemoveManagee(PVsyncMsgStart, actor);
198
0
199
0
            return MsgProcessed;
200
0
        }
201
0
    default:
202
0
        {
203
0
            return MsgNotKnown;
204
0
        }
205
0
    }
206
0
}
207
208
auto PVsyncParent::OnMessageReceived(
209
        const Message& msg__,
210
        Message*& reply__) -> PVsyncParent::Result
211
0
{
212
0
    return MsgNotKnown;
213
0
}
214
215
auto PVsyncParent::OnCallReceived(
216
        const Message& msg__,
217
        Message*& reply__) -> PVsyncParent::Result
218
0
{
219
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
220
0
    return MsgNotKnown;
221
0
}
222
223
auto PVsyncParent::GetProtocolTypeId() -> int32_t
224
0
{
225
0
    return PVsyncMsgStart;
226
0
}
227
228
auto PVsyncParent::DestroySubtree(ActorDestroyReason why) -> void
229
0
{
230
0
    // Unregister from our manager.
231
0
    Unregister(Id());
232
0
233
0
    // Reject owning pending responses.
234
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
235
0
236
0
    // Finally, destroy "us".
237
0
    ActorDestroy(why);
238
0
}
239
240
auto PVsyncParent::DeallocSubtree() -> void
241
0
{
242
0
}
243
244
245
246
} // namespace layout
247
} // namespace mozilla
248
namespace mozilla {
249
namespace ipc {
250
auto IPDLParamTraits<mozilla::layout::PVsyncParent>::Write(
251
        IPC::Message* aMsg,
252
        mozilla::ipc::IProtocol* aActor,
253
        const paramType& aVar) -> void
254
0
{
255
0
    int32_t id;
256
0
    if ((!(aVar))) {
257
0
        id = 0;
258
0
    }
259
0
    else {
260
0
        id = (aVar)->Id();
261
0
        if ((1) == (id)) {
262
0
            (aActor)->FatalError("actor has been |delete|d");
263
0
        }
264
0
    }
265
0
    WriteIPDLParam(aMsg, aActor, id);
266
0
}
267
268
auto IPDLParamTraits<mozilla::layout::PVsyncParent>::Read(
269
        const IPC::Message* aMsg,
270
        PickleIterator* aIter,
271
        mozilla::ipc::IProtocol* aActor,
272
        paramType* aVar) -> bool
273
0
{
274
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PVsync", PVsyncMsgStart);
275
0
    if ((actor).isNothing()) {
276
0
        return false;
277
0
    }
278
0
279
0
    (*(aVar)) = static_cast<mozilla::layout::PVsyncParent*>((actor).value());
280
0
    return true;
281
0
}
282
283
} // namespace ipc
284
} // namespace mozilla