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 PBackgroundIDBDatabaseFile;
11 include "mozilla/dom/indexedDB/SerializationHelpers.h";
12 include "mozilla/dom/quota/SerializationHelpers.h";
14 using struct mozilla::null_t from "mozilla/ipc/IPCCore.h";
16 using struct mozilla::void_t from "mozilla/ipc/IPCCore.h";
18 using mozilla::dom::IDBCursor::Direction
19 from "mozilla/dom/IDBCursor.h";
21 using mozilla::dom::indexedDB::StructuredCloneFileBase::FileType
22 from "mozilla/dom/IndexedDatabase.h";
24 using class mozilla::dom::indexedDB::Key
25 from "mozilla/dom/indexedDB/Key.h";
27 using class mozilla::dom::indexedDB::KeyPath
28 from "mozilla/dom/indexedDB/KeyPath.h";
30 using mozilla::dom::quota::PersistenceType
31 from "mozilla/dom/quota/PersistenceType.h";
33 [MoveOnly=data] using mozilla::SerializedStructuredCloneBuffer
34 from "mozilla/ipc/SerializedStructuredCloneBuffer.h";
40 struct SerializedKeyRange
55 struct SerializedStructuredCloneFile
61 struct SerializedStructuredCloneReadInfo
63 SerializedStructuredCloneBuffer data;
64 SerializedStructuredCloneFile[] files;
65 bool hasPreprocessInfo;
68 struct SerializedStructuredCloneWriteInfo
70 SerializedStructuredCloneBuffer data;
71 uint64_t offsetToKeyProp;
74 struct IndexUpdateInfo
81 struct DatabaseMetadata
85 PersistenceType persistenceType;
88 struct ObjectStoreMetadata
109 DatabaseMetadata metadata;
110 ObjectStoreSpec[] objectStores;
113 struct ObjectStoreSpec
115 ObjectStoreMetadata metadata;
116 IndexMetadata[] indexes;
119 struct CommonOpenCursorParams
121 int64_t objectStoreId;
122 SerializedKeyRange? optionalKeyRange;
126 struct ObjectStoreOpenCursorParams
128 CommonOpenCursorParams commonParams;
131 struct ObjectStoreOpenKeyCursorParams
133 CommonOpenCursorParams commonParams;
136 struct CommonIndexOpenCursorParams
138 CommonOpenCursorParams commonParams;
142 struct IndexOpenCursorParams
144 CommonIndexOpenCursorParams commonIndexParams;
147 struct IndexOpenKeyCursorParams
149 CommonIndexOpenCursorParams commonIndexParams;
152 // TODO: Actually, using a union here is not very nice, unless IPDL supported
153 // struct inheritance. Alternatively, if IPDL supported enums, we could merge
154 // the subtypes into one. Using a plain integer for discriminating the
155 // subtypes would be too error-prone.
156 union OpenCursorParams
158 ObjectStoreOpenCursorParams;
159 ObjectStoreOpenKeyCursorParams;
160 IndexOpenCursorParams;
161 IndexOpenKeyCursorParams;
166 PBackgroundIDBDatabaseFile file;
170 struct ObjectStoreAddPutParams
172 int64_t objectStoreId;
173 SerializedStructuredCloneWriteInfo cloneInfo;
175 IndexUpdateInfo[] indexUpdateInfos;
176 FileAddInfo[] fileAddInfos;
179 struct ObjectStoreAddParams
181 ObjectStoreAddPutParams commonParams;
184 struct ObjectStorePutParams
186 ObjectStoreAddPutParams commonParams;
189 struct ObjectStoreGetParams
191 int64_t objectStoreId;
192 SerializedKeyRange keyRange;
195 struct ObjectStoreGetKeyParams
197 int64_t objectStoreId;
198 SerializedKeyRange keyRange;
201 struct ObjectStoreGetAllParams
203 int64_t objectStoreId;
204 SerializedKeyRange? optionalKeyRange;
208 struct ObjectStoreGetAllKeysParams
210 int64_t objectStoreId;
211 SerializedKeyRange? optionalKeyRange;
215 struct ObjectStoreDeleteParams
217 int64_t objectStoreId;
218 SerializedKeyRange keyRange;
221 struct ObjectStoreClearParams
223 int64_t objectStoreId;
226 struct ObjectStoreCountParams
228 int64_t objectStoreId;
229 SerializedKeyRange? optionalKeyRange;
232 struct IndexGetParams
234 int64_t objectStoreId;
236 SerializedKeyRange keyRange;
239 struct IndexGetKeyParams
241 int64_t objectStoreId;
243 SerializedKeyRange keyRange;
246 struct IndexGetAllParams
248 int64_t objectStoreId;
250 SerializedKeyRange? optionalKeyRange;
254 struct IndexGetAllKeysParams
256 int64_t objectStoreId;
258 SerializedKeyRange? optionalKeyRange;
262 struct IndexCountParams
264 int64_t objectStoreId;
266 SerializedKeyRange? optionalKeyRange;
271 ObjectStoreAddParams;
272 ObjectStorePutParams;
273 ObjectStoreGetParams;
274 ObjectStoreGetKeyParams;
275 ObjectStoreGetAllParams;
276 ObjectStoreGetAllKeysParams;
277 ObjectStoreDeleteParams;
278 ObjectStoreClearParams;
279 ObjectStoreCountParams;
283 IndexGetAllKeysParams;
289 nsID backgroundChildLoggingId;
290 int64_t nextTransactionSerialNumber;
291 int64_t nextVersionChangeTransactionSerialNumber;
292 uint64_t nextRequestSerialNumber;
295 } // namespace indexedDB
297 } // namespace mozilla