Line data Source code
1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 :
7 : #include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseRequestChild.h"
8 :
9 : #include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseChild.h"
10 : #include "mozilla/dom/PBackgroundMutableFileChild.h"
11 :
12 : #include "nsIFile.h"
13 : #include "GeckoProfiler.h"
14 :
15 : namespace mozilla {
16 : namespace dom {
17 : namespace indexedDB {
18 :
19 :
20 0 : auto PBackgroundIDBDatabaseRequestChild::Recv__delete__(const DatabaseRequestResponse& response) -> mozilla::ipc::IPCResult
21 : {
22 0 : return IPC_OK();
23 : }
24 :
25 0 : auto PBackgroundIDBDatabaseRequestChild::ActorDestroy(ActorDestroyReason aWhy) -> void
26 : {
27 0 : }
28 :
29 0 : MOZ_IMPLICIT PBackgroundIDBDatabaseRequestChild::PBackgroundIDBDatabaseRequestChild() :
30 : mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
31 0 : mState(PBackgroundIDBDatabaseRequest::__Dead)
32 : {
33 0 : MOZ_COUNT_CTOR(PBackgroundIDBDatabaseRequestChild);
34 0 : }
35 :
36 0 : PBackgroundIDBDatabaseRequestChild::~PBackgroundIDBDatabaseRequestChild()
37 : {
38 0 : MOZ_COUNT_DTOR(PBackgroundIDBDatabaseRequestChild);
39 0 : }
40 :
41 0 : auto PBackgroundIDBDatabaseRequestChild::Manager() const -> PBackgroundIDBDatabaseChild*
42 : {
43 0 : return static_cast<PBackgroundIDBDatabaseChild*>(IProtocol::Manager());
44 : }
45 :
46 0 : auto PBackgroundIDBDatabaseRequestChild::RemoveManagee(
47 : int32_t aProtocolId,
48 : ProtocolBase* aListener) -> void
49 : {
50 0 : FatalError("unreached");
51 0 : return;
52 : }
53 :
54 0 : auto PBackgroundIDBDatabaseRequestChild::OnMessageReceived(const Message& msg__) -> PBackgroundIDBDatabaseRequestChild::Result
55 : {
56 0 : switch ((msg__).type()) {
57 : case PBackgroundIDBDatabaseRequest::Msg___delete____ID:
58 : {
59 0 : if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBDatabaseRequestChild")) {
60 0 : mozilla::ipc::LogMessageForProtocol("PBackgroundIDBDatabaseRequestChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
61 : }
62 0 : AUTO_PROFILER_LABEL("PBackgroundIDBDatabaseRequest::Msg___delete__", OTHER);
63 :
64 0 : PickleIterator iter__(msg__);
65 : PBackgroundIDBDatabaseRequestChild* actor;
66 0 : DatabaseRequestResponse response;
67 :
68 0 : if ((!(Read((&(actor)), (&(msg__)), (&(iter__)), false)))) {
69 0 : FatalError("Error deserializing 'PBackgroundIDBDatabaseRequestChild'");
70 0 : return MsgValueError;
71 : }
72 : // Sentinel = 'actor'
73 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
74 0 : mozilla::ipc::SentinelReadError("Error deserializing 'PBackgroundIDBDatabaseRequestChild'");
75 0 : return MsgValueError;
76 : }
77 0 : if ((!(Read((&(response)), (&(msg__)), (&(iter__)))))) {
78 0 : FatalError("Error deserializing 'DatabaseRequestResponse'");
79 0 : return MsgValueError;
80 : }
81 : // Sentinel = 'response'
82 0 : if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2396115421)))) {
83 0 : mozilla::ipc::SentinelReadError("Error deserializing 'DatabaseRequestResponse'");
84 0 : return MsgValueError;
85 : }
86 0 : (msg__).EndRead(iter__, (msg__).type());
87 0 : PBackgroundIDBDatabaseRequest::Transition(PBackgroundIDBDatabaseRequest::Msg___delete____ID, (&(mState)));
88 0 : if ((!(Recv__delete__(mozilla::Move(response))))) {
89 0 : mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
90 : // Error handled in mozilla::ipc::IPCResult
91 0 : return MsgProcessingError;
92 : }
93 :
94 :
95 0 : IProtocol* mgr = (actor)->Manager();
96 0 : (actor)->DestroySubtree(Deletion);
97 0 : (actor)->DeallocSubtree();
98 0 : (mgr)->RemoveManagee(PBackgroundIDBDatabaseRequestMsgStart, actor);
99 :
100 0 : return MsgProcessed;
101 : }
102 : default:
103 : {
104 0 : return MsgNotKnown;
105 : }
106 : }
107 : }
108 :
109 0 : auto PBackgroundIDBDatabaseRequestChild::OnMessageReceived(
110 : const Message& msg__,
111 : Message*& reply__) -> PBackgroundIDBDatabaseRequestChild::Result
112 : {
113 0 : return MsgNotKnown;
114 : }
115 :
116 0 : auto PBackgroundIDBDatabaseRequestChild::OnCallReceived(
117 : const Message& msg__,
118 : Message*& reply__) -> PBackgroundIDBDatabaseRequestChild::Result
119 : {
120 0 : MOZ_ASSERT_UNREACHABLE("message protocol not supported");
121 : return MsgNotKnown;
122 : }
123 :
124 0 : auto PBackgroundIDBDatabaseRequestChild::GetProtocolTypeId() -> int32_t
125 : {
126 0 : return PBackgroundIDBDatabaseRequestMsgStart;
127 : }
128 :
129 0 : auto PBackgroundIDBDatabaseRequestChild::ProtocolName() const -> const char*
130 : {
131 0 : return "PBackgroundIDBDatabaseRequestChild";
132 : }
133 :
134 0 : auto PBackgroundIDBDatabaseRequestChild::DestroySubtree(ActorDestroyReason why) -> void
135 : {
136 : // Unregister from our manager.
137 0 : Unregister(Id());
138 :
139 : // Reject owning pending promises.
140 0 : (GetIPCChannel())->RejectPendingPromisesForActor(this);
141 :
142 : // Finally, destroy "us".
143 0 : ActorDestroy(why);
144 0 : }
145 :
146 0 : auto PBackgroundIDBDatabaseRequestChild::DeallocSubtree() -> void
147 : {
148 0 : }
149 :
150 0 : auto PBackgroundIDBDatabaseRequestChild::Write(
151 : const DatabaseRequestResponse& v__,
152 : Message* msg__) -> void
153 : {
154 : typedef DatabaseRequestResponse type__;
155 0 : Write(int((v__).type()), msg__);
156 : // Sentinel = 'DatabaseRequestResponse'
157 0 : (msg__)->WriteSentinel(943126744);
158 :
159 0 : switch ((v__).type()) {
160 : case type__::Tnsresult:
161 : {
162 0 : Write((v__).get_nsresult(), msg__);
163 : // Sentinel = 'Tnsresult'
164 0 : (msg__)->WriteSentinel(2293764539);
165 0 : return;
166 : }
167 : case type__::TCreateFileRequestResponse:
168 : {
169 0 : Write((v__).get_CreateFileRequestResponse(), msg__);
170 : // Sentinel = 'TCreateFileRequestResponse'
171 0 : (msg__)->WriteSentinel(3189577818);
172 0 : return;
173 : }
174 : default:
175 : {
176 0 : FatalError("unknown union type");
177 0 : return;
178 : }
179 : }
180 : }
181 :
182 0 : auto PBackgroundIDBDatabaseRequestChild::Read(
183 : DatabaseRequestResponse* v__,
184 : const Message* msg__,
185 : PickleIterator* iter__) -> bool
186 : {
187 : typedef DatabaseRequestResponse type__;
188 : int type;
189 0 : if ((!(Read((&(type)), msg__, iter__)))) {
190 0 : mozilla::ipc::UnionTypeReadError("DatabaseRequestResponse");
191 0 : return false;
192 : }
193 : // Sentinel = 'DatabaseRequestResponse'
194 0 : if ((!((msg__)->ReadSentinel(iter__, 943126744)))) {
195 0 : mozilla::ipc::SentinelReadError("DatabaseRequestResponse");
196 0 : return false;
197 : }
198 :
199 0 : switch (type) {
200 : case type__::Tnsresult:
201 : {
202 0 : nsresult tmp = nsresult();
203 0 : (*(v__)) = tmp;
204 0 : if ((!(Read((&((v__)->get_nsresult())), msg__, iter__)))) {
205 0 : FatalError("Error deserializing Union type");
206 0 : return false;
207 : }
208 : // Sentinel = 'Tnsresult'
209 0 : if ((!((msg__)->ReadSentinel(iter__, 2293764539)))) {
210 0 : mozilla::ipc::SentinelReadError("Error deserializing Union type");
211 0 : return false;
212 : }
213 0 : return true;
214 : }
215 : case type__::TCreateFileRequestResponse:
216 : {
217 0 : CreateFileRequestResponse tmp = CreateFileRequestResponse();
218 0 : (*(v__)) = tmp;
219 0 : if ((!(Read((&((v__)->get_CreateFileRequestResponse())), msg__, iter__)))) {
220 0 : FatalError("Error deserializing Union type");
221 0 : return false;
222 : }
223 : // Sentinel = 'TCreateFileRequestResponse'
224 0 : if ((!((msg__)->ReadSentinel(iter__, 3189577818)))) {
225 0 : mozilla::ipc::SentinelReadError("Error deserializing Union type");
226 0 : return false;
227 : }
228 0 : return true;
229 : }
230 : default:
231 : {
232 0 : FatalError("unknown union type");
233 0 : return false;
234 : }
235 : }
236 : }
237 :
238 0 : auto PBackgroundIDBDatabaseRequestChild::Write(
239 : const PBackgroundMutableFileChild* v__,
240 : Message* msg__,
241 : bool nullable__) -> void
242 : {
243 : int32_t id;
244 0 : if ((!(v__))) {
245 0 : if ((!(nullable__))) {
246 0 : FatalError("NULL actor value passed to non-nullable param");
247 : }
248 0 : id = 0;
249 : }
250 : else {
251 0 : id = (v__)->Id();
252 0 : if ((1) == (id)) {
253 0 : FatalError("actor has been |delete|d");
254 : }
255 : }
256 :
257 0 : Write(id, msg__);
258 0 : }
259 :
260 0 : auto PBackgroundIDBDatabaseRequestChild::Read(
261 : PBackgroundMutableFileChild** v__,
262 : const Message* msg__,
263 : PickleIterator* iter__,
264 : bool nullable__) -> bool
265 : {
266 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PBackgroundMutableFile", PBackgroundMutableFileMsgStart);
267 0 : if ((actor).isNothing()) {
268 0 : return false;
269 : }
270 :
271 0 : (*(v__)) = static_cast<PBackgroundMutableFileChild*>((actor).value());
272 0 : return true;
273 : }
274 :
275 0 : auto PBackgroundIDBDatabaseRequestChild::Write(
276 : const CreateFileRequestResponse& v__,
277 : Message* msg__) -> void
278 : {
279 : // skipping actor field that's meaningless on this side
280 0 : Write((v__).mutableFileChild(), msg__, false);
281 : // Sentinel = 'mutableFile'
282 0 : (msg__)->WriteSentinel(1328259167);
283 0 : }
284 :
285 0 : auto PBackgroundIDBDatabaseRequestChild::Read(
286 : CreateFileRequestResponse* v__,
287 : const Message* msg__,
288 : PickleIterator* iter__) -> bool
289 : {
290 : // skipping actor field that's meaningless on this side
291 0 : if ((!(Read((&((v__)->mutableFileChild())), msg__, iter__, false)))) {
292 0 : FatalError("Error deserializing 'mutableFileChild' (PBackgroundMutableFile) member of 'CreateFileRequestResponse'");
293 0 : return false;
294 : }
295 : // Sentinel = 'mutableFile'
296 0 : if ((!((msg__)->ReadSentinel(iter__, 1328259167)))) {
297 0 : mozilla::ipc::SentinelReadError("Error deserializing 'mutableFileChild' (PBackgroundMutableFile) member of 'CreateFileRequestResponse'");
298 0 : return false;
299 : }
300 0 : return true;
301 : }
302 :
303 0 : auto PBackgroundIDBDatabaseRequestChild::Write(
304 : const PBackgroundIDBDatabaseRequestChild* v__,
305 : Message* msg__,
306 : bool nullable__) -> void
307 : {
308 : int32_t id;
309 0 : if ((!(v__))) {
310 0 : if ((!(nullable__))) {
311 0 : FatalError("NULL actor value passed to non-nullable param");
312 : }
313 0 : id = 0;
314 : }
315 : else {
316 0 : id = (v__)->Id();
317 0 : if ((1) == (id)) {
318 0 : FatalError("actor has been |delete|d");
319 : }
320 : }
321 :
322 0 : Write(id, msg__);
323 0 : }
324 :
325 0 : auto PBackgroundIDBDatabaseRequestChild::Read(
326 : PBackgroundIDBDatabaseRequestChild** v__,
327 : const Message* msg__,
328 : PickleIterator* iter__,
329 : bool nullable__) -> bool
330 : {
331 0 : Maybe<mozilla::ipc::IProtocol*> actor = ReadActor(msg__, iter__, nullable__, "PBackgroundIDBDatabaseRequest", PBackgroundIDBDatabaseRequestMsgStart);
332 0 : if ((actor).isNothing()) {
333 0 : return false;
334 : }
335 :
336 0 : (*(v__)) = static_cast<PBackgroundIDBDatabaseRequestChild*>((actor).value());
337 0 : return true;
338 : }
339 :
340 :
341 :
342 : } // namespace indexedDB
343 : } // namespace dom
344 : } // namespace mozilla
|