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