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";
22 struct ObjectStoreAddResponse
27 struct ObjectStorePutResponse
32 struct ObjectStoreGetResponse
34 SerializedStructuredCloneReadInfo cloneInfo;
37 struct ObjectStoreGetKeyResponse
42 struct ObjectStoreGetAllResponse
44 SerializedStructuredCloneReadInfo[] cloneInfos;
47 struct ObjectStoreGetAllKeysResponse
52 struct ObjectStoreDeleteResponse
55 struct ObjectStoreClearResponse
58 struct ObjectStoreCountResponse
63 struct IndexGetResponse
65 SerializedStructuredCloneReadInfo cloneInfo;
68 struct IndexGetKeyResponse
73 struct IndexGetAllResponse
75 SerializedStructuredCloneReadInfo[] cloneInfos;
78 struct IndexGetAllKeysResponse
83 struct IndexCountResponse
91 ObjectStoreGetResponse;
92 ObjectStoreGetKeyResponse;
93 ObjectStoreAddResponse;
94 ObjectStorePutResponse;
95 ObjectStoreDeleteResponse;
96 ObjectStoreClearResponse;
97 ObjectStoreCountResponse;
98 ObjectStoreGetAllResponse;
99 ObjectStoreGetAllKeysResponse;
103 IndexGetAllKeysResponse;
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
141 ObjectStoreGetPreprocessResponse;
142 ObjectStoreGetAllPreprocessResponse;
145 [ManualDealloc, ChildImpl="indexedDB::BackgroundRequestChild", ParentImpl=virtual]
146 protocol PBackgroundIDBRequest
148 manager PBackgroundIDBTransaction or PBackgroundIDBVersionChangeTransaction;
151 async Continue(PreprocessResponse response);
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
168 } // namespace mozilla