Coverage Report

Created: 2018-09-25 14:53

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