Coverage Report

Created: 2018-09-25 14:53

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