Coverage Report

Created: 2018-09-25 14:53

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