Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PExternalHelperAppParent.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/PExternalHelperAppParent.h"
8
9
#include "mozilla/dom/PBrowserParent.h"
10
#include "mozilla/dom/PContentParent.h"
11
#include "mozilla/net/PChannelDiverterParent.h"
12
13
#include "nsIFile.h"
14
#include "GeckoProfiler.h"
15
16
namespace mozilla {
17
namespace dom {
18
19
20
auto PExternalHelperAppParent::ActorDestroy(ActorDestroyReason aWhy) -> void
21
0
{
22
0
}
23
24
MOZ_IMPLICIT PExternalHelperAppParent::PExternalHelperAppParent() :
25
    mozilla::ipc::IProtocol(mozilla::ipc::ParentSide),
26
    mLivenessState(mozilla::ipc::LivenessState::Dead)
27
0
{
28
0
    MOZ_COUNT_CTOR(PExternalHelperAppParent);
29
0
}
30
31
PExternalHelperAppParent::~PExternalHelperAppParent()
32
0
{
33
0
    MOZ_COUNT_DTOR(PExternalHelperAppParent);
34
0
}
35
36
auto PExternalHelperAppParent::Manager() const -> PContentParent*
37
0
{
38
0
    return static_cast<PContentParent*>(IProtocol::Manager());
39
0
}
40
41
auto PExternalHelperAppParent::SendCancel(const nsresult& aStatus) -> bool
42
0
{
43
0
    IPC::Message* msg__ = PExternalHelperApp::Msg_Cancel(Id());
44
0
45
0
    WriteIPDLParam(msg__, this, aStatus);
46
0
    // Sentinel = 'aStatus'
47
0
    (msg__)->WriteSentinel(236002576);
48
0
49
0
50
0
51
0
52
0
    if (mozilla::ipc::LoggingEnabledFor("PExternalHelperAppParent")) {
53
0
        mozilla::ipc::LogMessageForProtocol("PExternalHelperAppParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
54
0
    }
55
0
    AUTO_PROFILER_LABEL("PExternalHelperApp::Msg_Cancel", OTHER);
56
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
57
0
        mozilla::ipc::LogicError("Transition error");
58
0
    }
59
0
60
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
61
0
    return sendok__;
62
0
}
63
64
auto PExternalHelperAppParent::Send__delete__(PExternalHelperAppParent* actor) -> bool
65
0
{
66
0
    if ((!(actor))) {
67
0
        return false;
68
0
    }
69
0
70
0
    IPC::Message* msg__ = PExternalHelperApp::Msg___delete__((actor)->Id());
71
0
72
0
    MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param");
73
0
    WriteIPDLParam(msg__, actor, actor);
74
0
    // Sentinel = 'actor'
75
0
    (msg__)->WriteSentinel(875202478);
76
0
77
0
78
0
79
0
    if (mozilla::ipc::LoggingEnabledFor("PExternalHelperAppParent")) {
80
0
        mozilla::ipc::LogMessageForProtocol("PExternalHelperAppParent", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
81
0
    }
82
0
    AUTO_PROFILER_LABEL("PExternalHelperApp::Msg___delete__", OTHER);
83
0
    if ((!(StateTransition(true, (&((actor)->mLivenessState)))))) {
84
0
        mozilla::ipc::LogicError("Transition error");
85
0
    }
86
0
87
0
    bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
88
0
89
0
    IProtocol* mgr = (actor)->Manager();
90
0
    (actor)->DestroySubtree(Deletion);
91
0
    (actor)->DeallocSubtree();
92
0
    (mgr)->RemoveManagee(PExternalHelperAppMsgStart, actor);
93
0
    return sendok__;
94
0
}
95
96
auto PExternalHelperAppParent::RemoveManagee(
97
        int32_t aProtocolId,
98
        IProtocol* aListener) -> void
99
0
{
100
0
    FatalError("unreached");
101
0
    return;
102
0
}
103
104
auto PExternalHelperAppParent::OnMessageReceived(const Message& msg__) -> PExternalHelperAppParent::Result
105
0
{
106
0
    switch ((msg__).type()) {
107
0
    case PExternalHelperApp::Msg_OnStartRequest__ID:
108
0
        {
109
0
            if (mozilla::ipc::LoggingEnabledFor("PExternalHelperAppParent")) {
110
0
                mozilla::ipc::LogMessageForProtocol("PExternalHelperAppParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
111
0
            }
112
0
            AUTO_PROFILER_LABEL("PExternalHelperApp::Msg_OnStartRequest", OTHER);
113
0
114
0
            PickleIterator iter__(msg__);
115
0
            nsCString entityID;
116
0
            PBrowserParent* windowContext;
117
0
118
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(entityID)))))) {
119
0
                FatalError("Error deserializing 'nsCString'");
120
0
                return MsgValueError;
121
0
            }
122
0
            // Sentinel = 'entityID'
123
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 245743354)))) {
124
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
125
0
                return MsgValueError;
126
0
            }
127
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(windowContext)))))) {
128
0
                FatalError("Error deserializing 'PBrowserParent'");
129
0
                return MsgValueError;
130
0
            }
131
0
            if ((!((*((&(windowContext))))))) {
132
0
                FatalError("Error deserializing 'PBrowserParent'");
133
0
                return MsgValueError;
134
0
            }
135
0
            // Sentinel = 'windowContext'
136
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3429612728)))) {
137
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PBrowserParent'");
138
0
                return MsgValueError;
139
0
            }
140
0
            (msg__).EndRead(iter__, (msg__).type());
141
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
142
0
                FatalError("Transition error");
143
0
                return MsgValueError;
144
0
            }
145
0
            if ((!(RecvOnStartRequest(entityID, windowContext)))) {
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
            return MsgProcessed;
152
0
        }
153
0
    case PExternalHelperApp::Msg_OnDataAvailable__ID:
154
0
        {
155
0
            if (mozilla::ipc::LoggingEnabledFor("PExternalHelperAppParent")) {
156
0
                mozilla::ipc::LogMessageForProtocol("PExternalHelperAppParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
157
0
            }
158
0
            AUTO_PROFILER_LABEL("PExternalHelperApp::Msg_OnDataAvailable", OTHER);
159
0
160
0
            PickleIterator iter__(msg__);
161
0
            nsCString data;
162
0
            uint64_t offset;
163
0
            uint32_t count;
164
0
165
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(data)))))) {
166
0
                FatalError("Error deserializing 'nsCString'");
167
0
                return MsgValueError;
168
0
            }
169
0
            // Sentinel = 'data'
170
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 843352540)))) {
171
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
172
0
                return MsgValueError;
173
0
            }
174
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(offset)))))) {
175
0
                FatalError("Error deserializing 'uint64_t'");
176
0
                return MsgValueError;
177
0
            }
178
0
            // Sentinel = 'offset'
179
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1369947863)))) {
180
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
181
0
                return MsgValueError;
182
0
            }
183
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(count)))))) {
184
0
                FatalError("Error deserializing 'uint32_t'");
185
0
                return MsgValueError;
186
0
            }
187
0
            // Sentinel = 'count'
188
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2126421856)))) {
189
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint32_t'");
190
0
                return MsgValueError;
191
0
            }
192
0
            (msg__).EndRead(iter__, (msg__).type());
193
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
194
0
                FatalError("Transition error");
195
0
                return MsgValueError;
196
0
            }
197
0
            if ((!(RecvOnDataAvailable(data, offset, count)))) {
198
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
199
0
                // Error handled in mozilla::ipc::IPCResult
200
0
                return MsgProcessingError;
201
0
            }
202
0
203
0
            return MsgProcessed;
204
0
        }
205
0
    case PExternalHelperApp::Msg_OnStopRequest__ID:
206
0
        {
207
0
            if (mozilla::ipc::LoggingEnabledFor("PExternalHelperAppParent")) {
208
0
                mozilla::ipc::LogMessageForProtocol("PExternalHelperAppParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
209
0
            }
210
0
            AUTO_PROFILER_LABEL("PExternalHelperApp::Msg_OnStopRequest", OTHER);
211
0
212
0
            PickleIterator iter__(msg__);
213
0
            nsresult code;
214
0
215
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(code)))))) {
216
0
                FatalError("Error deserializing 'nsresult'");
217
0
                return MsgValueError;
218
0
            }
219
0
            // Sentinel = 'code'
220
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3318913027)))) {
221
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
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
            if ((!(RecvOnStopRequest(code)))) {
230
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
231
0
                // Error handled in mozilla::ipc::IPCResult
232
0
                return MsgProcessingError;
233
0
            }
234
0
235
0
            return MsgProcessed;
236
0
        }
237
0
    case PExternalHelperApp::Msg_DivertToParentUsing__ID:
238
0
        {
239
0
            if (mozilla::ipc::LoggingEnabledFor("PExternalHelperAppParent")) {
240
0
                mozilla::ipc::LogMessageForProtocol("PExternalHelperAppParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
241
0
            }
242
0
            AUTO_PROFILER_LABEL("PExternalHelperApp::Msg_DivertToParentUsing", OTHER);
243
0
244
0
            PickleIterator iter__(msg__);
245
0
            PChannelDiverterParent* diverter;
246
0
            PBrowserParent* windowContext;
247
0
248
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(diverter)))))) {
249
0
                FatalError("Error deserializing 'PChannelDiverterParent'");
250
0
                return MsgValueError;
251
0
            }
252
0
            if ((!((*((&(diverter))))))) {
253
0
                FatalError("Error deserializing 'PChannelDiverterParent'");
254
0
                return MsgValueError;
255
0
            }
256
0
            // Sentinel = 'diverter'
257
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1783530825)))) {
258
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PChannelDiverterParent'");
259
0
                return MsgValueError;
260
0
            }
261
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(windowContext)))))) {
262
0
                FatalError("Error deserializing 'PBrowserParent'");
263
0
                return MsgValueError;
264
0
            }
265
0
            if ((!((*((&(windowContext))))))) {
266
0
                FatalError("Error deserializing 'PBrowserParent'");
267
0
                return MsgValueError;
268
0
            }
269
0
            // Sentinel = 'windowContext'
270
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3429612728)))) {
271
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PBrowserParent'");
272
0
                return MsgValueError;
273
0
            }
274
0
            (msg__).EndRead(iter__, (msg__).type());
275
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
276
0
                FatalError("Transition error");
277
0
                return MsgValueError;
278
0
            }
279
0
            if ((!(RecvDivertToParentUsing(diverter, windowContext)))) {
280
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
281
0
                // Error handled in mozilla::ipc::IPCResult
282
0
                return MsgProcessingError;
283
0
            }
284
0
285
0
            return MsgProcessed;
286
0
        }
287
0
    case PExternalHelperApp::Reply___delete____ID:
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 PExternalHelperAppParent::OnMessageReceived(
299
        const Message& msg__,
300
        Message*& reply__) -> PExternalHelperAppParent::Result
301
0
{
302
0
    return MsgNotKnown;
303
0
}
304
305
auto PExternalHelperAppParent::OnCallReceived(
306
        const Message& msg__,
307
        Message*& reply__) -> PExternalHelperAppParent::Result
308
0
{
309
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
310
0
    return MsgNotKnown;
311
0
}
312
313
auto PExternalHelperAppParent::GetProtocolTypeId() -> int32_t
314
0
{
315
0
    return PExternalHelperAppMsgStart;
316
0
}
317
318
auto PExternalHelperAppParent::DestroySubtree(ActorDestroyReason why) -> void
319
0
{
320
0
    // Unregister from our manager.
321
0
    Unregister(Id());
322
0
323
0
    // Reject owning pending responses.
324
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
325
0
326
0
    // Finally, destroy "us".
327
0
    ActorDestroy(why);
328
0
}
329
330
auto PExternalHelperAppParent::DeallocSubtree() -> void
331
0
{
332
0
}
333
334
335
336
} // namespace dom
337
} // namespace mozilla
338
namespace mozilla {
339
namespace ipc {
340
auto IPDLParamTraits<mozilla::dom::PExternalHelperAppParent>::Write(
341
        IPC::Message* aMsg,
342
        mozilla::ipc::IProtocol* aActor,
343
        const paramType& aVar) -> void
344
0
{
345
0
    int32_t id;
346
0
    if ((!(aVar))) {
347
0
        id = 0;
348
0
    }
349
0
    else {
350
0
        id = (aVar)->Id();
351
0
        if ((1) == (id)) {
352
0
            (aActor)->FatalError("actor has been |delete|d");
353
0
        }
354
0
    }
355
0
    WriteIPDLParam(aMsg, aActor, id);
356
0
}
357
358
auto IPDLParamTraits<mozilla::dom::PExternalHelperAppParent>::Read(
359
        const IPC::Message* aMsg,
360
        PickleIterator* aIter,
361
        mozilla::ipc::IProtocol* aActor,
362
        paramType* aVar) -> bool
363
0
{
364
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PExternalHelperApp", PExternalHelperAppMsgStart);
365
0
    if ((actor).isNothing()) {
366
0
        return false;
367
0
    }
368
0
369
0
    (*(aVar)) = static_cast<mozilla::dom::PExternalHelperAppParent*>((actor).value());
370
0
    return true;
371
0
}
372
373
} // namespace ipc
374
} // namespace mozilla