Bug 1572460 - Refactor `selection` out of the `InspectorFront`. r=yulia
[gecko.git] / dom / indexedDB / PBackgroundIDBRequest.ipdl
bloba98ac194235c6bc1d1b389b35ed632a4aa840c1d
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;
7 include protocol PBackgroundMutableFile;
8 include protocol PChildToParentStream; // FIXME: bug 792908
9 include protocol PFileDescriptorSet; // FIXME: bug 792908
10 include protocol PIPCBlobInputStream; // FIXME: bug 792908
11 include protocol PParentToChildStream; // FIXME: bug 792908
13 include PBackgroundIDBSharedTypes;
15 include "mozilla/dom/indexedDB/SerializationHelpers.h";
17 using struct mozilla::void_t
18   from "ipc/IPCMessageUtils.h";
20 using class mozilla::dom::indexedDB::Key
21   from "mozilla/dom/indexedDB/Key.h";
23 namespace mozilla {
24 namespace dom {
25 namespace indexedDB {
27 struct ObjectStoreAddResponse
29   Key key;
32 struct ObjectStorePutResponse
34   Key key;
37 struct ObjectStoreGetResponse
39   SerializedStructuredCloneReadInfo cloneInfo;
42 struct ObjectStoreGetKeyResponse
44   Key key;
47 struct ObjectStoreGetAllResponse
49   SerializedStructuredCloneReadInfo[] cloneInfos;
52 struct ObjectStoreGetAllKeysResponse
54   Key[] keys;
57 struct ObjectStoreDeleteResponse
58 { };
60 struct ObjectStoreClearResponse
61 { };
63 struct ObjectStoreCountResponse
65   uint64_t count;
68 struct IndexGetResponse
70   SerializedStructuredCloneReadInfo cloneInfo;
73 struct IndexGetKeyResponse
75   Key key;
78 struct IndexGetAllResponse
80   SerializedStructuredCloneReadInfo[] cloneInfos;
83 struct IndexGetAllKeysResponse
85   Key[] keys;
88 struct IndexCountResponse
90   uint64_t count;
93 union RequestResponse
95   nsresult;
96   ObjectStoreGetResponse;
97   ObjectStoreGetKeyResponse;
98   ObjectStoreAddResponse;
99   ObjectStorePutResponse;
100   ObjectStoreDeleteResponse;
101   ObjectStoreClearResponse;
102   ObjectStoreCountResponse;
103   ObjectStoreGetAllResponse;
104   ObjectStoreGetAllKeysResponse;
105   IndexGetResponse;
106   IndexGetKeyResponse;
107   IndexGetAllResponse;
108   IndexGetAllKeysResponse;
109   IndexCountResponse;
112 struct PreprocessInfo
114   SerializedStructuredCloneFile[] files;
117 struct ObjectStoreGetPreprocessParams
119   PreprocessInfo preprocessInfo;
122 struct ObjectStoreGetAllPreprocessParams
124   PreprocessInfo[] preprocessInfos;
127 union PreprocessParams
129   ObjectStoreGetPreprocessParams;
130   ObjectStoreGetAllPreprocessParams;
133 struct ObjectStoreGetPreprocessResponse
137 struct ObjectStoreGetAllPreprocessResponse
141 // The nsresult is used if an error occurs for any preprocess request type.
142 // The specific response types are sent on success.
143 union PreprocessResponse
145   nsresult;
146   ObjectStoreGetPreprocessResponse;
147   ObjectStoreGetAllPreprocessResponse;
150 protocol PBackgroundIDBRequest
152   manager PBackgroundIDBTransaction or PBackgroundIDBVersionChangeTransaction;
154 parent:
155   async Continue(PreprocessResponse response);
157 child:
158   async __delete__(RequestResponse response);
160   // Preprocess is used in cases where response processing needs to do something
161   // asynchronous off of the child actor's thread before returning the actual
162   // result to user code. This is necessary because RequestResponse processing
163   // occurs in __delete__ and the PBackgroundIDBRequest implementations'
164   // life-cycles are controlled by IPC and are not otherwise reference counted.
165   // By introducing the (optional) Preprocess/Continue steps reference counting
166   // or the introduction of additional runnables are avoided.
167   async Preprocess(PreprocessParams params);
170 } // namespace indexedDB
171 } // namespace dom
172 } // namespace mozilla