Coverage Report

Created: 2018-09-25 14:53

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