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

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

Issue 2509913002: Implement StructTraits for remaining IndexedDB IPC types. (Closed)
Patch Set: Fix compile error on GCC. Created 4 years, 1 month 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
« no previous file with comments | « content/common/indexed_db/OWNERS ('k') | content/common/indexed_db/indexed_db.typemap » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
index b715909b9967a1299bd6577488613056b3a88fdf..eee826d2e959e772ca7e2d4ebe2a37d7792f3002 100644
--- a/content/common/indexed_db/indexed_db.mojom
+++ b/content/common/indexed_db/indexed_db.mojom
@@ -23,14 +23,46 @@ enum DataLoss {
Total,
};
-[Native]
-struct Key;
+// Represents key types that hold no data and so cannot be options in the
+// KeyData union.
+// TODO(jsbell): These types should be cleaned up end-to-end, leaving only the
+// dataful options.
+enum DatalessKeyType {
+ Invalid,
+ Null,
+};
-[Native]
-struct KeyPath;
+union KeyData {
+ array<Key> key_array;
+ array<uint8> binary;
+ mojo.common.mojom.String16 string;
+ double date;
+ double number;
+ DatalessKeyType other;
+};
-[Native]
-struct KeyRange;
+// Defined as a structure so that it can by typemapped with StructTraits.
+struct Key {
+ KeyData data;
+};
+
+// Represents WebIDBKeyPathTypeString and WebIDBKeyPathTypeArray in a key path.
+union KeyPathData {
+ mojo.common.mojom.String16 string;
+ array<mojo.common.mojom.String16> string_array;
+};
+
+struct KeyPath {
+ // A null value here corresponds to WebIDBKeyPathTypeNull.
+ KeyPathData? data;
+};
+
+struct KeyRange {
+ Key lower;
+ Key upper;
+ bool lower_open;
+ bool upper_open;
+};
enum PutMode {
AddOrUpdate,
« no previous file with comments | « content/common/indexed_db/OWNERS ('k') | content/common/indexed_db/indexed_db.typemap » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698