Backed out 22 changesets (bug 1839396) for causing build bustages on js/Printer.h...
[gecko.git] / dom / indexedDB / PBackgroundIDBSharedTypes.ipdlh
blob3b05250e9425d040d5cb8c5968df7b02ceaee781
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;
7 include DOMTypes;
8 include IPCBlob;
9 include ProtocolTypes;
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";
36 namespace mozilla {
37 namespace dom {
38 namespace indexedDB {
40 struct SerializedKeyRange
42   Key lower;
43   Key upper;
44   bool lowerOpen;
45   bool upperOpen;
46   bool isOnly;
49 union NullableBlob
51   null_t;
52   IPCBlob;
55 struct SerializedStructuredCloneFile
57   NullableBlob file;
58   FileType type;
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
76   int64_t indexId;
77   Key value;
78   Key localizedValue;
81 struct DatabaseMetadata
83   nsString name;
84   uint64_t version;
85   PersistenceType persistenceType;
88 struct ObjectStoreMetadata
90   int64_t id;
91   nsString name;
92   KeyPath keyPath;
93   bool autoIncrement;
96 struct IndexMetadata
98   int64_t id;
99   nsString name;
100   KeyPath keyPath;
101   nsCString locale;
102   bool unique;
103   bool multiEntry;
104   bool autoLocale;
107 struct DatabaseSpec
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;
123   Direction direction;
126 struct ObjectStoreOpenCursorParams
128   CommonOpenCursorParams commonParams;
131 struct ObjectStoreOpenKeyCursorParams
133   CommonOpenCursorParams commonParams;
136 struct CommonIndexOpenCursorParams
138   CommonOpenCursorParams commonParams;
139   int64_t indexId;
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;
164 struct FileAddInfo
166   PBackgroundIDBDatabaseFile file;
167   FileType type;
170 struct ObjectStoreAddPutParams
172   int64_t objectStoreId;
173   SerializedStructuredCloneWriteInfo cloneInfo;
174   Key key;
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;
205   uint32_t limit;
208 struct ObjectStoreGetAllKeysParams
210   int64_t objectStoreId;
211   SerializedKeyRange? optionalKeyRange;
212   uint32_t limit;
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;
235   int64_t indexId;
236   SerializedKeyRange keyRange;
239 struct IndexGetKeyParams
241   int64_t objectStoreId;
242   int64_t indexId;
243   SerializedKeyRange keyRange;
246 struct IndexGetAllParams
248   int64_t objectStoreId;
249   int64_t indexId;
250   SerializedKeyRange? optionalKeyRange;
251   uint32_t limit;
254 struct IndexGetAllKeysParams
256   int64_t objectStoreId;
257   int64_t indexId;
258   SerializedKeyRange? optionalKeyRange;
259   uint32_t limit;
262 struct IndexCountParams
264   int64_t objectStoreId;
265   int64_t indexId;
266   SerializedKeyRange? optionalKeyRange;
269 union RequestParams
271   ObjectStoreAddParams;
272   ObjectStorePutParams;
273   ObjectStoreGetParams;
274   ObjectStoreGetKeyParams;
275   ObjectStoreGetAllParams;
276   ObjectStoreGetAllKeysParams;
277   ObjectStoreDeleteParams;
278   ObjectStoreClearParams;
279   ObjectStoreCountParams;
280   IndexGetParams;
281   IndexGetKeyParams;
282   IndexGetAllParams;
283   IndexGetAllKeysParams;
284   IndexCountParams;
287 struct LoggingInfo
289   nsID backgroundChildLoggingId;
290   int64_t nextTransactionSerialNumber;
291   int64_t nextVersionChangeTransactionSerialNumber;
292   uint64_t nextRequestSerialNumber;
295 } // namespace indexedDB
296 } // namespace dom
297 } // namespace mozilla