Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PWebAuthnTransactionChild.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/PWebAuthnTransactionChild.h"
8
#include "ipc/IPCMessageUtils.h"
9
10
#include "mozilla/ipc/PBackgroundChild.h"
11
12
#include "nsIFile.h"
13
#include "GeckoProfiler.h"
14
15
namespace mozilla {
16
namespace dom {
17
18
19
auto PWebAuthnTransactionChild::Recv__delete__() -> mozilla::ipc::IPCResult
20
0
{
21
0
    return IPC_OK();
22
0
}
23
24
auto PWebAuthnTransactionChild::ActorDestroy(ActorDestroyReason aWhy) -> void
25
0
{
26
0
}
27
28
MOZ_IMPLICIT PWebAuthnTransactionChild::PWebAuthnTransactionChild() :
29
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
30
    mLivenessState(mozilla::ipc::LivenessState::Dead)
31
0
{
32
0
    MOZ_COUNT_CTOR(PWebAuthnTransactionChild);
33
0
}
34
35
PWebAuthnTransactionChild::~PWebAuthnTransactionChild()
36
0
{
37
0
    MOZ_COUNT_DTOR(PWebAuthnTransactionChild);
38
0
}
39
40
auto PWebAuthnTransactionChild::Manager() const -> PBackgroundChild*
41
0
{
42
0
    return static_cast<PBackgroundChild*>(IProtocol::Manager());
43
0
}
44
45
auto PWebAuthnTransactionChild::SendRequestRegister(
46
        const uint64_t& aTransactionId,
47
        const WebAuthnMakeCredentialInfo& aTransactionInfo) -> bool
48
0
{
49
0
    IPC::Message* msg__ = PWebAuthnTransaction::Msg_RequestRegister(Id());
50
0
51
0
    WriteIPDLParam(msg__, this, aTransactionId);
52
0
    // Sentinel = 'aTransactionId'
53
0
    (msg__)->WriteSentinel(3266273614);
54
0
    WriteIPDLParam(msg__, this, aTransactionInfo);
55
0
    // Sentinel = 'aTransactionInfo'
56
0
    (msg__)->WriteSentinel(1312922839);
57
0
58
0
59
0
60
0
61
0
    if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransactionChild")) {
62
0
        mozilla::ipc::LogMessageForProtocol("PWebAuthnTransactionChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
63
0
    }
64
0
    AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_RequestRegister", OTHER);
65
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
66
0
        mozilla::ipc::LogicError("Transition error");
67
0
    }
68
0
69
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
70
0
    return sendok__;
71
0
}
72
73
auto PWebAuthnTransactionChild::SendRequestSign(
74
        const uint64_t& aTransactionId,
75
        const WebAuthnGetAssertionInfo& aTransactionInfo) -> bool
76
0
{
77
0
    IPC::Message* msg__ = PWebAuthnTransaction::Msg_RequestSign(Id());
78
0
79
0
    WriteIPDLParam(msg__, this, aTransactionId);
80
0
    // Sentinel = 'aTransactionId'
81
0
    (msg__)->WriteSentinel(3266273614);
82
0
    WriteIPDLParam(msg__, this, aTransactionInfo);
83
0
    // Sentinel = 'aTransactionInfo'
84
0
    (msg__)->WriteSentinel(1312922839);
85
0
86
0
87
0
88
0
89
0
    if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransactionChild")) {
90
0
        mozilla::ipc::LogMessageForProtocol("PWebAuthnTransactionChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
91
0
    }
92
0
    AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_RequestSign", 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 PWebAuthnTransactionChild::SendRequestCancel(const uint64_t& aTransactionId) -> bool
102
0
{
103
0
    IPC::Message* msg__ = PWebAuthnTransaction::Msg_RequestCancel(Id());
104
0
105
0
    WriteIPDLParam(msg__, this, aTransactionId);
106
0
    // Sentinel = 'aTransactionId'
107
0
    (msg__)->WriteSentinel(3266273614);
108
0
109
0
110
0
111
0
112
0
    if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransactionChild")) {
113
0
        mozilla::ipc::LogMessageForProtocol("PWebAuthnTransactionChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
114
0
    }
115
0
    AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_RequestCancel", 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 PWebAuthnTransactionChild::SendDestroyMe() -> bool
125
0
{
126
0
    IPC::Message* msg__ = PWebAuthnTransaction::Msg_DestroyMe(Id());
127
0
128
0
129
0
130
0
131
0
132
0
    if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransactionChild")) {
133
0
        mozilla::ipc::LogMessageForProtocol("PWebAuthnTransactionChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
134
0
    }
135
0
    AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_DestroyMe", OTHER);
136
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
137
0
        mozilla::ipc::LogicError("Transition error");
138
0
    }
139
0
140
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
141
0
    return sendok__;
142
0
}
143
144
auto PWebAuthnTransactionChild::RemoveManagee(
145
        int32_t aProtocolId,
146
        IProtocol* aListener) -> void
147
0
{
148
0
    FatalError("unreached");
149
0
    return;
150
0
}
151
152
auto PWebAuthnTransactionChild::OnMessageReceived(const Message& msg__) -> PWebAuthnTransactionChild::Result
153
0
{
154
0
    switch ((msg__).type()) {
155
0
    case PWebAuthnTransaction::Msg___delete____ID:
156
0
        {
157
0
            if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransactionChild")) {
158
0
                mozilla::ipc::LogMessageForProtocol("PWebAuthnTransactionChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
159
0
            }
160
0
            AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg___delete__", OTHER);
161
0
162
0
            PickleIterator iter__(msg__);
163
0
            PWebAuthnTransactionChild* actor;
164
0
165
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
166
0
                FatalError("Error deserializing 'PWebAuthnTransactionChild'");
167
0
                return MsgValueError;
168
0
            }
169
0
            if ((!((*((&(actor))))))) {
170
0
                FatalError("Error deserializing 'PWebAuthnTransactionChild'");
171
0
                return MsgValueError;
172
0
            }
173
0
            // Sentinel = 'actor'
174
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
175
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PWebAuthnTransactionChild'");
176
0
                return MsgValueError;
177
0
            }
178
0
            (msg__).EndRead(iter__, (msg__).type());
179
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
180
0
                FatalError("Transition error");
181
0
                return MsgValueError;
182
0
            }
183
0
            if ((!(Recv__delete__()))) {
184
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
185
0
                // Error handled in mozilla::ipc::IPCResult
186
0
                return MsgProcessingError;
187
0
            }
188
0
189
0
190
0
            IProtocol* mgr = (actor)->Manager();
191
0
            (actor)->DestroySubtree(Deletion);
192
0
            (actor)->DeallocSubtree();
193
0
            (mgr)->RemoveManagee(PWebAuthnTransactionMsgStart, actor);
194
0
195
0
            return MsgProcessed;
196
0
        }
197
0
    case PWebAuthnTransaction::Msg_ConfirmRegister__ID:
198
0
        {
199
0
            if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransactionChild")) {
200
0
                mozilla::ipc::LogMessageForProtocol("PWebAuthnTransactionChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
201
0
            }
202
0
            AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_ConfirmRegister", OTHER);
203
0
204
0
            PickleIterator iter__(msg__);
205
0
            uint64_t aTransactionId;
206
0
            WebAuthnMakeCredentialResult aResult;
207
0
208
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aTransactionId)))))) {
209
0
                FatalError("Error deserializing 'uint64_t'");
210
0
                return MsgValueError;
211
0
            }
212
0
            // Sentinel = 'aTransactionId'
213
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3266273614)))) {
214
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
215
0
                return MsgValueError;
216
0
            }
217
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aResult)))))) {
218
0
                FatalError("Error deserializing 'WebAuthnMakeCredentialResult'");
219
0
                return MsgValueError;
220
0
            }
221
0
            // Sentinel = 'aResult'
222
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3888726089)))) {
223
0
                mozilla::ipc::SentinelReadError("Error deserializing 'WebAuthnMakeCredentialResult'");
224
0
                return MsgValueError;
225
0
            }
226
0
            (msg__).EndRead(iter__, (msg__).type());
227
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
228
0
                FatalError("Transition error");
229
0
                return MsgValueError;
230
0
            }
231
0
            if ((!(RecvConfirmRegister(aTransactionId, aResult)))) {
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
            return MsgProcessed;
238
0
        }
239
0
    case PWebAuthnTransaction::Msg_ConfirmSign__ID:
240
0
        {
241
0
            if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransactionChild")) {
242
0
                mozilla::ipc::LogMessageForProtocol("PWebAuthnTransactionChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
243
0
            }
244
0
            AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_ConfirmSign", OTHER);
245
0
246
0
            PickleIterator iter__(msg__);
247
0
            uint64_t aTransactionId;
248
0
            WebAuthnGetAssertionResult aResult;
249
0
250
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aTransactionId)))))) {
251
0
                FatalError("Error deserializing 'uint64_t'");
252
0
                return MsgValueError;
253
0
            }
254
0
            // Sentinel = 'aTransactionId'
255
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3266273614)))) {
256
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
257
0
                return MsgValueError;
258
0
            }
259
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aResult)))))) {
260
0
                FatalError("Error deserializing 'WebAuthnGetAssertionResult'");
261
0
                return MsgValueError;
262
0
            }
263
0
            // Sentinel = 'aResult'
264
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3888726089)))) {
265
0
                mozilla::ipc::SentinelReadError("Error deserializing 'WebAuthnGetAssertionResult'");
266
0
                return MsgValueError;
267
0
            }
268
0
            (msg__).EndRead(iter__, (msg__).type());
269
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
270
0
                FatalError("Transition error");
271
0
                return MsgValueError;
272
0
            }
273
0
            if ((!(RecvConfirmSign(aTransactionId, aResult)))) {
274
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
275
0
                // Error handled in mozilla::ipc::IPCResult
276
0
                return MsgProcessingError;
277
0
            }
278
0
279
0
            return MsgProcessed;
280
0
        }
281
0
    case PWebAuthnTransaction::Msg_Abort__ID:
282
0
        {
283
0
            if (mozilla::ipc::LoggingEnabledFor("PWebAuthnTransactionChild")) {
284
0
                mozilla::ipc::LogMessageForProtocol("PWebAuthnTransactionChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
285
0
            }
286
0
            AUTO_PROFILER_LABEL("PWebAuthnTransaction::Msg_Abort", OTHER);
287
0
288
0
            PickleIterator iter__(msg__);
289
0
            uint64_t aTransactionId;
290
0
            nsresult Error;
291
0
292
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aTransactionId)))))) {
293
0
                FatalError("Error deserializing 'uint64_t'");
294
0
                return MsgValueError;
295
0
            }
296
0
            // Sentinel = 'aTransactionId'
297
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3266273614)))) {
298
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
299
0
                return MsgValueError;
300
0
            }
301
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(Error)))))) {
302
0
                FatalError("Error deserializing 'nsresult'");
303
0
                return MsgValueError;
304
0
            }
305
0
            // Sentinel = 'Error'
306
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1861840727)))) {
307
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
308
0
                return MsgValueError;
309
0
            }
310
0
            (msg__).EndRead(iter__, (msg__).type());
311
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
312
0
                FatalError("Transition error");
313
0
                return MsgValueError;
314
0
            }
315
0
            if ((!(RecvAbort(aTransactionId, Error)))) {
316
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
317
0
                // Error handled in mozilla::ipc::IPCResult
318
0
                return MsgProcessingError;
319
0
            }
320
0
321
0
            return MsgProcessed;
322
0
        }
323
0
    default:
324
0
        {
325
0
            return MsgNotKnown;
326
0
        }
327
0
    }
328
0
}
329
330
auto PWebAuthnTransactionChild::OnMessageReceived(
331
        const Message& msg__,
332
        Message*& reply__) -> PWebAuthnTransactionChild::Result
333
0
{
334
0
    return MsgNotKnown;
335
0
}
336
337
auto PWebAuthnTransactionChild::OnCallReceived(
338
        const Message& msg__,
339
        Message*& reply__) -> PWebAuthnTransactionChild::Result
340
0
{
341
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
342
0
    return MsgNotKnown;
343
0
}
344
345
auto PWebAuthnTransactionChild::GetProtocolTypeId() -> int32_t
346
0
{
347
0
    return PWebAuthnTransactionMsgStart;
348
0
}
349
350
auto PWebAuthnTransactionChild::DestroySubtree(ActorDestroyReason why) -> void
351
0
{
352
0
    // Unregister from our manager.
353
0
    Unregister(Id());
354
0
355
0
    // Reject owning pending responses.
356
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
357
0
358
0
    // Finally, destroy "us".
359
0
    ActorDestroy(why);
360
0
}
361
362
auto PWebAuthnTransactionChild::DeallocSubtree() -> void
363
0
{
364
0
}
365
366
367
368
} // namespace dom
369
} // namespace mozilla
370
namespace mozilla {
371
namespace ipc {
372
auto IPDLParamTraits<mozilla::dom::PWebAuthnTransactionChild>::Write(
373
        IPC::Message* aMsg,
374
        mozilla::ipc::IProtocol* aActor,
375
        const paramType& aVar) -> void
376
0
{
377
0
    int32_t id;
378
0
    if ((!(aVar))) {
379
0
        id = 0;
380
0
    }
381
0
    else {
382
0
        id = (aVar)->Id();
383
0
        if ((1) == (id)) {
384
0
            (aActor)->FatalError("actor has been |delete|d");
385
0
        }
386
0
    }
387
0
    WriteIPDLParam(aMsg, aActor, id);
388
0
}
389
390
auto IPDLParamTraits<mozilla::dom::PWebAuthnTransactionChild>::Read(
391
        const IPC::Message* aMsg,
392
        PickleIterator* aIter,
393
        mozilla::ipc::IProtocol* aActor,
394
        paramType* aVar) -> bool
395
0
{
396
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PWebAuthnTransaction", PWebAuthnTransactionMsgStart);
397
0
    if ((actor).isNothing()) {
398
0
        return false;
399
0
    }
400
0
401
0
    (*(aVar)) = static_cast<mozilla::dom::PWebAuthnTransactionChild*>((actor).value());
402
0
    return true;
403
0
}
404
405
} // namespace ipc
406
} // namespace mozilla