Coverage Report

Created: 2018-09-25 14:53

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