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

Side by Side Diff: content/common/indexed_db/indexed_db.mojom

Issue 2509913002: Implement StructTraits for remaining IndexedDB IPC types. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // TODO: This will move to //third_party/WebKit when //content/child/indexed_db 5 // TODO: This will move to //third_party/WebKit when //content/child/indexed_db
6 // is deleted but for now this will depend on //content/common types and so 6 // is deleted but for now this will depend on //content/common types and so
7 // so belongs here. 7 // so belongs here.
8 8
9 module indexed_db.mojom; 9 module indexed_db.mojom;
10 10
11 import "mojo/common/common_custom_types.mojom"; 11 import "mojo/common/common_custom_types.mojom";
12 import "url/mojo/origin.mojom"; 12 import "url/mojo/origin.mojom";
13 13
14 enum CursorDirection { 14 enum CursorDirection {
15 Next, 15 Next,
16 NextNoDuplicate, 16 NextNoDuplicate,
17 Prev, 17 Prev,
18 PrevNoDuplicate, 18 PrevNoDuplicate,
19 }; 19 };
20 20
21 enum DataLoss { 21 enum DataLoss {
22 None, 22 None,
23 Total, 23 Total,
24 }; 24 };
25 25
26 [Native] 26 // Represents key types that hold no data and so cannot be options in the
27 struct Key; 27 // KeyData union.
28 enum DatalessKeyType {
29 Invalid,
30 Null,
31 };
28 32
29 [Native] 33 union KeyData {
30 struct KeyPath; 34 array<Key> key_array;
35 array<uint8> binary;
36 mojo.common.mojom.String16 string;
37 double date;
38 double number;
39 DatalessKeyType other;
jsbell 2016/11/17 04:32:42 Ugh. I remember this falling out of very early Web
Reilly Grant (use Gerrit) 2016/11/17 21:31:17 Added a little TODO.
40 };
31 41
32 [Native] 42 // Defined as a structure so that it can by typemapped with StructTraits.
33 struct KeyRange; 43 struct Key {
44 KeyData data;
45 };
46
47 // Represents WebIDBKeyPathTypeString and WebIDBKeyPathTypeArray in a key path.
48 union KeyPathData {
49 mojo.common.mojom.String16 string;
50 array<mojo.common.mojom.String16> string_array;
51 };
52
53 struct KeyPath {
54 // A null value here corresponds to WebIDBKeyPathTypeNull.
55 KeyPathData? data;
56 };
57
58 struct KeyRange {
59 Key lower;
60 Key upper;
61 bool lower_open;
62 bool upper_open;
63 };
34 64
35 enum PutMode { 65 enum PutMode {
36 AddOrUpdate, 66 AddOrUpdate,
37 AddOnly, 67 AddOnly,
38 CursorUpdate, 68 CursorUpdate,
39 }; 69 };
40 70
41 enum TaskType { 71 enum TaskType {
42 Normal, 72 Normal,
43 Preemptive, 73 Preemptive,
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 }; 294 };
265 295
266 interface Factory { 296 interface Factory {
267 GetDatabaseNames(associated Callbacks callbacks, url.mojom.Origin origin); 297 GetDatabaseNames(associated Callbacks callbacks, url.mojom.Origin origin);
268 Open(int32 worker_thread, associated Callbacks callbacks, 298 Open(int32 worker_thread, associated Callbacks callbacks,
269 associated DatabaseCallbacks database_callbacks, url.mojom.Origin origin, 299 associated DatabaseCallbacks database_callbacks, url.mojom.Origin origin,
270 mojo.common.mojom.String16 name, int64 version, int64 transaction_id); 300 mojo.common.mojom.String16 name, int64 version, int64 transaction_id);
271 DeleteDatabase(associated Callbacks callbacks, url.mojom.Origin origin, 301 DeleteDatabase(associated Callbacks callbacks, url.mojom.Origin origin,
272 mojo.common.mojom.String16 name); 302 mojo.common.mojom.String16 name);
273 }; 303 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698