Bug 1472338: part 2) Change `clipboard.readText()` to read from the clipboard asynchr...
[gecko.git] / dom / indexedDB / PBackgroundIDBSharedTypes.ipdlh
blob371bf58248cdb09328ebe408758ad58664b0de75
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;
6 include protocol PBackgroundMutableFile;
7 include protocol PChildToParentStream; // FIXME: bug 792908
8 include protocol PFileDescriptorSet; // FIXME: bug 792908
9 include protocol PParentToChildStream; // FIXME: bug 792908
10 include protocol PRemoteLazyInputStream; // FIXME: bug 792908
12 include DOMTypes;
13 include IPCBlob;
14 include ProtocolTypes;
16 include "mozilla/dom/indexedDB/SerializationHelpers.h";
17 include "mozilla/dom/quota/SerializationHelpers.h";
19 using struct mozilla::null_t from "mozilla/ipc/IPCCore.h";
21 using struct mozilla::void_t from "mozilla/ipc/IPCCore.h";
23 using mozilla::dom::IDBCursor::Direction
24   from "mozilla/dom/IDBCursor.h";
26 using mozilla::dom::indexedDB::StructuredCloneFileBase::FileType
27   from "mozilla/dom/IndexedDatabase.h";
29 using class mozilla::dom::indexedDB::Key
30   from "mozilla/dom/indexedDB/Key.h";
32 using class mozilla::dom::indexedDB::KeyPath
33   from "mozilla/dom/indexedDB/KeyPath.h";
35 using mozilla::dom::quota::PersistenceType
36   from "mozilla/dom/quota/PersistenceType.h";
38 [MoveOnly=data] using mozilla::SerializedStructuredCloneBuffer
39   from "mozilla/ipc/SerializedStructuredCloneBuffer.h";
41 namespace mozilla {
42 namespace dom {
43 namespace indexedDB {
45 struct SerializedKeyRange
47   Key lower;
48   Key upper;
49   bool lowerOpen;
50   bool upperOpen;
51   bool isOnly;
54 union BlobOrMutableFile
56   null_t;
57   IPCBlob;
58   PBackgroundMutableFile;
61 struct SerializedStructuredCloneFile
63   BlobOrMutableFile file;
64   FileType type;
67 struct SerializedStructuredCloneReadInfo
69   SerializedStructuredCloneBuffer data;
70   SerializedStructuredCloneFile[] files;
71   bool hasPreprocessInfo;
74 struct SerializedStructuredCloneWriteInfo
76   SerializedStructuredCloneBuffer data;
77   uint64_t offsetToKeyProp;
80 struct IndexUpdateInfo
82   int64_t indexId;
83   Key value;
84   Key localizedValue;
87 struct DatabaseMetadata
89   nsString name;
90   uint64_t version;
91   PersistenceType persistenceType;
94 struct ObjectStoreMetadata
96   int64_t id;
97   nsString name;
98   KeyPath keyPath;
99   bool autoIncrement;
102 struct IndexMetadata
104   int64_t id;
105   nsString name;
106   KeyPath keyPath;
107   nsCString locale;
108   bool unique;
109   bool multiEntry;
110   bool autoLocale;
113 struct DatabaseSpec
115   DatabaseMetadata metadata;
116   ObjectStoreSpec[] objectStores;
119 struct ObjectStoreSpec
121   ObjectStoreMetadata metadata;
122   IndexMetadata[] indexes;
125 struct CommonOpenCursorParams
127   int64_t objectStoreId;
128   SerializedKeyRange? optionalKeyRange;
129   Direction direction;
132 struct ObjectStoreOpenCursorParams
134   CommonOpenCursorParams commonParams;
137 struct ObjectStoreOpenKeyCursorParams
139   CommonOpenCursorParams commonParams;
142 struct CommonIndexOpenCursorParams
144   CommonOpenCursorParams commonParams;
145   int64_t indexId;
148 struct IndexOpenCursorParams
150   CommonIndexOpenCursorParams commonIndexParams;
153 struct IndexOpenKeyCursorParams
155   CommonIndexOpenCursorParams commonIndexParams;
158 // TODO: Actually, using a union here is not very nice, unless IPDL supported
159 // struct inheritance. Alternatively, if IPDL supported enums, we could merge
160 // the subtypes into one. Using a plain integer for discriminating the
161 // subtypes would be too error-prone.
162 union OpenCursorParams
164   ObjectStoreOpenCursorParams;
165   ObjectStoreOpenKeyCursorParams;
166   IndexOpenCursorParams;
167   IndexOpenKeyCursorParams;
170 union DatabaseOrMutableFile
172   PBackgroundIDBDatabaseFile;
173   PBackgroundMutableFile;
176 struct FileAddInfo
178   DatabaseOrMutableFile file;
179   FileType type;
182 struct ObjectStoreAddPutParams
184   int64_t objectStoreId;
185   SerializedStructuredCloneWriteInfo cloneInfo;
186   Key key;
187   IndexUpdateInfo[] indexUpdateInfos;
188   FileAddInfo[] fileAddInfos;
191 struct ObjectStoreAddParams
193   ObjectStoreAddPutParams commonParams;
196 struct ObjectStorePutParams
198   ObjectStoreAddPutParams commonParams;
201 struct ObjectStoreGetParams
203   int64_t objectStoreId;
204   SerializedKeyRange keyRange;
207 struct ObjectStoreGetKeyParams
209   int64_t objectStoreId;
210   SerializedKeyRange keyRange;
213 struct ObjectStoreGetAllParams
215   int64_t objectStoreId;
216   SerializedKeyRange? optionalKeyRange;
217   uint32_t limit;
220 struct ObjectStoreGetAllKeysParams
222   int64_t objectStoreId;
223   SerializedKeyRange? optionalKeyRange;
224   uint32_t limit;
227 struct ObjectStoreDeleteParams
229   int64_t objectStoreId;
230   SerializedKeyRange keyRange;
233 struct ObjectStoreClearParams
235   int64_t objectStoreId;
238 struct ObjectStoreCountParams
240   int64_t objectStoreId;
241   SerializedKeyRange? optionalKeyRange;
244 struct IndexGetParams
246   int64_t objectStoreId;
247   int64_t indexId;
248   SerializedKeyRange keyRange;
251 struct IndexGetKeyParams
253   int64_t objectStoreId;
254   int64_t indexId;
255   SerializedKeyRange keyRange;
258 struct IndexGetAllParams
260   int64_t objectStoreId;
261   int64_t indexId;
262   SerializedKeyRange? optionalKeyRange;
263   uint32_t limit;
266 struct IndexGetAllKeysParams
268   int64_t objectStoreId;
269   int64_t indexId;
270   SerializedKeyRange? optionalKeyRange;
271   uint32_t limit;
274 struct IndexCountParams
276   int64_t objectStoreId;
277   int64_t indexId;
278   SerializedKeyRange? optionalKeyRange;
281 union RequestParams
283   ObjectStoreAddParams;
284   ObjectStorePutParams;
285   ObjectStoreGetParams;
286   ObjectStoreGetKeyParams;
287   ObjectStoreGetAllParams;
288   ObjectStoreGetAllKeysParams;
289   ObjectStoreDeleteParams;
290   ObjectStoreClearParams;
291   ObjectStoreCountParams;
292   IndexGetParams;
293   IndexGetKeyParams;
294   IndexGetAllParams;
295   IndexGetAllKeysParams;
296   IndexCountParams;
299 struct LoggingInfo
301   nsID backgroundChildLoggingId;
302   int64_t nextTransactionSerialNumber;
303   int64_t nextVersionChangeTransactionSerialNumber;
304   uint64_t nextRequestSerialNumber;
307 } // namespace indexedDB
308 } // namespace dom
309 } // namespace mozilla