Coverage Report

Created: 2018-09-25 14:53

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