Index: content/common/indexed_db/indexed_db.mojom |
diff --git a/content/common/indexed_db/indexed_db.mojom b/content/common/indexed_db/indexed_db.mojom |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b8a45d9762d540648e8046c040166d84950ef49f |
--- /dev/null |
+++ b/content/common/indexed_db/indexed_db.mojom |
@@ -0,0 +1,72 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// TODO: This will move to //third_party/WebKit when //content/child/indexed_db |
+// is deleted but for now this will depend on //content/common types and so |
+// so belongs here. |
+ |
+module indexed_db.mojom; |
+ |
+import "mojo/common/common_custom_types.mojom"; |
+import "url/mojo/origin.mojom"; |
+ |
+enum DataLoss { |
+ None = 0, |
+ Total, |
+}; |
+ |
+[Native] |
+struct KeyPath; |
+ |
+struct IndexMetadata { |
+ int64 id; |
+ mojo.common.mojom.String16 name; |
+ KeyPath key_path; |
+ bool unique; |
+ bool multi_entry; |
+}; |
+ |
+struct ObjectStoreMetadata { |
+ int64 id; |
+ mojo.common.mojom.String16 name; |
+ KeyPath key_path; |
+ bool auto_increment; |
+ int64 max_index_id; |
+ array<IndexMetadata> indexes; |
+}; |
+ |
+struct DatabaseMetadata { |
+ int64 id; |
+ mojo.common.mojom.String16 name; |
+ int64 version; |
+ int64 max_object_store_id; |
+ array<ObjectStoreMetadata> object_stores; |
+}; |
+ |
+interface Callbacks { |
Ken Rockot(use gerrit already)
2016/09/28 20:06:44
I see that this is mirroring the existing implemen
Reilly Grant (use Gerrit)
2016/09/29 06:44:50
Most messages will only generate one response but
Ken Rockot(use gerrit already)
2016/09/29 22:37:50
OK. I still think it's weird, and I'd prefer to no
|
+ Blocked(int64 existing_version); |
+ Error(int32 code, mojo.common.mojom.String16 message); |
+ SuccessDatabase(int32 database_id, DatabaseMetadata metadata); |
+ SuccessInteger(int64 value); |
+ SuccessStringList(array<mojo.common.mojom.String16> value); |
+ UpgradeNeeded(int32 database_id, int64 old_version, DataLoss data_loss, |
+ string data_loss_message, DatabaseMetadata db_metadata); |
+}; |
+ |
+interface DatabaseCallbacks { |
+ ForcedClose(); |
+ VersionChange(int64 old_version, int64 new_version); |
+ Abort(int64 transaction_id, int32 code, |
+ mojo.common.mojom.String16 message); |
+ Complete(int64 transaction_id); |
+}; |
+ |
+interface Factory { |
+ GetDatabaseNames(associated Callbacks callbacks, url.mojom.Origin origin); |
+ Open(int32 worker_thread, associated Callbacks callbacks, |
+ associated DatabaseCallbacks database_callbacks, url.mojom.Origin origin, |
+ mojo.common.mojom.String16 name, int64 version, int64 transaction_id); |
+ DeleteDatabase(associated Callbacks callbacks, url.mojom.Origin origin, |
+ mojo.common.mojom.String16 name); |
+}; |