Coverage Report

Created: 2018-09-25 14:53

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