Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1490)

Unified Diff: content/common/indexed_db/indexed_db.mojom

Issue 2370643004: Port messages sent by WebIDBFactoryImpl to Mojo. (Closed)
Patch Set: Allow cpp_only to be set by the invoker. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+};

Powered by Google App Engine
This is Rietveld 408576698