Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PIPCBlobInputStreamChild.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/ipc/PIPCBlobInputStreamChild.h"
8
9
#include "mozilla/ipc/PBackgroundChild.h"
10
#include "mozilla/ipc/PChildToParentStreamChild.h"
11
#include "mozilla/dom/PContentChild.h"
12
#include "mozilla/dom/PContentBridgeChild.h"
13
#include "mozilla/ipc/PFileDescriptorSetChild.h"
14
#include "mozilla/ipc/PParentToChildStreamChild.h"
15
16
#include "nsIFile.h"
17
#include "GeckoProfiler.h"
18
19
namespace mozilla {
20
namespace ipc {
21
22
23
auto PIPCBlobInputStreamChild::Recv__delete__() -> mozilla::ipc::IPCResult
24
0
{
25
0
    return IPC_OK();
26
0
}
27
28
auto PIPCBlobInputStreamChild::ActorDestroy(ActorDestroyReason aWhy) -> void
29
0
{
30
0
}
31
32
MOZ_IMPLICIT PIPCBlobInputStreamChild::PIPCBlobInputStreamChild() :
33
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
34
    mLivenessState(mozilla::ipc::LivenessState::Dead)
35
0
{
36
0
    MOZ_COUNT_CTOR(PIPCBlobInputStreamChild);
37
0
}
38
39
PIPCBlobInputStreamChild::~PIPCBlobInputStreamChild()
40
0
{
41
0
    MOZ_COUNT_DTOR(PIPCBlobInputStreamChild);
42
0
}
43
44
auto PIPCBlobInputStreamChild::SendStreamNeeded() -> bool
45
0
{
46
0
    IPC::Message* msg__ = PIPCBlobInputStream::Msg_StreamNeeded(Id());
47
0
48
0
49
0
50
0
51
0
52
0
    if (mozilla::ipc::LoggingEnabledFor("PIPCBlobInputStreamChild")) {
53
0
        mozilla::ipc::LogMessageForProtocol("PIPCBlobInputStreamChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
54
0
    }
55
0
    AUTO_PROFILER_LABEL("PIPCBlobInputStream::Msg_StreamNeeded", OTHER);
56
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
57
0
        mozilla::ipc::LogicError("Transition error");
58
0
    }
59
0
60
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
61
0
    return sendok__;
62
0
}
63
64
auto PIPCBlobInputStreamChild::SendLengthNeeded() -> bool
65
0
{
66
0
    IPC::Message* msg__ = PIPCBlobInputStream::Msg_LengthNeeded(Id());
67
0
68
0
69
0
70
0
71
0
72
0
    if (mozilla::ipc::LoggingEnabledFor("PIPCBlobInputStreamChild")) {
73
0
        mozilla::ipc::LogMessageForProtocol("PIPCBlobInputStreamChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
74
0
    }
75
0
    AUTO_PROFILER_LABEL("PIPCBlobInputStream::Msg_LengthNeeded", OTHER);
76
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
77
0
        mozilla::ipc::LogicError("Transition error");
78
0
    }
79
0
80
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
81
0
    return sendok__;
82
0
}
83
84
auto PIPCBlobInputStreamChild::SendClose() -> bool
85
0
{
86
0
    IPC::Message* msg__ = PIPCBlobInputStream::Msg_Close(Id());
87
0
88
0
89
0
90
0
91
0
92
0
    if (mozilla::ipc::LoggingEnabledFor("PIPCBlobInputStreamChild")) {
93
0
        mozilla::ipc::LogMessageForProtocol("PIPCBlobInputStreamChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
94
0
    }
95
0
    AUTO_PROFILER_LABEL("PIPCBlobInputStream::Msg_Close", OTHER);
96
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
97
0
        mozilla::ipc::LogicError("Transition error");
98
0
    }
99
0
100
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
101
0
    return sendok__;
102
0
}
103
104
auto PIPCBlobInputStreamChild::Send__delete__(PIPCBlobInputStreamChild* actor) -> bool
105
0
{
106
0
    if ((!(actor))) {
107
0
        return false;
108
0
    }
109
0
110
0
    IPC::Message* msg__ = PIPCBlobInputStream::Msg___delete__((actor)->Id());
111
0
112
0
    MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param");
113
0
    WriteIPDLParam(msg__, actor, actor);
114
0
    // Sentinel = 'actor'
115
0
    (msg__)->WriteSentinel(875202478);
116
0
117
0
118
0
119
0
    if (mozilla::ipc::LoggingEnabledFor("PIPCBlobInputStreamChild")) {
120
0
        mozilla::ipc::LogMessageForProtocol("PIPCBlobInputStreamChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
121
0
    }
122
0
    AUTO_PROFILER_LABEL("PIPCBlobInputStream::Msg___delete__", OTHER);
123
0
    if ((!(StateTransition(true, (&((actor)->mLivenessState)))))) {
124
0
        mozilla::ipc::LogicError("Transition error");
125
0
    }
126
0
127
0
    bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
128
0
129
0
    IProtocol* mgr = (actor)->Manager();
130
0
    (actor)->DestroySubtree(Deletion);
131
0
    (actor)->DeallocSubtree();
132
0
    (mgr)->RemoveManagee(PIPCBlobInputStreamMsgStart, actor);
133
0
    return sendok__;
134
0
}
135
136
auto PIPCBlobInputStreamChild::RemoveManagee(
137
        int32_t aProtocolId,
138
        IProtocol* aListener) -> void
139
0
{
140
0
    FatalError("unreached");
141
0
    return;
142
0
}
143
144
auto PIPCBlobInputStreamChild::OnMessageReceived(const Message& msg__) -> PIPCBlobInputStreamChild::Result
145
0
{
146
0
    switch ((msg__).type()) {
147
0
    case PIPCBlobInputStream::Msg_StreamReady__ID:
148
0
        {
149
0
            if (mozilla::ipc::LoggingEnabledFor("PIPCBlobInputStreamChild")) {
150
0
                mozilla::ipc::LogMessageForProtocol("PIPCBlobInputStreamChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
151
0
            }
152
0
            AUTO_PROFILER_LABEL("PIPCBlobInputStream::Msg_StreamReady", OTHER);
153
0
154
0
            PickleIterator iter__(msg__);
155
0
            OptionalIPCStream aStream;
156
0
157
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aStream)))))) {
158
0
                FatalError("Error deserializing 'OptionalIPCStream'");
159
0
                return MsgValueError;
160
0
            }
161
0
            // Sentinel = 'aStream'
162
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3415320318)))) {
163
0
                mozilla::ipc::SentinelReadError("Error deserializing 'OptionalIPCStream'");
164
0
                return MsgValueError;
165
0
            }
166
0
            (msg__).EndRead(iter__, (msg__).type());
167
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
168
0
                FatalError("Transition error");
169
0
                return MsgValueError;
170
0
            }
171
0
            if ((!(RecvStreamReady(aStream)))) {
172
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
173
0
                // Error handled in mozilla::ipc::IPCResult
174
0
                return MsgProcessingError;
175
0
            }
176
0
177
0
            return MsgProcessed;
178
0
        }
179
0
    case PIPCBlobInputStream::Msg_LengthReady__ID:
180
0
        {
181
0
            if (mozilla::ipc::LoggingEnabledFor("PIPCBlobInputStreamChild")) {
182
0
                mozilla::ipc::LogMessageForProtocol("PIPCBlobInputStreamChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
183
0
            }
184
0
            AUTO_PROFILER_LABEL("PIPCBlobInputStream::Msg_LengthReady", OTHER);
185
0
186
0
            PickleIterator iter__(msg__);
187
0
            int64_t aLength;
188
0
189
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aLength)))))) {
190
0
                FatalError("Error deserializing 'int64_t'");
191
0
                return MsgValueError;
192
0
            }
193
0
            // Sentinel = 'aLength'
194
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2696905790)))) {
195
0
                mozilla::ipc::SentinelReadError("Error deserializing 'int64_t'");
196
0
                return MsgValueError;
197
0
            }
198
0
            (msg__).EndRead(iter__, (msg__).type());
199
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
200
0
                FatalError("Transition error");
201
0
                return MsgValueError;
202
0
            }
203
0
            if ((!(RecvLengthReady(aLength)))) {
204
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
205
0
                // Error handled in mozilla::ipc::IPCResult
206
0
                return MsgProcessingError;
207
0
            }
208
0
209
0
            return MsgProcessed;
210
0
        }
211
0
    case PIPCBlobInputStream::Reply___delete____ID:
212
0
        {
213
0
            return MsgProcessed;
214
0
        }
215
0
    case PIPCBlobInputStream::Msg___delete____ID:
216
0
        {
217
0
            if (mozilla::ipc::LoggingEnabledFor("PIPCBlobInputStreamChild")) {
218
0
                mozilla::ipc::LogMessageForProtocol("PIPCBlobInputStreamChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
219
0
            }
220
0
            AUTO_PROFILER_LABEL("PIPCBlobInputStream::Msg___delete__", OTHER);
221
0
222
0
            PickleIterator iter__(msg__);
223
0
            PIPCBlobInputStreamChild* actor;
224
0
225
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
226
0
                FatalError("Error deserializing 'PIPCBlobInputStreamChild'");
227
0
                return MsgValueError;
228
0
            }
229
0
            if ((!((*((&(actor))))))) {
230
0
                FatalError("Error deserializing 'PIPCBlobInputStreamChild'");
231
0
                return MsgValueError;
232
0
            }
233
0
            // Sentinel = 'actor'
234
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
235
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PIPCBlobInputStreamChild'");
236
0
                return MsgValueError;
237
0
            }
238
0
            (msg__).EndRead(iter__, (msg__).type());
239
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
240
0
                FatalError("Transition error");
241
0
                return MsgValueError;
242
0
            }
243
0
            if ((!(Recv__delete__()))) {
244
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
245
0
                // Error handled in mozilla::ipc::IPCResult
246
0
                return MsgProcessingError;
247
0
            }
248
0
249
0
250
0
            IProtocol* mgr = (actor)->Manager();
251
0
            (actor)->DestroySubtree(Deletion);
252
0
            (actor)->DeallocSubtree();
253
0
            (mgr)->RemoveManagee(PIPCBlobInputStreamMsgStart, actor);
254
0
255
0
            return MsgProcessed;
256
0
        }
257
0
    default:
258
0
        {
259
0
            return MsgNotKnown;
260
0
        }
261
0
    }
262
0
}
263
264
auto PIPCBlobInputStreamChild::OnMessageReceived(
265
        const Message& msg__,
266
        Message*& reply__) -> PIPCBlobInputStreamChild::Result
267
0
{
268
0
    return MsgNotKnown;
269
0
}
270
271
auto PIPCBlobInputStreamChild::OnCallReceived(
272
        const Message& msg__,
273
        Message*& reply__) -> PIPCBlobInputStreamChild::Result
274
0
{
275
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
276
0
    return MsgNotKnown;
277
0
}
278
279
auto PIPCBlobInputStreamChild::GetProtocolTypeId() -> int32_t
280
0
{
281
0
    return PIPCBlobInputStreamMsgStart;
282
0
}
283
284
auto PIPCBlobInputStreamChild::DestroySubtree(ActorDestroyReason why) -> void
285
0
{
286
0
    // Unregister from our manager.
287
0
    Unregister(Id());
288
0
289
0
    // Reject owning pending responses.
290
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
291
0
292
0
    // Finally, destroy "us".
293
0
    ActorDestroy(why);
294
0
}
295
296
auto PIPCBlobInputStreamChild::DeallocSubtree() -> void
297
0
{
298
0
}
299
300
301
302
} // namespace ipc
303
} // namespace mozilla
304
namespace mozilla {
305
namespace ipc {
306
auto IPDLParamTraits<mozilla::ipc::PIPCBlobInputStreamChild>::Write(
307
        IPC::Message* aMsg,
308
        mozilla::ipc::IProtocol* aActor,
309
        const paramType& aVar) -> void
310
0
{
311
0
    int32_t id;
312
0
    if ((!(aVar))) {
313
0
        id = 0;
314
0
    }
315
0
    else {
316
0
        id = (aVar)->Id();
317
0
        if ((1) == (id)) {
318
0
            (aActor)->FatalError("actor has been |delete|d");
319
0
        }
320
0
    }
321
0
    WriteIPDLParam(aMsg, aActor, id);
322
0
}
323
324
auto IPDLParamTraits<mozilla::ipc::PIPCBlobInputStreamChild>::Read(
325
        const IPC::Message* aMsg,
326
        PickleIterator* aIter,
327
        mozilla::ipc::IProtocol* aActor,
328
        paramType* aVar) -> bool
329
0
{
330
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PIPCBlobInputStream", PIPCBlobInputStreamMsgStart);
331
0
    if ((actor).isNothing()) {
332
0
        return false;
333
0
    }
334
0
335
0
    (*(aVar)) = static_cast<mozilla::ipc::PIPCBlobInputStreamChild*>((actor).value());
336
0
    return true;
337
0
}
338
339
} // namespace ipc
340
} // namespace mozilla