diff options
Diffstat (limited to 'chromium/third_party/blink/public/mojom/indexeddb/indexeddb.mojom')
-rw-r--r-- | chromium/third_party/blink/public/mojom/indexeddb/indexeddb.mojom | 69 |
1 files changed, 51 insertions, 18 deletions
diff --git a/chromium/third_party/blink/public/mojom/indexeddb/indexeddb.mojom b/chromium/third_party/blink/public/mojom/indexeddb/indexeddb.mojom index 024a53d6eda..7e639bd27f4 100644 --- a/chromium/third_party/blink/public/mojom/indexeddb/indexeddb.mojom +++ b/chromium/third_party/blink/public/mojom/indexeddb/indexeddb.mojom @@ -32,13 +32,18 @@ enum IDBDataLoss { Total, }; -// Represents key types that hold no data and so cannot be options in the -// IDBKeyData union. -// TODO(jsbell): These types should be cleaned up end-to-end, leaving only the -// dataful options. -enum IDBDatalessKeyType { +// In order of the least to the highest precedent in terms of sort order. +// These values are written to logs. New enum values can be added, but +// existing enums must never be renumbered or deleted and reused. +enum IDBKeyType { Invalid, + Array, + Binary, + String, + Date, + Number, Null, + Min, }; union IDBKeyData { @@ -47,7 +52,10 @@ union IDBKeyData { mojo_base.mojom.String16 string; double date; double number; - IDBDatalessKeyType other; + // TODO(jsbell): These types should be cleaned up end-to-end, leaving only the + // dataful options above. + bool other_invalid; + bool other_null; }; // Defined as a structure so that it can by typemapped with StructTraits. @@ -55,6 +63,15 @@ struct IDBKey { IDBKeyData data; }; +// In order of the least to the highest precedent in terms of sort order. +// These values are written to logs. New enum values can be added, but +// existing enums must never be renumbered or deleted and reused. +enum IDBKeyPathType { + Null, + String, + Array, +}; + // Represents WebIDBKeyPathTypeString and WebIDBKeyPathTypeArray in a key path. union IDBKeyPathData { mojo_base.mojom.String16 string; @@ -120,7 +137,7 @@ struct IDBObjectStoreMetadata { IDBKeyPath key_path; bool auto_increment; int64 max_index_id; - array<IDBIndexMetadata> indexes; + map<int64, IDBIndexMetadata> indexes; }; struct IDBDatabaseMetadata { @@ -128,7 +145,7 @@ struct IDBDatabaseMetadata { mojo_base.mojom.String16 name; int64 version; int64 max_object_store_id; - array<IDBObjectStoreMetadata> object_stores; + map<int64, IDBObjectStoreMetadata> object_stores; }; struct IDBNameAndVersion { @@ -252,11 +269,28 @@ interface IDBDatabaseCallbacks { Changes(IDBObserverChanges changes); }; +struct IDBError { + int32 error_code; + mojo_base.mojom.String16 error_message; +}; + +struct IDBCursorValue { + IDBKey key; + IDBKey primary_key; + IDBValue value; +}; + interface IDBCursor { - Advance(uint32 count, associated IDBCallbacks callbacks); + // Advance() can call its return callback in one of 3 ways: + // * with |error| set and |value| unset, if an error occurs + // * with |error| unset and |value| set, under normal operation + // * with |error| unset and |value| unset, under normal operation when the end + // of the source being iterated is reached + Advance(uint32 count) => (IDBError? error, IDBCursorValue? value); + // Avoid calling the following function "Continue" since the Mojo // Java bindings generate incorrect Java as a result. We've named - // the following funciton "CursorContinue" as a workaround. + // the following function "CursorContinue" as a workaround. CursorContinue(IDBKey key, IDBKey primary_key, associated IDBCallbacks callbacks); @@ -349,21 +383,20 @@ interface IDBDatabase { int64 index_id, mojo_base.mojom.String16 new_name); Abort(int64 transaction_id); - Commit(int64 transaction_id); + Commit(int64 transaction_id, + int64 num_errors_handled); }; interface IDBFactory { - GetDatabaseInfo(associated IDBCallbacks callbacks, url.mojom.Origin origin); - GetDatabaseNames(associated IDBCallbacks callbacks, url.mojom.Origin origin); + GetDatabaseInfo(associated IDBCallbacks callbacks); + GetDatabaseNames(associated IDBCallbacks callbacks); Open(associated IDBCallbacks callbacks, associated IDBDatabaseCallbacks database_callbacks, - url.mojom.Origin origin, mojo_base.mojom.String16 name, int64 version, int64 transaction_id); - DeleteDatabase(associated IDBCallbacks callbacks, url.mojom.Origin origin, + DeleteDatabase(associated IDBCallbacks callbacks, mojo_base.mojom.String16 name, bool force_close); - AbortTransactionsAndCompactDatabase(url.mojom.Origin origin) => - (IDBStatus status); - AbortTransactionsForDatabase(url.mojom.Origin origin) => (IDBStatus status); + AbortTransactionsAndCompactDatabase() => (IDBStatus status); + AbortTransactionsForDatabase() => (IDBStatus status); }; |