Coverage Report

Created: 2018-09-25 14:53

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