Coverage Report

Created: 2018-09-25 14:53

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