Coverage Report

Created: 2018-09-25 14:53

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