OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
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 | |
7 // so belongs here. | |
8 | |
9 module indexed_db.mojom; | |
10 | |
11 import "mojo/common/common_custom_types.mojom"; | |
12 import "url/mojo/origin.mojom"; | |
13 | |
14 [Native] | |
15 enum DataLoss; | |
16 | |
17 [Native] | |
18 struct KeyPath; | |
19 | |
20 struct IndexMetadata { | |
21 int64 id; | |
22 mojo.common.mojom.String16 name; | |
23 KeyPath key_path; | |
24 bool unique; | |
25 bool multi_entry; | |
26 }; | |
27 | |
28 struct ObjectStoreMetadata { | |
29 int64 id; | |
30 mojo.common.mojom.String16 name; | |
31 KeyPath key_path; | |
32 bool auto_increment; | |
33 int64 max_index_id; | |
34 array<IndexMetadata> indexes; | |
35 }; | |
36 | |
37 struct DatabaseMetadata { | |
38 int64 id; | |
39 mojo.common.mojom.String16 name; | |
40 int64 version; | |
41 int64 max_object_store_id; | |
42 array<ObjectStoreMetadata> object_stores; | |
43 }; | |
44 | |
45 interface Callbacks { | |
46 Error(int32 code, mojo.common.mojom.String16 message); | |
47 | |
48 // Factory::GetDatabaseNames | |
49 SuccessStringList(array<mojo.common.mojom.String16> value); | |
50 | |
51 // Factory::Open / DeleteDatabase | |
52 Blocked(int64 existing_version); | |
53 | |
54 // Factory::Open | |
55 UpgradeNeeded(int32 database_id, int64 old_version, DataLoss data_loss, | |
56 string data_loss_message, DatabaseMetadata db_metadata); | |
57 SuccessDatabase(int32 database_id, DatabaseMetadata metadata); | |
58 | |
59 // Factory::DeleteDatabase | |
60 SuccessInteger(int64 value); | |
61 }; | |
62 | |
63 interface DatabaseCallbacks { | |
dcheng
2016/10/17 05:33:44
Mind documenting the Callbacks and DatabaseCallbac
Reilly Grant (use Gerrit)
2016/10/19 00:36:51
The fact that these are just two large interfaces
| |
64 ForcedClose(); | |
65 VersionChange(int64 old_version, int64 new_version); | |
66 Abort(int64 transaction_id, int32 code, | |
67 mojo.common.mojom.String16 message); | |
68 Complete(int64 transaction_id); | |
69 }; | |
70 | |
71 interface Factory { | |
72 GetDatabaseNames(associated Callbacks callbacks, url.mojom.Origin origin); | |
73 Open(int32 worker_thread, associated Callbacks callbacks, | |
74 associated DatabaseCallbacks database_callbacks, url.mojom.Origin origin, | |
75 mojo.common.mojom.String16 name, int64 version, int64 transaction_id); | |
76 DeleteDatabase(associated Callbacks callbacks, url.mojom.Origin origin, | |
77 mojo.common.mojom.String16 name); | |
78 }; | |
OLD | NEW |