2014-09-27 03:21:57 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
include protocol PBackgroundIDBDatabaseFile;
|
2015-09-09 14:15:05 +03:00
|
|
|
include protocol PBackgroundMutableFile;
|
|
|
|
include protocol PBlob;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2014-10-16 08:56:52 +04:00
|
|
|
include DOMTypes;
|
2016-05-18 01:01:25 +03:00
|
|
|
include ProtocolTypes;
|
2014-10-16 08:56:52 +04:00
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
include "mozilla/dom/indexedDB/SerializationHelpers.h";
|
2015-11-22 12:43:34 +03:00
|
|
|
include "mozilla/dom/quota/SerializationHelpers.h";
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2015-09-09 14:15:05 +03:00
|
|
|
using struct mozilla::null_t
|
|
|
|
from "ipc/IPCMessageUtils.h";
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
using struct mozilla::void_t
|
|
|
|
from "ipc/IPCMessageUtils.h";
|
|
|
|
|
2016-02-17 00:46:08 +03:00
|
|
|
using mozilla::dom::IDBCursor::Direction
|
|
|
|
from "mozilla/dom/IDBCursor.h";
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
using class mozilla::dom::indexedDB::Key
|
|
|
|
from "mozilla/dom/indexedDB/Key.h";
|
|
|
|
|
|
|
|
using class mozilla::dom::indexedDB::KeyPath
|
|
|
|
from "mozilla/dom/indexedDB/KeyPath.h";
|
|
|
|
|
|
|
|
using mozilla::dom::quota::PersistenceType
|
|
|
|
from "mozilla/dom/quota/PersistenceType.h";
|
|
|
|
|
2016-06-07 11:49:43 +03:00
|
|
|
using mozilla::SerializedStructuredCloneBuffer
|
|
|
|
from "ipc/IPCMessageUtils.h";
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
namespace indexedDB {
|
|
|
|
|
|
|
|
struct SerializedKeyRange
|
|
|
|
{
|
|
|
|
Key lower;
|
|
|
|
Key upper;
|
|
|
|
bool lowerOpen;
|
|
|
|
bool upperOpen;
|
|
|
|
bool isOnly;
|
|
|
|
};
|
|
|
|
|
2015-09-09 14:15:05 +03:00
|
|
|
union NullableMutableFile
|
|
|
|
{
|
|
|
|
null_t;
|
|
|
|
PBackgroundMutableFile;
|
|
|
|
};
|
|
|
|
|
|
|
|
union BlobOrMutableFile
|
|
|
|
{
|
2016-10-25 22:18:22 +03:00
|
|
|
null_t;
|
2015-09-09 14:15:05 +03:00
|
|
|
PBlob;
|
|
|
|
NullableMutableFile;
|
|
|
|
};
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
struct SerializedStructuredCloneReadInfo
|
|
|
|
{
|
2016-06-07 11:49:43 +03:00
|
|
|
SerializedStructuredCloneBuffer data;
|
2015-09-09 14:15:05 +03:00
|
|
|
BlobOrMutableFile[] blobs;
|
2014-09-27 03:21:57 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct SerializedStructuredCloneWriteInfo
|
|
|
|
{
|
2016-06-07 11:49:43 +03:00
|
|
|
SerializedStructuredCloneBuffer data;
|
2014-09-27 03:21:57 +04:00
|
|
|
uint64_t offsetToKeyProp;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IndexUpdateInfo
|
|
|
|
{
|
|
|
|
int64_t indexId;
|
|
|
|
Key value;
|
2015-09-04 22:12:44 +03:00
|
|
|
Key localizedValue;
|
2014-09-27 03:21:57 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
union OptionalKeyRange
|
|
|
|
{
|
|
|
|
SerializedKeyRange;
|
|
|
|
void_t;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DatabaseMetadata
|
|
|
|
{
|
|
|
|
nsString name;
|
|
|
|
uint64_t version;
|
|
|
|
PersistenceType persistenceType;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ObjectStoreMetadata
|
|
|
|
{
|
|
|
|
int64_t id;
|
|
|
|
nsString name;
|
|
|
|
KeyPath keyPath;
|
|
|
|
bool autoIncrement;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IndexMetadata
|
|
|
|
{
|
|
|
|
int64_t id;
|
|
|
|
nsString name;
|
|
|
|
KeyPath keyPath;
|
2015-09-04 22:12:37 +03:00
|
|
|
nsCString locale;
|
2014-09-27 03:21:57 +04:00
|
|
|
bool unique;
|
|
|
|
bool multiEntry;
|
2015-09-04 22:12:37 +03:00
|
|
|
bool autoLocale;
|
2014-09-27 03:21:57 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct DatabaseSpec
|
|
|
|
{
|
|
|
|
DatabaseMetadata metadata;
|
|
|
|
ObjectStoreSpec[] objectStores;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ObjectStoreSpec
|
|
|
|
{
|
|
|
|
ObjectStoreMetadata metadata;
|
|
|
|
IndexMetadata[] indexes;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ObjectStoreOpenCursorParams
|
|
|
|
{
|
|
|
|
int64_t objectStoreId;
|
|
|
|
OptionalKeyRange optionalKeyRange;
|
|
|
|
Direction direction;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ObjectStoreOpenKeyCursorParams
|
|
|
|
{
|
|
|
|
int64_t objectStoreId;
|
|
|
|
OptionalKeyRange optionalKeyRange;
|
|
|
|
Direction direction;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IndexOpenCursorParams
|
|
|
|
{
|
|
|
|
int64_t objectStoreId;
|
|
|
|
int64_t indexId;
|
|
|
|
OptionalKeyRange optionalKeyRange;
|
|
|
|
Direction direction;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IndexOpenKeyCursorParams
|
|
|
|
{
|
|
|
|
int64_t objectStoreId;
|
|
|
|
int64_t indexId;
|
|
|
|
OptionalKeyRange optionalKeyRange;
|
|
|
|
Direction direction;
|
|
|
|
};
|
|
|
|
|
|
|
|
union OpenCursorParams
|
|
|
|
{
|
|
|
|
ObjectStoreOpenCursorParams;
|
|
|
|
ObjectStoreOpenKeyCursorParams;
|
|
|
|
IndexOpenCursorParams;
|
|
|
|
IndexOpenKeyCursorParams;
|
|
|
|
};
|
|
|
|
|
2015-09-09 14:15:05 +03:00
|
|
|
union DatabaseOrMutableFile
|
2014-09-27 03:21:57 +04:00
|
|
|
{
|
|
|
|
PBackgroundIDBDatabaseFile;
|
2015-09-09 14:15:05 +03:00
|
|
|
PBackgroundMutableFile;
|
2014-09-27 03:21:57 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ObjectStoreAddPutParams
|
|
|
|
{
|
|
|
|
int64_t objectStoreId;
|
|
|
|
SerializedStructuredCloneWriteInfo cloneInfo;
|
|
|
|
Key key;
|
|
|
|
IndexUpdateInfo[] indexUpdateInfos;
|
2015-09-09 14:15:05 +03:00
|
|
|
DatabaseOrMutableFile[] files;
|
2014-09-27 03:21:57 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ObjectStoreAddParams
|
|
|
|
{
|
|
|
|
ObjectStoreAddPutParams commonParams;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ObjectStorePutParams
|
|
|
|
{
|
|
|
|
ObjectStoreAddPutParams commonParams;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ObjectStoreGetParams
|
|
|
|
{
|
|
|
|
int64_t objectStoreId;
|
|
|
|
SerializedKeyRange keyRange;
|
|
|
|
};
|
|
|
|
|
2016-07-21 11:31:59 +03:00
|
|
|
struct ObjectStoreGetKeyParams
|
|
|
|
{
|
|
|
|
int64_t objectStoreId;
|
|
|
|
SerializedKeyRange keyRange;
|
|
|
|
};
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
struct ObjectStoreGetAllParams
|
|
|
|
{
|
|
|
|
int64_t objectStoreId;
|
|
|
|
OptionalKeyRange optionalKeyRange;
|
|
|
|
uint32_t limit;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ObjectStoreGetAllKeysParams
|
|
|
|
{
|
|
|
|
int64_t objectStoreId;
|
|
|
|
OptionalKeyRange optionalKeyRange;
|
|
|
|
uint32_t limit;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ObjectStoreDeleteParams
|
|
|
|
{
|
|
|
|
int64_t objectStoreId;
|
|
|
|
SerializedKeyRange keyRange;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ObjectStoreClearParams
|
|
|
|
{
|
|
|
|
int64_t objectStoreId;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ObjectStoreCountParams
|
|
|
|
{
|
|
|
|
int64_t objectStoreId;
|
|
|
|
OptionalKeyRange optionalKeyRange;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IndexGetParams
|
|
|
|
{
|
|
|
|
int64_t objectStoreId;
|
|
|
|
int64_t indexId;
|
|
|
|
SerializedKeyRange keyRange;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IndexGetKeyParams
|
|
|
|
{
|
|
|
|
int64_t objectStoreId;
|
|
|
|
int64_t indexId;
|
|
|
|
SerializedKeyRange keyRange;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IndexGetAllParams
|
|
|
|
{
|
|
|
|
int64_t objectStoreId;
|
|
|
|
int64_t indexId;
|
|
|
|
OptionalKeyRange optionalKeyRange;
|
|
|
|
uint32_t limit;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IndexGetAllKeysParams
|
|
|
|
{
|
|
|
|
int64_t objectStoreId;
|
|
|
|
int64_t indexId;
|
|
|
|
OptionalKeyRange optionalKeyRange;
|
|
|
|
uint32_t limit;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IndexCountParams
|
|
|
|
{
|
|
|
|
int64_t objectStoreId;
|
|
|
|
int64_t indexId;
|
|
|
|
OptionalKeyRange optionalKeyRange;
|
|
|
|
};
|
|
|
|
|
|
|
|
union RequestParams
|
|
|
|
{
|
|
|
|
ObjectStoreAddParams;
|
|
|
|
ObjectStorePutParams;
|
|
|
|
ObjectStoreGetParams;
|
2016-07-21 11:31:59 +03:00
|
|
|
ObjectStoreGetKeyParams;
|
2014-09-27 03:21:57 +04:00
|
|
|
ObjectStoreGetAllParams;
|
|
|
|
ObjectStoreGetAllKeysParams;
|
|
|
|
ObjectStoreDeleteParams;
|
|
|
|
ObjectStoreClearParams;
|
|
|
|
ObjectStoreCountParams;
|
|
|
|
IndexGetParams;
|
|
|
|
IndexGetKeyParams;
|
|
|
|
IndexGetAllParams;
|
|
|
|
IndexGetAllKeysParams;
|
|
|
|
IndexCountParams;
|
|
|
|
};
|
|
|
|
|
2014-10-16 08:56:52 +04:00
|
|
|
struct LoggingInfo
|
|
|
|
{
|
|
|
|
nsID backgroundChildLoggingId;
|
|
|
|
int64_t nextTransactionSerialNumber;
|
|
|
|
int64_t nextVersionChangeTransactionSerialNumber;
|
|
|
|
uint64_t nextRequestSerialNumber;
|
|
|
|
};
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
} // namespace indexedDB
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|