Bug 1842773 - Part 5: Add ArrayBuffer.prototype.{maxByteLength,resizable} getters...
[gecko.git] / dom / indexedDB / PBackgroundIDBRequest.ipdl
blob293f65a59872e7d9fb9ce7fa040120eb004b72d8
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3  * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 include protocol PBackgroundIDBTransaction;
6 include protocol PBackgroundIDBVersionChangeTransaction;
8 include PBackgroundIDBSharedTypes;
10 include "mozilla/dom/indexedDB/SerializationHelpers.h";
11 include "mozilla/dom/indexedDB/ActorsChild.h";
13 using struct mozilla::void_t from "mozilla/ipc/IPCCore.h";
15 using class mozilla::dom::indexedDB::Key
16   from "mozilla/dom/indexedDB/Key.h";
18 namespace mozilla {
19 namespace dom {
20 namespace indexedDB {
22 struct ObjectStoreAddResponse
24   Key key;
27 struct ObjectStorePutResponse
29   Key key;
32 struct ObjectStoreGetResponse
34   SerializedStructuredCloneReadInfo cloneInfo;
37 struct ObjectStoreGetKeyResponse
39   Key key;
42 struct ObjectStoreGetAllResponse
44   SerializedStructuredCloneReadInfo[] cloneInfos;
47 struct ObjectStoreGetAllKeysResponse
49   Key[] keys;
52 struct ObjectStoreDeleteResponse
53 { };
55 struct ObjectStoreClearResponse
56 { };
58 struct ObjectStoreCountResponse
60   uint64_t count;
63 struct IndexGetResponse
65   SerializedStructuredCloneReadInfo cloneInfo;
68 struct IndexGetKeyResponse
70   Key key;
73 struct IndexGetAllResponse
75   SerializedStructuredCloneReadInfo[] cloneInfos;
78 struct IndexGetAllKeysResponse
80   Key[] keys;
83 struct IndexCountResponse
85   uint64_t count;
88 union RequestResponse
90   nsresult;
91   ObjectStoreGetResponse;
92   ObjectStoreGetKeyResponse;
93   ObjectStoreAddResponse;
94   ObjectStorePutResponse;
95   ObjectStoreDeleteResponse;
96   ObjectStoreClearResponse;
97   ObjectStoreCountResponse;
98   ObjectStoreGetAllResponse;
99   ObjectStoreGetAllKeysResponse;
100   IndexGetResponse;
101   IndexGetKeyResponse;
102   IndexGetAllResponse;
103   IndexGetAllKeysResponse;
104   IndexCountResponse;
107 struct PreprocessInfo
109   SerializedStructuredCloneFile[] files;
112 struct ObjectStoreGetPreprocessParams
114   PreprocessInfo preprocessInfo;
117 struct ObjectStoreGetAllPreprocessParams
119   PreprocessInfo[] preprocessInfos;
122 union PreprocessParams
124   ObjectStoreGetPreprocessParams;
125   ObjectStoreGetAllPreprocessParams;
128 struct ObjectStoreGetPreprocessResponse
132 struct ObjectStoreGetAllPreprocessResponse
136 // The nsresult is used if an error occurs for any preprocess request type.
137 // The specific response types are sent on success.
138 union PreprocessResponse
140   nsresult;
141   ObjectStoreGetPreprocessResponse;
142   ObjectStoreGetAllPreprocessResponse;
145 [ManualDealloc, ChildImpl="indexedDB::BackgroundRequestChild", ParentImpl=virtual]
146 protocol PBackgroundIDBRequest
148   manager PBackgroundIDBTransaction or PBackgroundIDBVersionChangeTransaction;
150 parent:
151   async Continue(PreprocessResponse response);
153 child:
154   async __delete__(RequestResponse response);
156   // Preprocess is used in cases where response processing needs to do something
157   // asynchronous off of the child actor's thread before returning the actual
158   // result to user code. This is necessary because RequestResponse processing
159   // occurs in __delete__ and the PBackgroundIDBRequest implementations'
160   // life-cycles are controlled by IPC and are not otherwise reference counted.
161   // By introducing the (optional) Preprocess/Continue steps reference counting
162   // or the introduction of additional runnables are avoided.
163   async Preprocess(PreprocessParams params);
166 } // namespace indexedDB
167 } // namespace dom
168 } // namespace mozilla