Coverage Report

Created: 2018-09-25 14:53

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