Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PPresentationBuilderChild.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/dom/PPresentationBuilderChild.h"
8
9
#include "mozilla/dom/PPresentationChild.h"
10
11
#include "nsIFile.h"
12
#include "GeckoProfiler.h"
13
14
namespace mozilla {
15
namespace dom {
16
17
18
auto PPresentationBuilderChild::Recv__delete__() -> mozilla::ipc::IPCResult
19
0
{
20
0
    return IPC_OK();
21
0
}
22
23
auto PPresentationBuilderChild::ActorDestroy(ActorDestroyReason aWhy) -> void
24
0
{
25
0
}
26
27
MOZ_IMPLICIT PPresentationBuilderChild::PPresentationBuilderChild() :
28
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
29
    mLivenessState(mozilla::ipc::LivenessState::Dead)
30
0
{
31
0
    MOZ_COUNT_CTOR(PPresentationBuilderChild);
32
0
}
33
34
PPresentationBuilderChild::~PPresentationBuilderChild()
35
0
{
36
0
    MOZ_COUNT_DTOR(PPresentationBuilderChild);
37
0
}
38
39
auto PPresentationBuilderChild::Manager() const -> PPresentationChild*
40
0
{
41
0
    return static_cast<PPresentationChild*>(IProtocol::Manager());
42
0
}
43
44
auto PPresentationBuilderChild::SendSendOffer(const nsString& aSDP) -> bool
45
0
{
46
0
    IPC::Message* msg__ = PPresentationBuilder::Msg_SendOffer(Id());
47
0
48
0
    WriteIPDLParam(msg__, this, aSDP);
49
0
    // Sentinel = 'aSDP'
50
0
    (msg__)->WriteSentinel(2098818728);
51
0
52
0
53
0
54
0
55
0
    if (mozilla::ipc::LoggingEnabledFor("PPresentationBuilderChild")) {
56
0
        mozilla::ipc::LogMessageForProtocol("PPresentationBuilderChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
57
0
    }
58
0
    AUTO_PROFILER_LABEL("PPresentationBuilder::Msg_SendOffer", 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 PPresentationBuilderChild::SendSendAnswer(const nsString& aSDP) -> bool
68
0
{
69
0
    IPC::Message* msg__ = PPresentationBuilder::Msg_SendAnswer(Id());
70
0
71
0
    WriteIPDLParam(msg__, this, aSDP);
72
0
    // Sentinel = 'aSDP'
73
0
    (msg__)->WriteSentinel(2098818728);
74
0
75
0
76
0
77
0
78
0
    if (mozilla::ipc::LoggingEnabledFor("PPresentationBuilderChild")) {
79
0
        mozilla::ipc::LogMessageForProtocol("PPresentationBuilderChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
80
0
    }
81
0
    AUTO_PROFILER_LABEL("PPresentationBuilder::Msg_SendAnswer", 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 PPresentationBuilderChild::SendSendIceCandidate(const nsString& aCandidate) -> bool
91
0
{
92
0
    IPC::Message* msg__ = PPresentationBuilder::Msg_SendIceCandidate(Id());
93
0
94
0
    WriteIPDLParam(msg__, this, aCandidate);
95
0
    // Sentinel = 'aCandidate'
96
0
    (msg__)->WriteSentinel(3277043990);
97
0
98
0
99
0
100
0
101
0
    if (mozilla::ipc::LoggingEnabledFor("PPresentationBuilderChild")) {
102
0
        mozilla::ipc::LogMessageForProtocol("PPresentationBuilderChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
103
0
    }
104
0
    AUTO_PROFILER_LABEL("PPresentationBuilder::Msg_SendIceCandidate", OTHER);
105
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
106
0
        mozilla::ipc::LogicError("Transition error");
107
0
    }
108
0
109
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
110
0
    return sendok__;
111
0
}
112
113
auto PPresentationBuilderChild::SendClose(const nsresult& aReason) -> bool
114
0
{
115
0
    IPC::Message* msg__ = PPresentationBuilder::Msg_Close(Id());
116
0
117
0
    WriteIPDLParam(msg__, this, aReason);
118
0
    // Sentinel = 'aReason'
119
0
    (msg__)->WriteSentinel(829905706);
120
0
121
0
122
0
123
0
124
0
    if (mozilla::ipc::LoggingEnabledFor("PPresentationBuilderChild")) {
125
0
        mozilla::ipc::LogMessageForProtocol("PPresentationBuilderChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
126
0
    }
127
0
    AUTO_PROFILER_LABEL("PPresentationBuilder::Msg_Close", OTHER);
128
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
129
0
        mozilla::ipc::LogicError("Transition error");
130
0
    }
131
0
132
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
133
0
    return sendok__;
134
0
}
135
136
auto PPresentationBuilderChild::SendOnSessionTransport() -> bool
137
0
{
138
0
    IPC::Message* msg__ = PPresentationBuilder::Msg_OnSessionTransport(Id());
139
0
140
0
141
0
142
0
143
0
144
0
    if (mozilla::ipc::LoggingEnabledFor("PPresentationBuilderChild")) {
145
0
        mozilla::ipc::LogMessageForProtocol("PPresentationBuilderChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
146
0
    }
147
0
    AUTO_PROFILER_LABEL("PPresentationBuilder::Msg_OnSessionTransport", OTHER);
148
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
149
0
        mozilla::ipc::LogicError("Transition error");
150
0
    }
151
0
152
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
153
0
    return sendok__;
154
0
}
155
156
auto PPresentationBuilderChild::SendOnSessionTransportError(const nsresult& aReason) -> bool
157
0
{
158
0
    IPC::Message* msg__ = PPresentationBuilder::Msg_OnSessionTransportError(Id());
159
0
160
0
    WriteIPDLParam(msg__, this, aReason);
161
0
    // Sentinel = 'aReason'
162
0
    (msg__)->WriteSentinel(829905706);
163
0
164
0
165
0
166
0
167
0
    if (mozilla::ipc::LoggingEnabledFor("PPresentationBuilderChild")) {
168
0
        mozilla::ipc::LogMessageForProtocol("PPresentationBuilderChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
169
0
    }
170
0
    AUTO_PROFILER_LABEL("PPresentationBuilder::Msg_OnSessionTransportError", OTHER);
171
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
172
0
        mozilla::ipc::LogicError("Transition error");
173
0
    }
174
0
175
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
176
0
    return sendok__;
177
0
}
178
179
auto PPresentationBuilderChild::RemoveManagee(
180
        int32_t aProtocolId,
181
        IProtocol* aListener) -> void
182
0
{
183
0
    FatalError("unreached");
184
0
    return;
185
0
}
186
187
auto PPresentationBuilderChild::OnMessageReceived(const Message& msg__) -> PPresentationBuilderChild::Result
188
0
{
189
0
    switch ((msg__).type()) {
190
0
    case PPresentationBuilder::Msg_OnOffer__ID:
191
0
        {
192
0
            if (mozilla::ipc::LoggingEnabledFor("PPresentationBuilderChild")) {
193
0
                mozilla::ipc::LogMessageForProtocol("PPresentationBuilderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
194
0
            }
195
0
            AUTO_PROFILER_LABEL("PPresentationBuilder::Msg_OnOffer", OTHER);
196
0
197
0
            PickleIterator iter__(msg__);
198
0
            nsString aSDP;
199
0
200
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aSDP)))))) {
201
0
                FatalError("Error deserializing 'nsString'");
202
0
                return MsgValueError;
203
0
            }
204
0
            // Sentinel = 'aSDP'
205
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2098818728)))) {
206
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
207
0
                return MsgValueError;
208
0
            }
209
0
            (msg__).EndRead(iter__, (msg__).type());
210
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
211
0
                FatalError("Transition error");
212
0
                return MsgValueError;
213
0
            }
214
0
            if ((!(RecvOnOffer(aSDP)))) {
215
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
216
0
                // Error handled in mozilla::ipc::IPCResult
217
0
                return MsgProcessingError;
218
0
            }
219
0
220
0
            return MsgProcessed;
221
0
        }
222
0
    case PPresentationBuilder::Msg_OnAnswer__ID:
223
0
        {
224
0
            if (mozilla::ipc::LoggingEnabledFor("PPresentationBuilderChild")) {
225
0
                mozilla::ipc::LogMessageForProtocol("PPresentationBuilderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
226
0
            }
227
0
            AUTO_PROFILER_LABEL("PPresentationBuilder::Msg_OnAnswer", OTHER);
228
0
229
0
            PickleIterator iter__(msg__);
230
0
            nsString aSDP;
231
0
232
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aSDP)))))) {
233
0
                FatalError("Error deserializing 'nsString'");
234
0
                return MsgValueError;
235
0
            }
236
0
            // Sentinel = 'aSDP'
237
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2098818728)))) {
238
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
239
0
                return MsgValueError;
240
0
            }
241
0
            (msg__).EndRead(iter__, (msg__).type());
242
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
243
0
                FatalError("Transition error");
244
0
                return MsgValueError;
245
0
            }
246
0
            if ((!(RecvOnAnswer(aSDP)))) {
247
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
248
0
                // Error handled in mozilla::ipc::IPCResult
249
0
                return MsgProcessingError;
250
0
            }
251
0
252
0
            return MsgProcessed;
253
0
        }
254
0
    case PPresentationBuilder::Msg_OnIceCandidate__ID:
255
0
        {
256
0
            if (mozilla::ipc::LoggingEnabledFor("PPresentationBuilderChild")) {
257
0
                mozilla::ipc::LogMessageForProtocol("PPresentationBuilderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
258
0
            }
259
0
            AUTO_PROFILER_LABEL("PPresentationBuilder::Msg_OnIceCandidate", OTHER);
260
0
261
0
            PickleIterator iter__(msg__);
262
0
            nsString aCandidate;
263
0
264
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aCandidate)))))) {
265
0
                FatalError("Error deserializing 'nsString'");
266
0
                return MsgValueError;
267
0
            }
268
0
            // Sentinel = 'aCandidate'
269
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3277043990)))) {
270
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsString'");
271
0
                return MsgValueError;
272
0
            }
273
0
            (msg__).EndRead(iter__, (msg__).type());
274
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
275
0
                FatalError("Transition error");
276
0
                return MsgValueError;
277
0
            }
278
0
            if ((!(RecvOnIceCandidate(aCandidate)))) {
279
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
280
0
                // Error handled in mozilla::ipc::IPCResult
281
0
                return MsgProcessingError;
282
0
            }
283
0
284
0
            return MsgProcessed;
285
0
        }
286
0
    case PPresentationBuilder::Msg___delete____ID:
287
0
        {
288
0
            if (mozilla::ipc::LoggingEnabledFor("PPresentationBuilderChild")) {
289
0
                mozilla::ipc::LogMessageForProtocol("PPresentationBuilderChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
290
0
            }
291
0
            AUTO_PROFILER_LABEL("PPresentationBuilder::Msg___delete__", OTHER);
292
0
293
0
            PickleIterator iter__(msg__);
294
0
            PPresentationBuilderChild* actor;
295
0
296
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
297
0
                FatalError("Error deserializing 'PPresentationBuilderChild'");
298
0
                return MsgValueError;
299
0
            }
300
0
            if ((!((*((&(actor))))))) {
301
0
                FatalError("Error deserializing 'PPresentationBuilderChild'");
302
0
                return MsgValueError;
303
0
            }
304
0
            // Sentinel = 'actor'
305
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
306
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PPresentationBuilderChild'");
307
0
                return MsgValueError;
308
0
            }
309
0
            (msg__).EndRead(iter__, (msg__).type());
310
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
311
0
                FatalError("Transition error");
312
0
                return MsgValueError;
313
0
            }
314
0
            if ((!(Recv__delete__()))) {
315
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
316
0
                // Error handled in mozilla::ipc::IPCResult
317
0
                return MsgProcessingError;
318
0
            }
319
0
320
0
321
0
            IProtocol* mgr = (actor)->Manager();
322
0
            (actor)->DestroySubtree(Deletion);
323
0
            (actor)->DeallocSubtree();
324
0
            (mgr)->RemoveManagee(PPresentationBuilderMsgStart, actor);
325
0
326
0
            return MsgProcessed;
327
0
        }
328
0
    default:
329
0
        {
330
0
            return MsgNotKnown;
331
0
        }
332
0
    }
333
0
}
334
335
auto PPresentationBuilderChild::OnMessageReceived(
336
        const Message& msg__,
337
        Message*& reply__) -> PPresentationBuilderChild::Result
338
0
{
339
0
    return MsgNotKnown;
340
0
}
341
342
auto PPresentationBuilderChild::OnCallReceived(
343
        const Message& msg__,
344
        Message*& reply__) -> PPresentationBuilderChild::Result
345
0
{
346
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
347
0
    return MsgNotKnown;
348
0
}
349
350
auto PPresentationBuilderChild::GetProtocolTypeId() -> int32_t
351
0
{
352
0
    return PPresentationBuilderMsgStart;
353
0
}
354
355
auto PPresentationBuilderChild::DestroySubtree(ActorDestroyReason why) -> void
356
0
{
357
0
    // Unregister from our manager.
358
0
    Unregister(Id());
359
0
360
0
    // Reject owning pending responses.
361
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
362
0
363
0
    // Finally, destroy "us".
364
0
    ActorDestroy(why);
365
0
}
366
367
auto PPresentationBuilderChild::DeallocSubtree() -> void
368
0
{
369
0
}
370
371
372
373
} // namespace dom
374
} // namespace mozilla
375
namespace mozilla {
376
namespace ipc {
377
auto IPDLParamTraits<mozilla::dom::PPresentationBuilderChild>::Write(
378
        IPC::Message* aMsg,
379
        mozilla::ipc::IProtocol* aActor,
380
        const paramType& aVar) -> void
381
0
{
382
0
    int32_t id;
383
0
    if ((!(aVar))) {
384
0
        id = 0;
385
0
    }
386
0
    else {
387
0
        id = (aVar)->Id();
388
0
        if ((1) == (id)) {
389
0
            (aActor)->FatalError("actor has been |delete|d");
390
0
        }
391
0
    }
392
0
    WriteIPDLParam(aMsg, aActor, id);
393
0
}
394
395
auto IPDLParamTraits<mozilla::dom::PPresentationBuilderChild>::Read(
396
        const IPC::Message* aMsg,
397
        PickleIterator* aIter,
398
        mozilla::ipc::IProtocol* aActor,
399
        paramType* aVar) -> bool
400
0
{
401
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PPresentationBuilder", PPresentationBuilderMsgStart);
402
0
    if ((actor).isNothing()) {
403
0
        return false;
404
0
    }
405
0
406
0
    (*(aVar)) = static_cast<mozilla::dom::PPresentationBuilderChild*>((actor).value());
407
0
    return true;
408
0
}
409
410
} // namespace ipc
411
} // namespace mozilla