Coverage Report

Created: 2018-09-25 14:53

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