 Chromium Code Reviews
 Chromium Code Reviews Issue 2511403003:
  Send IndexedDB observations through IDBDatabaseCallbacks.  (Closed)
    
  
    Issue 2511403003:
  Send IndexedDB observations through IDBDatabaseCallbacks.  (Closed) 
  | OLD | NEW | 
|---|---|
| 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 | 
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 KeyPathData? data; | 57 KeyPathData? data; | 
| 58 }; | 58 }; | 
| 59 | 59 | 
| 60 struct KeyRange { | 60 struct KeyRange { | 
| 61 Key lower; | 61 Key lower; | 
| 62 Key upper; | 62 Key upper; | 
| 63 bool lower_open; | 63 bool lower_open; | 
| 64 bool upper_open; | 64 bool upper_open; | 
| 65 }; | 65 }; | 
| 66 | 66 | 
| 67 enum OperationType { | |
| 68 Add, | |
| 69 Put, | |
| 70 Delete, | |
| 71 Clear, | |
| 72 }; | |
| 73 | |
| 67 enum PutMode { | 74 enum PutMode { | 
| 68 AddOrUpdate, | 75 AddOrUpdate, | 
| 69 AddOnly, | 76 AddOnly, | 
| 70 CursorUpdate, | 77 CursorUpdate, | 
| 71 }; | 78 }; | 
| 72 | 79 | 
| 73 enum TaskType { | 80 enum TaskType { | 
| 74 Normal, | 81 Normal, | 
| 75 Preemptive, | 82 Preemptive, | 
| 76 }; | 83 }; | 
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 string bits; | 135 string bits; | 
| 129 array<BlobInfo> blob_or_file_info; | 136 array<BlobInfo> blob_or_file_info; | 
| 130 }; | 137 }; | 
| 131 | 138 | 
| 132 struct ReturnValue { | 139 struct ReturnValue { | 
| 133 Value value; | 140 Value value; | 
| 134 Key primary_key; | 141 Key primary_key; | 
| 135 KeyPath key_path; | 142 KeyPath key_path; | 
| 136 }; | 143 }; | 
| 137 | 144 | 
| 145 struct Observation { | |
| 146 int64 object_store_id; | |
| 147 OperationType type; | |
| 148 KeyRange key_range; | |
| 149 }; | |
| 150 | |
| 151 struct ObserverChanges { | |
| 152 map<int32, array<int32>> observation_index_map; | |
| 
jsbell
2016/11/21 19:45:22
Can we document what this is a map from/to?
IIRC
 | |
| 153 array<Observation> observations; | |
| 154 }; | |
| 155 | |
| 138 // The Callbacks interface is used to return results for individual requests. | 156 // The Callbacks interface is used to return results for individual requests. | 
| 139 // Some requests may return multiple results before completion, such as | 157 // Some requests may return multiple results before completion, such as | 
| 140 // UpgradeNeeded before SuccessDatabase. | 158 // UpgradeNeeded before SuccessDatabase. | 
| 141 // | 159 // | 
| 142 // TODO(https://crbug.com/627484): Many of these could be replaced with | 160 // TODO(https://crbug.com/627484): Many of these could be replaced with | 
| 143 // replies associated with particular messages. | 161 // replies associated with particular messages. | 
| 144 interface Callbacks { | 162 interface Callbacks { | 
| 145 Error(int32 code, mojo.common.mojom.String16 message); | 163 Error(int32 code, mojo.common.mojom.String16 message); | 
| 146 | 164 | 
| 147 // Factory::GetDatabaseNames | 165 // Factory::GetDatabaseNames | 
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 | 207 | 
| 190 // The DatabaseCallbacks interface is used to notification of events out of | 208 // The DatabaseCallbacks interface is used to notification of events out of | 
| 191 // band to individual requests. A single instance is used for the lifetime of | 209 // band to individual requests. A single instance is used for the lifetime of | 
| 192 // a database connection. | 210 // a database connection. | 
| 193 interface DatabaseCallbacks { | 211 interface DatabaseCallbacks { | 
| 194 ForcedClose(); | 212 ForcedClose(); | 
| 195 VersionChange(int64 old_version, int64 new_version); | 213 VersionChange(int64 old_version, int64 new_version); | 
| 196 Abort(int64 transaction_id, int32 code, | 214 Abort(int64 transaction_id, int32 code, | 
| 197 mojo.common.mojom.String16 message); | 215 mojo.common.mojom.String16 message); | 
| 198 Complete(int64 transaction_id); | 216 Complete(int64 transaction_id); | 
| 217 Changes(ObserverChanges changes); | |
| 199 }; | 218 }; | 
| 200 | 219 | 
| 201 interface Cursor { | 220 interface Cursor { | 
| 202 Advance(uint32 count, associated Callbacks callbacks); | 221 Advance(uint32 count, associated Callbacks callbacks); | 
| 203 Continue(Key key, Key primary_key, associated Callbacks callbacks); | 222 Continue(Key key, Key primary_key, associated Callbacks callbacks); | 
| 204 Prefetch(int32 count, associated Callbacks callbacks); | 223 Prefetch(int32 count, associated Callbacks callbacks); | 
| 205 PrefetchReset(int32 used_prefetches, int32 unused_prefetches, | 224 PrefetchReset(int32 used_prefetches, int32 unused_prefetches, | 
| 206 array<string> unused_blob_uuids); | 225 array<string> unused_blob_uuids); | 
| 207 }; | 226 }; | 
| 208 | 227 | 
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 290 int64 object_store_id, | 309 int64 object_store_id, | 
| 291 int64 index_id, | 310 int64 index_id, | 
| 292 mojo.common.mojom.String16 new_name); | 311 mojo.common.mojom.String16 new_name); | 
| 293 Abort(int64 transaction_id); | 312 Abort(int64 transaction_id); | 
| 294 Commit(int64 transaction_id); | 313 Commit(int64 transaction_id); | 
| 295 AckReceivedBlobs(array<string> uuids); | 314 AckReceivedBlobs(array<string> uuids); | 
| 296 }; | 315 }; | 
| 297 | 316 | 
| 298 interface Factory { | 317 interface Factory { | 
| 299 GetDatabaseNames(associated Callbacks callbacks, url.mojom.Origin origin); | 318 GetDatabaseNames(associated Callbacks callbacks, url.mojom.Origin origin); | 
| 300 Open(int32 worker_thread, associated Callbacks callbacks, | 319 Open(associated Callbacks callbacks, | 
| 301 associated DatabaseCallbacks database_callbacks, url.mojom.Origin origin, | 320 associated DatabaseCallbacks database_callbacks, url.mojom.Origin origin, | 
| 302 mojo.common.mojom.String16 name, int64 version, int64 transaction_id); | 321 mojo.common.mojom.String16 name, int64 version, int64 transaction_id); | 
| 303 DeleteDatabase(associated Callbacks callbacks, url.mojom.Origin origin, | 322 DeleteDatabase(associated Callbacks callbacks, url.mojom.Origin origin, | 
| 304 mojo.common.mojom.String16 name); | 323 mojo.common.mojom.String16 name); | 
| 305 }; | 324 }; | 
| OLD | NEW |