Coverage Report

Created: 2018-09-25 14:53

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