Coverage Report

Created: 2018-09-25 14:53

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