Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PBackgroundIDBFactoryRequestChild.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/indexedDB/PBackgroundIDBFactoryRequestChild.h"
8
9
#include "mozilla/dom/indexedDB/PBackgroundIDBFactoryChild.h"
10
#include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseChild.h"
11
12
#include "nsIFile.h"
13
#include "GeckoProfiler.h"
14
15
namespace mozilla {
16
namespace dom {
17
namespace indexedDB {
18
19
20
auto PBackgroundIDBFactoryRequestChild::Recv__delete__(const FactoryRequestResponse& response) -> mozilla::ipc::IPCResult
21
0
{
22
0
    return IPC_OK();
23
0
}
24
25
auto PBackgroundIDBFactoryRequestChild::ActorDestroy(ActorDestroyReason aWhy) -> void
26
0
{
27
0
}
28
29
MOZ_IMPLICIT PBackgroundIDBFactoryRequestChild::PBackgroundIDBFactoryRequestChild() :
30
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
31
    mLivenessState(mozilla::ipc::LivenessState::Dead)
32
0
{
33
0
    MOZ_COUNT_CTOR(PBackgroundIDBFactoryRequestChild);
34
0
}
35
36
PBackgroundIDBFactoryRequestChild::~PBackgroundIDBFactoryRequestChild()
37
0
{
38
0
    MOZ_COUNT_DTOR(PBackgroundIDBFactoryRequestChild);
39
0
}
40
41
auto PBackgroundIDBFactoryRequestChild::Manager() const -> PBackgroundIDBFactoryChild*
42
0
{
43
0
    return static_cast<PBackgroundIDBFactoryChild*>(IProtocol::Manager());
44
0
}
45
46
auto PBackgroundIDBFactoryRequestChild::SendPermissionRetry() -> bool
47
0
{
48
0
    IPC::Message* msg__ = PBackgroundIDBFactoryRequest::Msg_PermissionRetry(Id());
49
0
50
0
51
0
52
0
53
0
54
0
    if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBFactoryRequestChild")) {
55
0
        mozilla::ipc::LogMessageForProtocol("PBackgroundIDBFactoryRequestChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
56
0
    }
57
0
    AUTO_PROFILER_LABEL("PBackgroundIDBFactoryRequest::Msg_PermissionRetry", OTHER);
58
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
59
0
        mozilla::ipc::LogicError("Transition error");
60
0
    }
61
0
62
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
63
0
    return sendok__;
64
0
}
65
66
auto PBackgroundIDBFactoryRequestChild::RemoveManagee(
67
        int32_t aProtocolId,
68
        IProtocol* aListener) -> void
69
0
{
70
0
    FatalError("unreached");
71
0
    return;
72
0
}
73
74
auto PBackgroundIDBFactoryRequestChild::OnMessageReceived(const Message& msg__) -> PBackgroundIDBFactoryRequestChild::Result
75
0
{
76
0
    switch ((msg__).type()) {
77
0
    case PBackgroundIDBFactoryRequest::Msg___delete____ID:
78
0
        {
79
0
            if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBFactoryRequestChild")) {
80
0
                mozilla::ipc::LogMessageForProtocol("PBackgroundIDBFactoryRequestChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
81
0
            }
82
0
            AUTO_PROFILER_LABEL("PBackgroundIDBFactoryRequest::Msg___delete__", OTHER);
83
0
84
0
            PickleIterator iter__(msg__);
85
0
            PBackgroundIDBFactoryRequestChild* actor;
86
0
            FactoryRequestResponse response;
87
0
88
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
89
0
                FatalError("Error deserializing 'PBackgroundIDBFactoryRequestChild'");
90
0
                return MsgValueError;
91
0
            }
92
0
            if ((!((*((&(actor))))))) {
93
0
                FatalError("Error deserializing 'PBackgroundIDBFactoryRequestChild'");
94
0
                return MsgValueError;
95
0
            }
96
0
            // Sentinel = 'actor'
97
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
98
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PBackgroundIDBFactoryRequestChild'");
99
0
                return MsgValueError;
100
0
            }
101
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(response)))))) {
102
0
                FatalError("Error deserializing 'FactoryRequestResponse'");
103
0
                return MsgValueError;
104
0
            }
105
0
            // Sentinel = 'response'
106
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2396115421)))) {
107
0
                mozilla::ipc::SentinelReadError("Error deserializing 'FactoryRequestResponse'");
108
0
                return MsgValueError;
109
0
            }
110
0
            (msg__).EndRead(iter__, (msg__).type());
111
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
112
0
                FatalError("Transition error");
113
0
                return MsgValueError;
114
0
            }
115
0
            if ((!(Recv__delete__(response)))) {
116
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
117
0
                // Error handled in mozilla::ipc::IPCResult
118
0
                return MsgProcessingError;
119
0
            }
120
0
121
0
122
0
            IProtocol* mgr = (actor)->Manager();
123
0
            (actor)->DestroySubtree(Deletion);
124
0
            (actor)->DeallocSubtree();
125
0
            (mgr)->RemoveManagee(PBackgroundIDBFactoryRequestMsgStart, actor);
126
0
127
0
            return MsgProcessed;
128
0
        }
129
0
    case PBackgroundIDBFactoryRequest::Msg_PermissionChallenge__ID:
130
0
        {
131
0
            if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBFactoryRequestChild")) {
132
0
                mozilla::ipc::LogMessageForProtocol("PBackgroundIDBFactoryRequestChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
133
0
            }
134
0
            AUTO_PROFILER_LABEL("PBackgroundIDBFactoryRequest::Msg_PermissionChallenge", OTHER);
135
0
136
0
            PickleIterator iter__(msg__);
137
0
            PrincipalInfo principalInfo;
138
0
139
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(principalInfo)))))) {
140
0
                FatalError("Error deserializing 'PrincipalInfo'");
141
0
                return MsgValueError;
142
0
            }
143
0
            // Sentinel = 'principalInfo'
144
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3386633731)))) {
145
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PrincipalInfo'");
146
0
                return MsgValueError;
147
0
            }
148
0
            (msg__).EndRead(iter__, (msg__).type());
149
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
150
0
                FatalError("Transition error");
151
0
                return MsgValueError;
152
0
            }
153
0
            if ((!(RecvPermissionChallenge(principalInfo)))) {
154
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
155
0
                // Error handled in mozilla::ipc::IPCResult
156
0
                return MsgProcessingError;
157
0
            }
158
0
159
0
            return MsgProcessed;
160
0
        }
161
0
    case PBackgroundIDBFactoryRequest::Msg_Blocked__ID:
162
0
        {
163
0
            if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBFactoryRequestChild")) {
164
0
                mozilla::ipc::LogMessageForProtocol("PBackgroundIDBFactoryRequestChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
165
0
            }
166
0
            AUTO_PROFILER_LABEL("PBackgroundIDBFactoryRequest::Msg_Blocked", OTHER);
167
0
168
0
            PickleIterator iter__(msg__);
169
0
            uint64_t currentVersion;
170
0
171
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(currentVersion)))))) {
172
0
                FatalError("Error deserializing 'uint64_t'");
173
0
                return MsgValueError;
174
0
            }
175
0
            // Sentinel = 'currentVersion'
176
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1138986547)))) {
177
0
                mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
178
0
                return MsgValueError;
179
0
            }
180
0
            (msg__).EndRead(iter__, (msg__).type());
181
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
182
0
                FatalError("Transition error");
183
0
                return MsgValueError;
184
0
            }
185
0
            if ((!(RecvBlocked(currentVersion)))) {
186
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
187
0
                // Error handled in mozilla::ipc::IPCResult
188
0
                return MsgProcessingError;
189
0
            }
190
0
191
0
            return MsgProcessed;
192
0
        }
193
0
    default:
194
0
        {
195
0
            return MsgNotKnown;
196
0
        }
197
0
    }
198
0
}
199
200
auto PBackgroundIDBFactoryRequestChild::OnMessageReceived(
201
        const Message& msg__,
202
        Message*& reply__) -> PBackgroundIDBFactoryRequestChild::Result
203
0
{
204
0
    return MsgNotKnown;
205
0
}
206
207
auto PBackgroundIDBFactoryRequestChild::OnCallReceived(
208
        const Message& msg__,
209
        Message*& reply__) -> PBackgroundIDBFactoryRequestChild::Result
210
0
{
211
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
212
0
    return MsgNotKnown;
213
0
}
214
215
auto PBackgroundIDBFactoryRequestChild::GetProtocolTypeId() -> int32_t
216
0
{
217
0
    return PBackgroundIDBFactoryRequestMsgStart;
218
0
}
219
220
auto PBackgroundIDBFactoryRequestChild::DestroySubtree(ActorDestroyReason why) -> void
221
0
{
222
0
    // Unregister from our manager.
223
0
    Unregister(Id());
224
0
225
0
    // Reject owning pending responses.
226
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
227
0
228
0
    // Finally, destroy "us".
229
0
    ActorDestroy(why);
230
0
}
231
232
auto PBackgroundIDBFactoryRequestChild::DeallocSubtree() -> void
233
0
{
234
0
}
235
236
237
238
} // namespace indexedDB
239
} // namespace dom
240
} // namespace mozilla
241
namespace mozilla {
242
namespace ipc {
243
auto IPDLParamTraits<mozilla::dom::indexedDB::PBackgroundIDBFactoryRequestChild>::Write(
244
        IPC::Message* aMsg,
245
        mozilla::ipc::IProtocol* aActor,
246
        const paramType& aVar) -> void
247
0
{
248
0
    int32_t id;
249
0
    if ((!(aVar))) {
250
0
        id = 0;
251
0
    }
252
0
    else {
253
0
        id = (aVar)->Id();
254
0
        if ((1) == (id)) {
255
0
            (aActor)->FatalError("actor has been |delete|d");
256
0
        }
257
0
    }
258
0
    WriteIPDLParam(aMsg, aActor, id);
259
0
}
260
261
auto IPDLParamTraits<mozilla::dom::indexedDB::PBackgroundIDBFactoryRequestChild>::Read(
262
        const IPC::Message* aMsg,
263
        PickleIterator* aIter,
264
        mozilla::ipc::IProtocol* aActor,
265
        paramType* aVar) -> bool
266
0
{
267
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PBackgroundIDBFactoryRequest", PBackgroundIDBFactoryRequestMsgStart);
268
0
    if ((actor).isNothing()) {
269
0
        return false;
270
0
    }
271
0
272
0
    (*(aVar)) = static_cast<mozilla::dom::indexedDB::PBackgroundIDBFactoryRequestChild*>((actor).value());
273
0
    return true;
274
0
}
275
276
} // namespace ipc
277
} // namespace mozilla