Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PMediaChild.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/media/PMediaChild.h"
8
9
#include "mozilla/dom/PContentChild.h"
10
11
#include "nsIFile.h"
12
#include "GeckoProfiler.h"
13
14
namespace mozilla {
15
namespace media {
16
17
18
auto PMediaChild::Recv__delete__() -> mozilla::ipc::IPCResult
19
0
{
20
0
    return IPC_OK();
21
0
}
22
23
auto PMediaChild::ActorDestroy(ActorDestroyReason aWhy) -> void
24
0
{
25
0
}
26
27
MOZ_IMPLICIT PMediaChild::PMediaChild() :
28
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
29
    mLivenessState(mozilla::ipc::LivenessState::Dead)
30
0
{
31
0
    MOZ_COUNT_CTOR(PMediaChild);
32
0
}
33
34
PMediaChild::~PMediaChild()
35
0
{
36
0
    MOZ_COUNT_DTOR(PMediaChild);
37
0
}
38
39
auto PMediaChild::Manager() const -> PContentChild*
40
0
{
41
0
    return static_cast<PContentChild*>(IProtocol::Manager());
42
0
}
43
44
auto PMediaChild::SendGetPrincipalKey(
45
        const uint32_t& aRequestId,
46
        const PrincipalInfo& aPrincipal,
47
        const bool& aPersist) -> bool
48
0
{
49
0
    IPC::Message* msg__ = PMedia::Msg_GetPrincipalKey(Id());
50
0
51
0
    WriteIPDLParam(msg__, this, aRequestId);
52
0
    // Sentinel = 'aRequestId'
53
0
    (msg__)->WriteSentinel(3709302657);
54
0
    WriteIPDLParam(msg__, this, aPrincipal);
55
0
    // Sentinel = 'aPrincipal'
56
0
    (msg__)->WriteSentinel(4097511);
57
0
    WriteIPDLParam(msg__, this, aPersist);
58
0
    // Sentinel = 'aPersist'
59
0
    (msg__)->WriteSentinel(4167438139);
60
0
61
0
62
0
63
0
64
0
    if (mozilla::ipc::LoggingEnabledFor("PMediaChild")) {
65
0
        mozilla::ipc::LogMessageForProtocol("PMediaChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
66
0
    }
67
0
    AUTO_PROFILER_LABEL("PMedia::Msg_GetPrincipalKey", OTHER);
68
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
69
0
        mozilla::ipc::LogicError("Transition error");
70
0
    }
71
0
72
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
73
0
    return sendok__;
74
0
}
75
76
auto PMediaChild::SendSanitizeOriginKeys(
77
        const uint64_t& aSinceWhen,
78
        const bool& aOnlyPrivateBrowsing) -> bool
79
0
{
80
0
    IPC::Message* msg__ = PMedia::Msg_SanitizeOriginKeys(Id());
81
0
82
0
    WriteIPDLParam(msg__, this, aSinceWhen);
83
0
    // Sentinel = 'aSinceWhen'
84
0
    (msg__)->WriteSentinel(2883988047);
85
0
    WriteIPDLParam(msg__, this, aOnlyPrivateBrowsing);
86
0
    // Sentinel = 'aOnlyPrivateBrowsing'
87
0
    (msg__)->WriteSentinel(1580982783);
88
0
89
0
90
0
91
0
92
0
    if (mozilla::ipc::LoggingEnabledFor("PMediaChild")) {
93
0
        mozilla::ipc::LogMessageForProtocol("PMediaChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
94
0
    }
95
0
    AUTO_PROFILER_LABEL("PMedia::Msg_SanitizeOriginKeys", 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 PMediaChild::RemoveManagee(
105
        int32_t aProtocolId,
106
        IProtocol* aListener) -> void
107
0
{
108
0
    FatalError("unreached");
109
0
    return;
110
0
}
111
112
auto PMediaChild::OnMessageReceived(const Message& msg__) -> PMediaChild::Result
113
0
{
114
0
    switch ((msg__).type()) {
115
0
    case PMedia::Msg_GetPrincipalKeyResponse__ID:
116
0
        {
117
0
            if (mozilla::ipc::LoggingEnabledFor("PMediaChild")) {
118
0
                mozilla::ipc::LogMessageForProtocol("PMediaChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
119
0
            }
120
0
            AUTO_PROFILER_LABEL("PMedia::Msg_GetPrincipalKeyResponse", OTHER);
121
0
122
0
            PickleIterator iter__(msg__);
123
0
            uint32_t aRequestId;
124
0
            nsCString key;
125
0
126
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aRequestId)))))) {
127
0
                FatalError("Error deserializing 'uint32_t'");
128
0
                return MsgValueError;
129
0
            }
130
0
            // Sentinel = 'aRequestId'
131
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3709302657)))) {
132
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
133
0
                return MsgValueError;
134
0
            }
135
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(key)))))) {
136
0
                FatalError("Error deserializing 'nsCString'");
137
0
                return MsgValueError;
138
0
            }
139
0
            // Sentinel = 'key'
140
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 35142870)))) {
141
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
142
0
                return MsgValueError;
143
0
            }
144
0
            (msg__).EndRead(iter__, (msg__).type());
145
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
146
0
                FatalError("Transition error");
147
0
                return MsgValueError;
148
0
            }
149
0
            if ((!(RecvGetPrincipalKeyResponse(aRequestId, key)))) {
150
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
151
0
                // Error handled in mozilla::ipc::IPCResult
152
0
                return MsgProcessingError;
153
0
            }
154
0
155
0
            return MsgProcessed;
156
0
        }
157
0
    case PMedia::Msg___delete____ID:
158
0
        {
159
0
            if (mozilla::ipc::LoggingEnabledFor("PMediaChild")) {
160
0
                mozilla::ipc::LogMessageForProtocol("PMediaChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
161
0
            }
162
0
            AUTO_PROFILER_LABEL("PMedia::Msg___delete__", OTHER);
163
0
164
0
            PickleIterator iter__(msg__);
165
0
            PMediaChild* actor;
166
0
167
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
168
0
                FatalError("Error deserializing 'PMediaChild'");
169
0
                return MsgValueError;
170
0
            }
171
0
            if ((!((*((&(actor))))))) {
172
0
                FatalError("Error deserializing 'PMediaChild'");
173
0
                return MsgValueError;
174
0
            }
175
0
            // Sentinel = 'actor'
176
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
177
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PMediaChild'");
178
0
                return MsgValueError;
179
0
            }
180
0
            (msg__).EndRead(iter__, (msg__).type());
181
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
182
0
                FatalError("Transition error");
183
0
                return MsgValueError;
184
0
            }
185
0
            if ((!(Recv__delete__()))) {
186
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
187
0
                // Error handled in mozilla::ipc::IPCResult
188
0
                return MsgProcessingError;
189
0
            }
190
0
191
0
192
0
            IProtocol* mgr = (actor)->Manager();
193
0
            (actor)->DestroySubtree(Deletion);
194
0
            (actor)->DeallocSubtree();
195
0
            (mgr)->RemoveManagee(PMediaMsgStart, actor);
196
0
197
0
            return MsgProcessed;
198
0
        }
199
0
    default:
200
0
        {
201
0
            return MsgNotKnown;
202
0
        }
203
0
    }
204
0
}
205
206
auto PMediaChild::OnMessageReceived(
207
        const Message& msg__,
208
        Message*& reply__) -> PMediaChild::Result
209
0
{
210
0
    return MsgNotKnown;
211
0
}
212
213
auto PMediaChild::OnCallReceived(
214
        const Message& msg__,
215
        Message*& reply__) -> PMediaChild::Result
216
0
{
217
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
218
0
    return MsgNotKnown;
219
0
}
220
221
auto PMediaChild::GetProtocolTypeId() -> int32_t
222
0
{
223
0
    return PMediaMsgStart;
224
0
}
225
226
auto PMediaChild::DestroySubtree(ActorDestroyReason why) -> void
227
0
{
228
0
    // Unregister from our manager.
229
0
    Unregister(Id());
230
0
231
0
    // Reject owning pending responses.
232
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
233
0
234
0
    // Finally, destroy "us".
235
0
    ActorDestroy(why);
236
0
}
237
238
auto PMediaChild::DeallocSubtree() -> void
239
0
{
240
0
}
241
242
243
244
} // namespace media
245
} // namespace mozilla
246
namespace mozilla {
247
namespace ipc {
248
auto IPDLParamTraits<mozilla::media::PMediaChild>::Write(
249
        IPC::Message* aMsg,
250
        mozilla::ipc::IProtocol* aActor,
251
        const paramType& aVar) -> void
252
0
{
253
0
    int32_t id;
254
0
    if ((!(aVar))) {
255
0
        id = 0;
256
0
    }
257
0
    else {
258
0
        id = (aVar)->Id();
259
0
        if ((1) == (id)) {
260
0
            (aActor)->FatalError("actor has been |delete|d");
261
0
        }
262
0
    }
263
0
    WriteIPDLParam(aMsg, aActor, id);
264
0
}
265
266
auto IPDLParamTraits<mozilla::media::PMediaChild>::Read(
267
        const IPC::Message* aMsg,
268
        PickleIterator* aIter,
269
        mozilla::ipc::IProtocol* aActor,
270
        paramType* aVar) -> bool
271
0
{
272
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PMedia", PMediaMsgStart);
273
0
    if ((actor).isNothing()) {
274
0
        return false;
275
0
    }
276
0
277
0
    (*(aVar)) = static_cast<mozilla::media::PMediaChild*>((actor).value());
278
0
    return true;
279
0
}
280
281
} // namespace ipc
282
} // namespace mozilla