Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PHttpBackgroundChannelParent.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/net/PHttpBackgroundChannelParent.h"
8
#include "mozilla/net/TimingStruct.h"
9
#include "nsHttpHeaderArray.h"
10
11
#include "mozilla/ipc/PBackgroundParent.h"
12
13
#include "nsIFile.h"
14
#include "GeckoProfiler.h"
15
16
namespace mozilla {
17
namespace net {
18
19
20
auto PHttpBackgroundChannelParent::ActorDestroy(ActorDestroyReason aWhy) -> void
21
0
{
22
0
}
23
24
MOZ_IMPLICIT PHttpBackgroundChannelParent::PHttpBackgroundChannelParent() :
25
    mozilla::ipc::IProtocol(mozilla::ipc::ParentSide),
26
    mLivenessState(mozilla::ipc::LivenessState::Dead)
27
0
{
28
0
    MOZ_COUNT_CTOR(PHttpBackgroundChannelParent);
29
0
}
30
31
PHttpBackgroundChannelParent::~PHttpBackgroundChannelParent()
32
0
{
33
0
    MOZ_COUNT_DTOR(PHttpBackgroundChannelParent);
34
0
}
35
36
auto PHttpBackgroundChannelParent::Manager() const -> PBackgroundParent*
37
0
{
38
0
    return static_cast<PBackgroundParent*>(IProtocol::Manager());
39
0
}
40
41
auto PHttpBackgroundChannelParent::SendOnStartRequestSent() -> bool
42
0
{
43
0
    IPC::Message* msg__ = PHttpBackgroundChannel::Msg_OnStartRequestSent(Id());
44
0
45
0
46
0
47
0
48
0
49
0
    if (mozilla::ipc::LoggingEnabledFor("PHttpBackgroundChannelParent")) {
50
0
        mozilla::ipc::LogMessageForProtocol("PHttpBackgroundChannelParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
51
0
    }
52
0
    AUTO_PROFILER_LABEL("PHttpBackgroundChannel::Msg_OnStartRequestSent", OTHER);
53
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
54
0
        mozilla::ipc::LogicError("Transition error");
55
0
    }
56
0
57
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
58
0
    return sendok__;
59
0
}
60
61
auto PHttpBackgroundChannelParent::SendOnTransportAndData(
62
        const nsresult& channelStatus,
63
        const nsresult& transportStatus,
64
        const uint64_t& offset,
65
        const uint32_t& count,
66
        const nsCString& data) -> bool
67
0
{
68
0
    IPC::Message* msg__ = PHttpBackgroundChannel::Msg_OnTransportAndData(Id());
69
0
70
0
    WriteIPDLParam(msg__, this, channelStatus);
71
0
    // Sentinel = 'channelStatus'
72
0
    (msg__)->WriteSentinel(3148019746);
73
0
    WriteIPDLParam(msg__, this, transportStatus);
74
0
    // Sentinel = 'transportStatus'
75
0
    (msg__)->WriteSentinel(1295005818);
76
0
    WriteIPDLParam(msg__, this, offset);
77
0
    // Sentinel = 'offset'
78
0
    (msg__)->WriteSentinel(1369947863);
79
0
    WriteIPDLParam(msg__, this, count);
80
0
    // Sentinel = 'count'
81
0
    (msg__)->WriteSentinel(2126421856);
82
0
    WriteIPDLParam(msg__, this, data);
83
0
    // Sentinel = 'data'
84
0
    (msg__)->WriteSentinel(843352540);
85
0
86
0
87
0
88
0
89
0
    if (mozilla::ipc::LoggingEnabledFor("PHttpBackgroundChannelParent")) {
90
0
        mozilla::ipc::LogMessageForProtocol("PHttpBackgroundChannelParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
91
0
    }
92
0
    AUTO_PROFILER_LABEL("PHttpBackgroundChannel::Msg_OnTransportAndData", OTHER);
93
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
94
0
        mozilla::ipc::LogicError("Transition error");
95
0
    }
96
0
97
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
98
0
    return sendok__;
99
0
}
100
101
auto PHttpBackgroundChannelParent::SendOnStopRequest(
102
        const nsresult& channelStatus,
103
        const ResourceTimingStruct& timing,
104
        const TimeStamp& lastActiveTabOptimization,
105
        const nsHttpHeaderArray& responseTrailers) -> bool
106
0
{
107
0
    IPC::Message* msg__ = PHttpBackgroundChannel::Msg_OnStopRequest(Id());
108
0
109
0
    WriteIPDLParam(msg__, this, channelStatus);
110
0
    // Sentinel = 'channelStatus'
111
0
    (msg__)->WriteSentinel(3148019746);
112
0
    WriteIPDLParam(msg__, this, timing);
113
0
    // Sentinel = 'timing'
114
0
    (msg__)->WriteSentinel(3852786776);
115
0
    WriteIPDLParam(msg__, this, lastActiveTabOptimization);
116
0
    // Sentinel = 'lastActiveTabOptimization'
117
0
    (msg__)->WriteSentinel(4219537809);
118
0
    WriteIPDLParam(msg__, this, responseTrailers);
119
0
    // Sentinel = 'responseTrailers'
120
0
    (msg__)->WriteSentinel(1032651645);
121
0
122
0
123
0
124
0
125
0
    if (mozilla::ipc::LoggingEnabledFor("PHttpBackgroundChannelParent")) {
126
0
        mozilla::ipc::LogMessageForProtocol("PHttpBackgroundChannelParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
127
0
    }
128
0
    AUTO_PROFILER_LABEL("PHttpBackgroundChannel::Msg_OnStopRequest", OTHER);
129
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
130
0
        mozilla::ipc::LogicError("Transition error");
131
0
    }
132
0
133
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
134
0
    return sendok__;
135
0
}
136
137
auto PHttpBackgroundChannelParent::SendOnProgress(
138
        const int64_t& progress,
139
        const int64_t& progressMax) -> bool
140
0
{
141
0
    IPC::Message* msg__ = PHttpBackgroundChannel::Msg_OnProgress(Id());
142
0
143
0
    WriteIPDLParam(msg__, this, progress);
144
0
    // Sentinel = 'progress'
145
0
    (msg__)->WriteSentinel(858119353);
146
0
    WriteIPDLParam(msg__, this, progressMax);
147
0
    // Sentinel = 'progressMax'
148
0
    (msg__)->WriteSentinel(2530734978);
149
0
150
0
151
0
152
0
153
0
    if (mozilla::ipc::LoggingEnabledFor("PHttpBackgroundChannelParent")) {
154
0
        mozilla::ipc::LogMessageForProtocol("PHttpBackgroundChannelParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
155
0
    }
156
0
    AUTO_PROFILER_LABEL("PHttpBackgroundChannel::Msg_OnProgress", OTHER);
157
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
158
0
        mozilla::ipc::LogicError("Transition error");
159
0
    }
160
0
161
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
162
0
    return sendok__;
163
0
}
164
165
auto PHttpBackgroundChannelParent::SendOnStatus(const nsresult& status) -> bool
166
0
{
167
0
    IPC::Message* msg__ = PHttpBackgroundChannel::Msg_OnStatus(Id());
168
0
169
0
    WriteIPDLParam(msg__, this, status);
170
0
    // Sentinel = 'status'
171
0
    (msg__)->WriteSentinel(3714608576);
172
0
173
0
174
0
175
0
176
0
    if (mozilla::ipc::LoggingEnabledFor("PHttpBackgroundChannelParent")) {
177
0
        mozilla::ipc::LogMessageForProtocol("PHttpBackgroundChannelParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
178
0
    }
179
0
    AUTO_PROFILER_LABEL("PHttpBackgroundChannel::Msg_OnStatus", OTHER);
180
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
181
0
        mozilla::ipc::LogicError("Transition error");
182
0
    }
183
0
184
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
185
0
    return sendok__;
186
0
}
187
188
auto PHttpBackgroundChannelParent::SendFlushedForDiversion() -> bool
189
0
{
190
0
    IPC::Message* msg__ = PHttpBackgroundChannel::Msg_FlushedForDiversion(Id());
191
0
192
0
193
0
194
0
195
0
196
0
    if (mozilla::ipc::LoggingEnabledFor("PHttpBackgroundChannelParent")) {
197
0
        mozilla::ipc::LogMessageForProtocol("PHttpBackgroundChannelParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
198
0
    }
199
0
    AUTO_PROFILER_LABEL("PHttpBackgroundChannel::Msg_FlushedForDiversion", OTHER);
200
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
201
0
        mozilla::ipc::LogicError("Transition error");
202
0
    }
203
0
204
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
205
0
    return sendok__;
206
0
}
207
208
auto PHttpBackgroundChannelParent::SendDivertMessages() -> bool
209
0
{
210
0
    IPC::Message* msg__ = PHttpBackgroundChannel::Msg_DivertMessages(Id());
211
0
212
0
213
0
214
0
215
0
216
0
    if (mozilla::ipc::LoggingEnabledFor("PHttpBackgroundChannelParent")) {
217
0
        mozilla::ipc::LogMessageForProtocol("PHttpBackgroundChannelParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
218
0
    }
219
0
    AUTO_PROFILER_LABEL("PHttpBackgroundChannel::Msg_DivertMessages", OTHER);
220
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
221
0
        mozilla::ipc::LogicError("Transition error");
222
0
    }
223
0
224
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
225
0
    return sendok__;
226
0
}
227
228
auto PHttpBackgroundChannelParent::SendNotifyTrackingProtectionDisabled() -> bool
229
0
{
230
0
    IPC::Message* msg__ = PHttpBackgroundChannel::Msg_NotifyTrackingProtectionDisabled(Id());
231
0
232
0
233
0
234
0
235
0
236
0
    if (mozilla::ipc::LoggingEnabledFor("PHttpBackgroundChannelParent")) {
237
0
        mozilla::ipc::LogMessageForProtocol("PHttpBackgroundChannelParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
238
0
    }
239
0
    AUTO_PROFILER_LABEL("PHttpBackgroundChannel::Msg_NotifyTrackingProtectionDisabled", OTHER);
240
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
241
0
        mozilla::ipc::LogicError("Transition error");
242
0
    }
243
0
244
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
245
0
    return sendok__;
246
0
}
247
248
auto PHttpBackgroundChannelParent::SendNotifyTrackingCookieBlocked(const uint32_t& aRejectedReason) -> bool
249
0
{
250
0
    IPC::Message* msg__ = PHttpBackgroundChannel::Msg_NotifyTrackingCookieBlocked(Id());
251
0
252
0
    WriteIPDLParam(msg__, this, aRejectedReason);
253
0
    // Sentinel = 'aRejectedReason'
254
0
    (msg__)->WriteSentinel(285478744);
255
0
256
0
257
0
258
0
259
0
    if (mozilla::ipc::LoggingEnabledFor("PHttpBackgroundChannelParent")) {
260
0
        mozilla::ipc::LogMessageForProtocol("PHttpBackgroundChannelParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
261
0
    }
262
0
    AUTO_PROFILER_LABEL("PHttpBackgroundChannel::Msg_NotifyTrackingCookieBlocked", OTHER);
263
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
264
0
        mozilla::ipc::LogicError("Transition error");
265
0
    }
266
0
267
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
268
0
    return sendok__;
269
0
}
270
271
auto PHttpBackgroundChannelParent::SendNotifyTrackingResource(const bool& aIsThirdParty) -> bool
272
0
{
273
0
    IPC::Message* msg__ = PHttpBackgroundChannel::Msg_NotifyTrackingResource(Id());
274
0
275
0
    WriteIPDLParam(msg__, this, aIsThirdParty);
276
0
    // Sentinel = 'aIsThirdParty'
277
0
    (msg__)->WriteSentinel(3283147553);
278
0
279
0
280
0
281
0
282
0
    if (mozilla::ipc::LoggingEnabledFor("PHttpBackgroundChannelParent")) {
283
0
        mozilla::ipc::LogMessageForProtocol("PHttpBackgroundChannelParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
284
0
    }
285
0
    AUTO_PROFILER_LABEL("PHttpBackgroundChannel::Msg_NotifyTrackingResource", OTHER);
286
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
287
0
        mozilla::ipc::LogicError("Transition error");
288
0
    }
289
0
290
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
291
0
    return sendok__;
292
0
}
293
294
auto PHttpBackgroundChannelParent::SendSetClassifierMatchedInfo(const ClassifierInfo& info) -> bool
295
0
{
296
0
    IPC::Message* msg__ = PHttpBackgroundChannel::Msg_SetClassifierMatchedInfo(Id());
297
0
298
0
    WriteIPDLParam(msg__, this, info);
299
0
    // Sentinel = 'info'
300
0
    (msg__)->WriteSentinel(3750868832);
301
0
302
0
303
0
304
0
305
0
    if (mozilla::ipc::LoggingEnabledFor("PHttpBackgroundChannelParent")) {
306
0
        mozilla::ipc::LogMessageForProtocol("PHttpBackgroundChannelParent", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
307
0
    }
308
0
    AUTO_PROFILER_LABEL("PHttpBackgroundChannel::Msg_SetClassifierMatchedInfo", OTHER);
309
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
310
0
        mozilla::ipc::LogicError("Transition error");
311
0
    }
312
0
313
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
314
0
    return sendok__;
315
0
}
316
317
auto PHttpBackgroundChannelParent::Send__delete__(PHttpBackgroundChannelParent* actor) -> bool
318
0
{
319
0
    if ((!(actor))) {
320
0
        return false;
321
0
    }
322
0
323
0
    IPC::Message* msg__ = PHttpBackgroundChannel::Msg___delete__((actor)->Id());
324
0
325
0
    MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param");
326
0
    WriteIPDLParam(msg__, actor, actor);
327
0
    // Sentinel = 'actor'
328
0
    (msg__)->WriteSentinel(875202478);
329
0
330
0
331
0
332
0
    if (mozilla::ipc::LoggingEnabledFor("PHttpBackgroundChannelParent")) {
333
0
        mozilla::ipc::LogMessageForProtocol("PHttpBackgroundChannelParent", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
334
0
    }
335
0
    AUTO_PROFILER_LABEL("PHttpBackgroundChannel::Msg___delete__", OTHER);
336
0
    if ((!(StateTransition(true, (&((actor)->mLivenessState)))))) {
337
0
        mozilla::ipc::LogicError("Transition error");
338
0
    }
339
0
340
0
    bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
341
0
342
0
    IProtocol* mgr = (actor)->Manager();
343
0
    (actor)->DestroySubtree(Deletion);
344
0
    (actor)->DeallocSubtree();
345
0
    (mgr)->RemoveManagee(PHttpBackgroundChannelMsgStart, actor);
346
0
    return sendok__;
347
0
}
348
349
auto PHttpBackgroundChannelParent::RemoveManagee(
350
        int32_t aProtocolId,
351
        IProtocol* aListener) -> void
352
0
{
353
0
    FatalError("unreached");
354
0
    return;
355
0
}
356
357
auto PHttpBackgroundChannelParent::OnMessageReceived(const Message& msg__) -> PHttpBackgroundChannelParent::Result
358
{
359
    switch ((msg__).type()) {
360
    case PHttpBackgroundChannel::Reply___delete____ID:
361
        {
362
            return MsgProcessed;
363
        }
364
    default:
365
        {
366
            return MsgNotKnown;
367
        }
368
    }
369
}
370
371
auto PHttpBackgroundChannelParent::OnMessageReceived(
372
        const Message& msg__,
373
        Message*& reply__) -> PHttpBackgroundChannelParent::Result
374
0
{
375
0
    return MsgNotKnown;
376
0
}
377
378
auto PHttpBackgroundChannelParent::OnCallReceived(
379
        const Message& msg__,
380
        Message*& reply__) -> PHttpBackgroundChannelParent::Result
381
0
{
382
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
383
0
    return MsgNotKnown;
384
0
}
385
386
auto PHttpBackgroundChannelParent::GetProtocolTypeId() -> int32_t
387
0
{
388
0
    return PHttpBackgroundChannelMsgStart;
389
0
}
390
391
auto PHttpBackgroundChannelParent::DestroySubtree(ActorDestroyReason why) -> void
392
0
{
393
0
    // Unregister from our manager.
394
0
    Unregister(Id());
395
0
396
0
    // Reject owning pending responses.
397
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
398
0
399
0
    // Finally, destroy "us".
400
0
    ActorDestroy(why);
401
0
}
402
403
auto PHttpBackgroundChannelParent::DeallocSubtree() -> void
404
0
{
405
0
}
406
407
408
409
} // namespace net
410
} // namespace mozilla
411
namespace mozilla {
412
namespace ipc {
413
auto IPDLParamTraits<mozilla::net::PHttpBackgroundChannelParent>::Write(
414
        IPC::Message* aMsg,
415
        mozilla::ipc::IProtocol* aActor,
416
        const paramType& aVar) -> void
417
0
{
418
0
    int32_t id;
419
0
    if ((!(aVar))) {
420
0
        id = 0;
421
0
    }
422
0
    else {
423
0
        id = (aVar)->Id();
424
0
        if ((1) == (id)) {
425
0
            (aActor)->FatalError("actor has been |delete|d");
426
0
        }
427
0
    }
428
0
    WriteIPDLParam(aMsg, aActor, id);
429
0
}
430
431
auto IPDLParamTraits<mozilla::net::PHttpBackgroundChannelParent>::Read(
432
        const IPC::Message* aMsg,
433
        PickleIterator* aIter,
434
        mozilla::ipc::IProtocol* aActor,
435
        paramType* aVar) -> bool
436
0
{
437
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PHttpBackgroundChannel", PHttpBackgroundChannelMsgStart);
438
0
    if ((actor).isNothing()) {
439
0
        return false;
440
0
    }
441
0
442
0
    (*(aVar)) = static_cast<mozilla::net::PHttpBackgroundChannelParent*>((actor).value());
443
0
    return true;
444
0
}
445
446
} // namespace ipc
447
} // namespace mozilla