Coverage Report

Created: 2018-09-25 14:53

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