/work/obj-fuzz/ipc/ipdl/PBackgroundIDBVersionChangeTransactionChild.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/PBackgroundIDBVersionChangeTransactionChild.h" |
8 | | |
9 | | #include "mozilla/dom/indexedDB/PBackgroundIDBCursorChild.h" |
10 | | #include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseChild.h" |
11 | | #include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseFileChild.h" |
12 | | #include "mozilla/dom/indexedDB/PBackgroundIDBRequestChild.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 PBackgroundIDBVersionChangeTransactionChild::Recv__delete__() -> mozilla::ipc::IPCResult |
28 | 0 | { |
29 | 0 | return IPC_OK(); |
30 | 0 | } |
31 | | |
32 | | auto PBackgroundIDBVersionChangeTransactionChild::ActorDestroy(ActorDestroyReason aWhy) -> void |
33 | 0 | { |
34 | 0 | } |
35 | | |
36 | | MOZ_IMPLICIT PBackgroundIDBVersionChangeTransactionChild::PBackgroundIDBVersionChangeTransactionChild() : |
37 | | mozilla::ipc::IProtocol(mozilla::ipc::ChildSide), |
38 | | mLivenessState(mozilla::ipc::LivenessState::Dead) |
39 | 0 | { |
40 | 0 | MOZ_COUNT_CTOR(PBackgroundIDBVersionChangeTransactionChild); |
41 | 0 | } |
42 | | |
43 | | PBackgroundIDBVersionChangeTransactionChild::~PBackgroundIDBVersionChangeTransactionChild() |
44 | 0 | { |
45 | 0 | MOZ_COUNT_DTOR(PBackgroundIDBVersionChangeTransactionChild); |
46 | 0 | } |
47 | | |
48 | | auto PBackgroundIDBVersionChangeTransactionChild::Manager() const -> PBackgroundIDBDatabaseChild* |
49 | 0 | { |
50 | 0 | return static_cast<PBackgroundIDBDatabaseChild*>(IProtocol::Manager()); |
51 | 0 | } |
52 | | |
53 | | auto PBackgroundIDBVersionChangeTransactionChild::ManagedPBackgroundIDBCursorChild(nsTArray<PBackgroundIDBCursorChild*>& aArr) const -> void |
54 | 0 | { |
55 | 0 | (mManagedPBackgroundIDBCursorChild).ToArray(aArr); |
56 | 0 | } |
57 | | |
58 | | auto PBackgroundIDBVersionChangeTransactionChild::ManagedPBackgroundIDBCursorChild() const -> const ManagedContainer<PBackgroundIDBCursorChild>& |
59 | 0 | { |
60 | 0 | return mManagedPBackgroundIDBCursorChild; |
61 | 0 | } |
62 | | |
63 | | auto PBackgroundIDBVersionChangeTransactionChild::ManagedPBackgroundIDBRequestChild(nsTArray<PBackgroundIDBRequestChild*>& aArr) const -> void |
64 | 0 | { |
65 | 0 | (mManagedPBackgroundIDBRequestChild).ToArray(aArr); |
66 | 0 | } |
67 | | |
68 | | auto PBackgroundIDBVersionChangeTransactionChild::ManagedPBackgroundIDBRequestChild() const -> const ManagedContainer<PBackgroundIDBRequestChild>& |
69 | 0 | { |
70 | 0 | return mManagedPBackgroundIDBRequestChild; |
71 | 0 | } |
72 | | |
73 | | auto PBackgroundIDBVersionChangeTransactionChild::SendDeleteMe() -> bool |
74 | 0 | { |
75 | 0 | IPC::Message* msg__ = PBackgroundIDBVersionChangeTransaction::Msg_DeleteMe(Id()); |
76 | 0 |
|
77 | 0 |
|
78 | 0 |
|
79 | 0 |
|
80 | 0 |
|
81 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBVersionChangeTransactionChild")) { |
82 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundIDBVersionChangeTransactionChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
83 | 0 | } |
84 | 0 | AUTO_PROFILER_LABEL("PBackgroundIDBVersionChangeTransaction::Msg_DeleteMe", OTHER); |
85 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
86 | 0 | mozilla::ipc::LogicError("Transition error"); |
87 | 0 | } |
88 | 0 |
|
89 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
90 | 0 | return sendok__; |
91 | 0 | } |
92 | | |
93 | | auto PBackgroundIDBVersionChangeTransactionChild::SendCommit() -> bool |
94 | 0 | { |
95 | 0 | IPC::Message* msg__ = PBackgroundIDBVersionChangeTransaction::Msg_Commit(Id()); |
96 | 0 |
|
97 | 0 |
|
98 | 0 |
|
99 | 0 |
|
100 | 0 |
|
101 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBVersionChangeTransactionChild")) { |
102 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundIDBVersionChangeTransactionChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
103 | 0 | } |
104 | 0 | AUTO_PROFILER_LABEL("PBackgroundIDBVersionChangeTransaction::Msg_Commit", OTHER); |
105 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
106 | 0 | mozilla::ipc::LogicError("Transition error"); |
107 | 0 | } |
108 | 0 |
|
109 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
110 | 0 | return sendok__; |
111 | 0 | } |
112 | | |
113 | | auto PBackgroundIDBVersionChangeTransactionChild::SendAbort(const nsresult& resultCode) -> bool |
114 | 0 | { |
115 | 0 | IPC::Message* msg__ = PBackgroundIDBVersionChangeTransaction::Msg_Abort(Id()); |
116 | 0 |
|
117 | 0 | WriteIPDLParam(msg__, this, resultCode); |
118 | 0 | // Sentinel = 'resultCode' |
119 | 0 | (msg__)->WriteSentinel(183600282); |
120 | 0 |
|
121 | 0 |
|
122 | 0 |
|
123 | 0 |
|
124 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBVersionChangeTransactionChild")) { |
125 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundIDBVersionChangeTransactionChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
126 | 0 | } |
127 | 0 | AUTO_PROFILER_LABEL("PBackgroundIDBVersionChangeTransaction::Msg_Abort", OTHER); |
128 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
129 | 0 | mozilla::ipc::LogicError("Transition error"); |
130 | 0 | } |
131 | 0 |
|
132 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
133 | 0 | return sendok__; |
134 | 0 | } |
135 | | |
136 | | auto PBackgroundIDBVersionChangeTransactionChild::SendCreateObjectStore(const ObjectStoreMetadata& metadata) -> bool |
137 | 0 | { |
138 | 0 | IPC::Message* msg__ = PBackgroundIDBVersionChangeTransaction::Msg_CreateObjectStore(Id()); |
139 | 0 |
|
140 | 0 | WriteIPDLParam(msg__, this, metadata); |
141 | 0 | // Sentinel = 'metadata' |
142 | 0 | (msg__)->WriteSentinel(541737151); |
143 | 0 |
|
144 | 0 |
|
145 | 0 |
|
146 | 0 |
|
147 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBVersionChangeTransactionChild")) { |
148 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundIDBVersionChangeTransactionChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
149 | 0 | } |
150 | 0 | AUTO_PROFILER_LABEL("PBackgroundIDBVersionChangeTransaction::Msg_CreateObjectStore", OTHER); |
151 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
152 | 0 | mozilla::ipc::LogicError("Transition error"); |
153 | 0 | } |
154 | 0 |
|
155 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
156 | 0 | return sendok__; |
157 | 0 | } |
158 | | |
159 | | auto PBackgroundIDBVersionChangeTransactionChild::SendDeleteObjectStore(const int64_t& objectStoreId) -> bool |
160 | 0 | { |
161 | 0 | IPC::Message* msg__ = PBackgroundIDBVersionChangeTransaction::Msg_DeleteObjectStore(Id()); |
162 | 0 |
|
163 | 0 | WriteIPDLParam(msg__, this, objectStoreId); |
164 | 0 | // Sentinel = 'objectStoreId' |
165 | 0 | (msg__)->WriteSentinel(2036303666); |
166 | 0 |
|
167 | 0 |
|
168 | 0 |
|
169 | 0 |
|
170 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBVersionChangeTransactionChild")) { |
171 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundIDBVersionChangeTransactionChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
172 | 0 | } |
173 | 0 | AUTO_PROFILER_LABEL("PBackgroundIDBVersionChangeTransaction::Msg_DeleteObjectStore", OTHER); |
174 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
175 | 0 | mozilla::ipc::LogicError("Transition error"); |
176 | 0 | } |
177 | 0 |
|
178 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
179 | 0 | return sendok__; |
180 | 0 | } |
181 | | |
182 | | auto PBackgroundIDBVersionChangeTransactionChild::SendRenameObjectStore( |
183 | | const int64_t& objectStoreId, |
184 | | const nsString& name) -> bool |
185 | 0 | { |
186 | 0 | IPC::Message* msg__ = PBackgroundIDBVersionChangeTransaction::Msg_RenameObjectStore(Id()); |
187 | 0 |
|
188 | 0 | WriteIPDLParam(msg__, this, objectStoreId); |
189 | 0 | // Sentinel = 'objectStoreId' |
190 | 0 | (msg__)->WriteSentinel(2036303666); |
191 | 0 | WriteIPDLParam(msg__, this, name); |
192 | 0 | // Sentinel = 'name' |
193 | 0 | (msg__)->WriteSentinel(15034981); |
194 | 0 |
|
195 | 0 |
|
196 | 0 |
|
197 | 0 |
|
198 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBVersionChangeTransactionChild")) { |
199 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundIDBVersionChangeTransactionChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
200 | 0 | } |
201 | 0 | AUTO_PROFILER_LABEL("PBackgroundIDBVersionChangeTransaction::Msg_RenameObjectStore", OTHER); |
202 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
203 | 0 | mozilla::ipc::LogicError("Transition error"); |
204 | 0 | } |
205 | 0 |
|
206 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
207 | 0 | return sendok__; |
208 | 0 | } |
209 | | |
210 | | auto PBackgroundIDBVersionChangeTransactionChild::SendCreateIndex( |
211 | | const int64_t& objectStoreId, |
212 | | const IndexMetadata& metadata) -> bool |
213 | 0 | { |
214 | 0 | IPC::Message* msg__ = PBackgroundIDBVersionChangeTransaction::Msg_CreateIndex(Id()); |
215 | 0 |
|
216 | 0 | WriteIPDLParam(msg__, this, objectStoreId); |
217 | 0 | // Sentinel = 'objectStoreId' |
218 | 0 | (msg__)->WriteSentinel(2036303666); |
219 | 0 | WriteIPDLParam(msg__, this, metadata); |
220 | 0 | // Sentinel = 'metadata' |
221 | 0 | (msg__)->WriteSentinel(541737151); |
222 | 0 |
|
223 | 0 |
|
224 | 0 |
|
225 | 0 |
|
226 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBVersionChangeTransactionChild")) { |
227 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundIDBVersionChangeTransactionChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
228 | 0 | } |
229 | 0 | AUTO_PROFILER_LABEL("PBackgroundIDBVersionChangeTransaction::Msg_CreateIndex", OTHER); |
230 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
231 | 0 | mozilla::ipc::LogicError("Transition error"); |
232 | 0 | } |
233 | 0 |
|
234 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
235 | 0 | return sendok__; |
236 | 0 | } |
237 | | |
238 | | auto PBackgroundIDBVersionChangeTransactionChild::SendDeleteIndex( |
239 | | const int64_t& objectStoreId, |
240 | | const int64_t& indexId) -> bool |
241 | 0 | { |
242 | 0 | IPC::Message* msg__ = PBackgroundIDBVersionChangeTransaction::Msg_DeleteIndex(Id()); |
243 | 0 |
|
244 | 0 | WriteIPDLParam(msg__, this, objectStoreId); |
245 | 0 | // Sentinel = 'objectStoreId' |
246 | 0 | (msg__)->WriteSentinel(2036303666); |
247 | 0 | WriteIPDLParam(msg__, this, indexId); |
248 | 0 | // Sentinel = 'indexId' |
249 | 0 | (msg__)->WriteSentinel(2324882252); |
250 | 0 |
|
251 | 0 |
|
252 | 0 |
|
253 | 0 |
|
254 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBVersionChangeTransactionChild")) { |
255 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundIDBVersionChangeTransactionChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
256 | 0 | } |
257 | 0 | AUTO_PROFILER_LABEL("PBackgroundIDBVersionChangeTransaction::Msg_DeleteIndex", OTHER); |
258 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
259 | 0 | mozilla::ipc::LogicError("Transition error"); |
260 | 0 | } |
261 | 0 |
|
262 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
263 | 0 | return sendok__; |
264 | 0 | } |
265 | | |
266 | | auto PBackgroundIDBVersionChangeTransactionChild::SendRenameIndex( |
267 | | const int64_t& objectStoreId, |
268 | | const int64_t& indexId, |
269 | | const nsString& name) -> bool |
270 | 0 | { |
271 | 0 | IPC::Message* msg__ = PBackgroundIDBVersionChangeTransaction::Msg_RenameIndex(Id()); |
272 | 0 |
|
273 | 0 | WriteIPDLParam(msg__, this, objectStoreId); |
274 | 0 | // Sentinel = 'objectStoreId' |
275 | 0 | (msg__)->WriteSentinel(2036303666); |
276 | 0 | WriteIPDLParam(msg__, this, indexId); |
277 | 0 | // Sentinel = 'indexId' |
278 | 0 | (msg__)->WriteSentinel(2324882252); |
279 | 0 | WriteIPDLParam(msg__, this, name); |
280 | 0 | // Sentinel = 'name' |
281 | 0 | (msg__)->WriteSentinel(15034981); |
282 | 0 |
|
283 | 0 |
|
284 | 0 |
|
285 | 0 |
|
286 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBVersionChangeTransactionChild")) { |
287 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundIDBVersionChangeTransactionChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
288 | 0 | } |
289 | 0 | AUTO_PROFILER_LABEL("PBackgroundIDBVersionChangeTransaction::Msg_RenameIndex", OTHER); |
290 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
291 | 0 | mozilla::ipc::LogicError("Transition error"); |
292 | 0 | } |
293 | 0 |
|
294 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
295 | 0 | return sendok__; |
296 | 0 | } |
297 | | |
298 | | auto PBackgroundIDBVersionChangeTransactionChild::SendPBackgroundIDBCursorConstructor(const OpenCursorParams& params) -> PBackgroundIDBCursorChild* |
299 | 0 | { |
300 | 0 | return SendPBackgroundIDBCursorConstructor(AllocPBackgroundIDBCursorChild(params), params); |
301 | 0 | } |
302 | | |
303 | | auto PBackgroundIDBVersionChangeTransactionChild::SendPBackgroundIDBCursorConstructor( |
304 | | PBackgroundIDBCursorChild* actor, |
305 | | const OpenCursorParams& params) -> PBackgroundIDBCursorChild* |
306 | 0 | { |
307 | 0 | if ((!(actor))) { |
308 | 0 | NS_WARNING("Error constructing actor PBackgroundIDBCursorChild"); |
309 | 0 | return nullptr; |
310 | 0 | } |
311 | 0 | (actor)->SetManagerAndRegister(this); |
312 | 0 | (mManagedPBackgroundIDBCursorChild).PutEntry(actor); |
313 | 0 | (actor)->mLivenessState = mozilla::ipc::LivenessState::Start; |
314 | 0 |
|
315 | 0 | IPC::Message* msg__ = PBackgroundIDBVersionChangeTransaction::Msg_PBackgroundIDBCursorConstructor(Id()); |
316 | 0 |
|
317 | 0 | MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param"); |
318 | 0 | WriteIPDLParam(msg__, this, actor); |
319 | 0 | // Sentinel = 'actor' |
320 | 0 | (msg__)->WriteSentinel(875202478); |
321 | 0 | WriteIPDLParam(msg__, this, params); |
322 | 0 | // Sentinel = 'params' |
323 | 0 | (msg__)->WriteSentinel(1677790004); |
324 | 0 |
|
325 | 0 |
|
326 | 0 |
|
327 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBVersionChangeTransactionChild")) { |
328 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundIDBVersionChangeTransactionChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
329 | 0 | } |
330 | 0 | AUTO_PROFILER_LABEL("PBackgroundIDBVersionChangeTransaction::Msg_PBackgroundIDBCursorConstructor", OTHER); |
331 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
332 | 0 | mozilla::ipc::LogicError("Transition error"); |
333 | 0 | } |
334 | 0 |
|
335 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
336 | 0 | if ((!(sendok__))) { |
337 | 0 | FatalError("constructor for actor failed"); |
338 | 0 | return nullptr; |
339 | 0 | } |
340 | 0 | return actor; |
341 | 0 | } |
342 | | |
343 | | auto PBackgroundIDBVersionChangeTransactionChild::SendPBackgroundIDBRequestConstructor(const RequestParams& params) -> PBackgroundIDBRequestChild* |
344 | 0 | { |
345 | 0 | return SendPBackgroundIDBRequestConstructor(AllocPBackgroundIDBRequestChild(params), params); |
346 | 0 | } |
347 | | |
348 | | auto PBackgroundIDBVersionChangeTransactionChild::SendPBackgroundIDBRequestConstructor( |
349 | | PBackgroundIDBRequestChild* actor, |
350 | | const RequestParams& params) -> PBackgroundIDBRequestChild* |
351 | 0 | { |
352 | 0 | if ((!(actor))) { |
353 | 0 | NS_WARNING("Error constructing actor PBackgroundIDBRequestChild"); |
354 | 0 | return nullptr; |
355 | 0 | } |
356 | 0 | (actor)->SetManagerAndRegister(this); |
357 | 0 | (mManagedPBackgroundIDBRequestChild).PutEntry(actor); |
358 | 0 | (actor)->mLivenessState = mozilla::ipc::LivenessState::Start; |
359 | 0 |
|
360 | 0 | IPC::Message* msg__ = PBackgroundIDBVersionChangeTransaction::Msg_PBackgroundIDBRequestConstructor(Id()); |
361 | 0 |
|
362 | 0 | MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param"); |
363 | 0 | WriteIPDLParam(msg__, this, actor); |
364 | 0 | // Sentinel = 'actor' |
365 | 0 | (msg__)->WriteSentinel(875202478); |
366 | 0 | WriteIPDLParam(msg__, this, params); |
367 | 0 | // Sentinel = 'params' |
368 | 0 | (msg__)->WriteSentinel(1677790004); |
369 | 0 |
|
370 | 0 |
|
371 | 0 |
|
372 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBVersionChangeTransactionChild")) { |
373 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundIDBVersionChangeTransactionChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending); |
374 | 0 | } |
375 | 0 | AUTO_PROFILER_LABEL("PBackgroundIDBVersionChangeTransaction::Msg_PBackgroundIDBRequestConstructor", OTHER); |
376 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
377 | 0 | mozilla::ipc::LogicError("Transition error"); |
378 | 0 | } |
379 | 0 |
|
380 | 0 | bool sendok__ = (GetIPCChannel())->Send(msg__); |
381 | 0 | if ((!(sendok__))) { |
382 | 0 | FatalError("constructor for actor failed"); |
383 | 0 | return nullptr; |
384 | 0 | } |
385 | 0 | return actor; |
386 | 0 | } |
387 | | |
388 | | auto PBackgroundIDBVersionChangeTransactionChild::RemoveManagee( |
389 | | int32_t aProtocolId, |
390 | | IProtocol* aListener) -> void |
391 | 0 | { |
392 | 0 | switch (aProtocolId) { |
393 | 0 | case PBackgroundIDBCursorMsgStart: |
394 | 0 | { |
395 | 0 | PBackgroundIDBCursorChild* actor = static_cast<PBackgroundIDBCursorChild*>(aListener); |
396 | 0 | auto& container = mManagedPBackgroundIDBCursorChild; |
397 | 0 | MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!"); |
398 | 0 |
|
399 | 0 | (container).RemoveEntry(actor); |
400 | 0 | DeallocPBackgroundIDBCursorChild(actor); |
401 | 0 | return; |
402 | 0 | } |
403 | 0 | case PBackgroundIDBRequestMsgStart: |
404 | 0 | { |
405 | 0 | PBackgroundIDBRequestChild* actor = static_cast<PBackgroundIDBRequestChild*>(aListener); |
406 | 0 | auto& container = mManagedPBackgroundIDBRequestChild; |
407 | 0 | MOZ_RELEASE_ASSERT((container).Contains(actor), "actor not managed by this!"); |
408 | 0 |
|
409 | 0 | (container).RemoveEntry(actor); |
410 | 0 | DeallocPBackgroundIDBRequestChild(actor); |
411 | 0 | return; |
412 | 0 | } |
413 | 0 | default: |
414 | 0 | { |
415 | 0 | FatalError("unreached"); |
416 | 0 | return; |
417 | 0 | } |
418 | 0 | } |
419 | 0 | } |
420 | | |
421 | | auto PBackgroundIDBVersionChangeTransactionChild::OnMessageReceived(const Message& msg__) -> PBackgroundIDBVersionChangeTransactionChild::Result |
422 | 0 | { |
423 | 0 | switch ((msg__).type()) { |
424 | 0 | case PBackgroundIDBVersionChangeTransaction::Reply_PBackgroundIDBCursorConstructor__ID: |
425 | 0 | { |
426 | 0 | return MsgProcessed; |
427 | 0 | } |
428 | 0 | case PBackgroundIDBVersionChangeTransaction::Reply_PBackgroundIDBRequestConstructor__ID: |
429 | 0 | { |
430 | 0 | return MsgProcessed; |
431 | 0 | } |
432 | 0 | case PBackgroundIDBVersionChangeTransaction::Msg___delete____ID: |
433 | 0 | { |
434 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBVersionChangeTransactionChild")) { |
435 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundIDBVersionChangeTransactionChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
436 | 0 | } |
437 | 0 | AUTO_PROFILER_LABEL("PBackgroundIDBVersionChangeTransaction::Msg___delete__", OTHER); |
438 | 0 |
|
439 | 0 | PickleIterator iter__(msg__); |
440 | 0 | PBackgroundIDBVersionChangeTransactionChild* actor; |
441 | 0 |
|
442 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) { |
443 | 0 | FatalError("Error deserializing 'PBackgroundIDBVersionChangeTransactionChild'"); |
444 | 0 | return MsgValueError; |
445 | 0 | } |
446 | 0 | if ((!((*((&(actor))))))) { |
447 | 0 | FatalError("Error deserializing 'PBackgroundIDBVersionChangeTransactionChild'"); |
448 | 0 | return MsgValueError; |
449 | 0 | } |
450 | 0 | // Sentinel = 'actor' |
451 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) { |
452 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'PBackgroundIDBVersionChangeTransactionChild'"); |
453 | 0 | return MsgValueError; |
454 | 0 | } |
455 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
456 | 0 | if ((!(StateTransition(true, (&(mLivenessState)))))) { |
457 | 0 | FatalError("Transition error"); |
458 | 0 | return MsgValueError; |
459 | 0 | } |
460 | 0 | if ((!(Recv__delete__()))) { |
461 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
462 | 0 | // Error handled in mozilla::ipc::IPCResult |
463 | 0 | return MsgProcessingError; |
464 | 0 | } |
465 | 0 | |
466 | 0 | |
467 | 0 | IProtocol* mgr = (actor)->Manager(); |
468 | 0 | (actor)->DestroySubtree(Deletion); |
469 | 0 | (actor)->DeallocSubtree(); |
470 | 0 | (mgr)->RemoveManagee(PBackgroundIDBVersionChangeTransactionMsgStart, actor); |
471 | 0 |
|
472 | 0 | return MsgProcessed; |
473 | 0 | } |
474 | 0 | case PBackgroundIDBVersionChangeTransaction::Msg_Complete__ID: |
475 | 0 | { |
476 | 0 | if (mozilla::ipc::LoggingEnabledFor("PBackgroundIDBVersionChangeTransactionChild")) { |
477 | 0 | mozilla::ipc::LogMessageForProtocol("PBackgroundIDBVersionChangeTransactionChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving); |
478 | 0 | } |
479 | 0 | AUTO_PROFILER_LABEL("PBackgroundIDBVersionChangeTransaction::Msg_Complete", OTHER); |
480 | 0 |
|
481 | 0 | PickleIterator iter__(msg__); |
482 | 0 | nsresult result; |
483 | 0 |
|
484 | 0 | if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(result)))))) { |
485 | 0 | FatalError("Error deserializing 'nsresult'"); |
486 | 0 | return MsgValueError; |
487 | 0 | } |
488 | 0 | // Sentinel = 'result' |
489 | 0 | if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3991766165)))) { |
490 | 0 | mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'"); |
491 | 0 | return MsgValueError; |
492 | 0 | } |
493 | 0 | (msg__).EndRead(iter__, (msg__).type()); |
494 | 0 | if ((!(StateTransition(false, (&(mLivenessState)))))) { |
495 | 0 | FatalError("Transition error"); |
496 | 0 | return MsgValueError; |
497 | 0 | } |
498 | 0 | if ((!(RecvComplete(result)))) { |
499 | 0 | mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!"); |
500 | 0 | // Error handled in mozilla::ipc::IPCResult |
501 | 0 | return MsgProcessingError; |
502 | 0 | } |
503 | 0 | |
504 | 0 | return MsgProcessed; |
505 | 0 | } |
506 | 0 | default: |
507 | 0 | { |
508 | 0 | return MsgNotKnown; |
509 | 0 | } |
510 | 0 | } |
511 | 0 | } |
512 | | |
513 | | auto PBackgroundIDBVersionChangeTransactionChild::OnMessageReceived( |
514 | | const Message& msg__, |
515 | | Message*& reply__) -> PBackgroundIDBVersionChangeTransactionChild::Result |
516 | 0 | { |
517 | 0 | return MsgNotKnown; |
518 | 0 | } |
519 | | |
520 | | auto PBackgroundIDBVersionChangeTransactionChild::OnCallReceived( |
521 | | const Message& msg__, |
522 | | Message*& reply__) -> PBackgroundIDBVersionChangeTransactionChild::Result |
523 | 0 | { |
524 | 0 | MOZ_ASSERT_UNREACHABLE("message protocol not supported"); |
525 | 0 | return MsgNotKnown; |
526 | 0 | } |
527 | | |
528 | | auto PBackgroundIDBVersionChangeTransactionChild::GetProtocolTypeId() -> int32_t |
529 | 0 | { |
530 | 0 | return PBackgroundIDBVersionChangeTransactionMsgStart; |
531 | 0 | } |
532 | | |
533 | | auto PBackgroundIDBVersionChangeTransactionChild::DestroySubtree(ActorDestroyReason why) -> void |
534 | 0 | { |
535 | 0 | // Unregister from our manager. |
536 | 0 | Unregister(Id()); |
537 | 0 |
|
538 | 0 | ActorDestroyReason subtreewhy = (((why) == (Deletion)) || ((why) == (FailedConstructor)) ? AncestorDeletion : why); |
539 | 0 |
|
540 | 0 | { |
541 | 0 | // Recursively shutting down PBackgroundIDBCursor kids |
542 | 0 | nsTArray<PBackgroundIDBCursorChild*> kids; |
543 | 0 | // Accumulate kids into a stable structure to iterate over |
544 | 0 | ManagedPBackgroundIDBCursorChild(kids); |
545 | 0 | for (auto& kid : kids) { |
546 | 0 | // Guarding against a child removing a sibling from the list during the iteration. |
547 | 0 | if ((mManagedPBackgroundIDBCursorChild).Contains(kid)) { |
548 | 0 | (kid)->DestroySubtree(subtreewhy); |
549 | 0 | } |
550 | 0 | } |
551 | 0 | } |
552 | 0 | { |
553 | 0 | // Recursively shutting down PBackgroundIDBRequest kids |
554 | 0 | nsTArray<PBackgroundIDBRequestChild*> kids; |
555 | 0 | // Accumulate kids into a stable structure to iterate over |
556 | 0 | ManagedPBackgroundIDBRequestChild(kids); |
557 | 0 | for (auto& kid : kids) { |
558 | 0 | // Guarding against a child removing a sibling from the list during the iteration. |
559 | 0 | if ((mManagedPBackgroundIDBRequestChild).Contains(kid)) { |
560 | 0 | (kid)->DestroySubtree(subtreewhy); |
561 | 0 | } |
562 | 0 | } |
563 | 0 | } |
564 | 0 |
|
565 | 0 | // Reject owning pending responses. |
566 | 0 | (GetIPCChannel())->RejectPendingResponsesForActor(this); |
567 | 0 |
|
568 | 0 | // Finally, destroy "us". |
569 | 0 | ActorDestroy(why); |
570 | 0 | } |
571 | | |
572 | | auto PBackgroundIDBVersionChangeTransactionChild::DeallocSubtree() -> void |
573 | 0 | { |
574 | 0 | { |
575 | 0 | // Recursively deleting PBackgroundIDBCursor kids |
576 | 0 | for (auto iter = (mManagedPBackgroundIDBCursorChild).Iter(); (!((iter).Done())); (iter).Next()) { |
577 | 0 | (((iter).Get())->GetKey())->DeallocSubtree(); |
578 | 0 | } |
579 | 0 |
|
580 | 0 | for (auto iter = (mManagedPBackgroundIDBCursorChild).Iter(); (!((iter).Done())); (iter).Next()) { |
581 | 0 | DeallocPBackgroundIDBCursorChild(((iter).Get())->GetKey()); |
582 | 0 | } |
583 | 0 | (mManagedPBackgroundIDBCursorChild).Clear(); |
584 | 0 | } |
585 | 0 | { |
586 | 0 | // Recursively deleting PBackgroundIDBRequest kids |
587 | 0 | for (auto iter = (mManagedPBackgroundIDBRequestChild).Iter(); (!((iter).Done())); (iter).Next()) { |
588 | 0 | (((iter).Get())->GetKey())->DeallocSubtree(); |
589 | 0 | } |
590 | 0 |
|
591 | 0 | for (auto iter = (mManagedPBackgroundIDBRequestChild).Iter(); (!((iter).Done())); (iter).Next()) { |
592 | 0 | DeallocPBackgroundIDBRequestChild(((iter).Get())->GetKey()); |
593 | 0 | } |
594 | 0 | (mManagedPBackgroundIDBRequestChild).Clear(); |
595 | 0 | } |
596 | 0 | } |
597 | | |
598 | | |
599 | | |
600 | | } // namespace indexedDB |
601 | | } // namespace dom |
602 | | } // namespace mozilla |
603 | | namespace mozilla { |
604 | | namespace ipc { |
605 | | auto IPDLParamTraits<mozilla::dom::indexedDB::PBackgroundIDBVersionChangeTransactionChild>::Write( |
606 | | IPC::Message* aMsg, |
607 | | mozilla::ipc::IProtocol* aActor, |
608 | | const paramType& aVar) -> void |
609 | 0 | { |
610 | 0 | int32_t id; |
611 | 0 | if ((!(aVar))) { |
612 | 0 | id = 0; |
613 | 0 | } |
614 | 0 | else { |
615 | 0 | id = (aVar)->Id(); |
616 | 0 | if ((1) == (id)) { |
617 | 0 | (aActor)->FatalError("actor has been |delete|d"); |
618 | 0 | } |
619 | 0 | } |
620 | 0 | WriteIPDLParam(aMsg, aActor, id); |
621 | 0 | } |
622 | | |
623 | | auto IPDLParamTraits<mozilla::dom::indexedDB::PBackgroundIDBVersionChangeTransactionChild>::Read( |
624 | | const IPC::Message* aMsg, |
625 | | PickleIterator* aIter, |
626 | | mozilla::ipc::IProtocol* aActor, |
627 | | paramType* aVar) -> bool |
628 | 0 | { |
629 | 0 | mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PBackgroundIDBVersionChangeTransaction", PBackgroundIDBVersionChangeTransactionMsgStart); |
630 | 0 | if ((actor).isNothing()) { |
631 | 0 | return false; |
632 | 0 | } |
633 | 0 | |
634 | 0 | (*(aVar)) = static_cast<mozilla::dom::indexedDB::PBackgroundIDBVersionChangeTransactionChild*>((actor).value()); |
635 | 0 | return true; |
636 | 0 | } |
637 | | |
638 | | } // namespace ipc |
639 | | } // namespace mozilla |