OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ |
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 const Identifier& identifier() const { return identifier_; } | 68 const Identifier& identifier() const { return identifier_; } |
69 IndexedDBBackingStore* backing_store() { return backing_store_.get(); } | 69 IndexedDBBackingStore* backing_store() { return backing_store_.get(); } |
70 | 70 |
71 int64_t id() const { return metadata_.id; } | 71 int64_t id() const { return metadata_.id; } |
72 const base::string16& name() const { return metadata_.name; } | 72 const base::string16& name() const { return metadata_.name; } |
73 | 73 |
74 void AddObjectStore(const IndexedDBObjectStoreMetadata& metadata, | 74 void AddObjectStore(const IndexedDBObjectStoreMetadata& metadata, |
75 int64_t new_max_object_store_id); | 75 int64_t new_max_object_store_id); |
76 void RemoveObjectStore(int64_t object_store_id); | 76 void RemoveObjectStore(int64_t object_store_id); |
| 77 void SetObjectStoreName(int64_t object_store_id, const base::string16& name); |
77 void AddIndex(int64_t object_store_id, | 78 void AddIndex(int64_t object_store_id, |
78 const IndexedDBIndexMetadata& metadata, | 79 const IndexedDBIndexMetadata& metadata, |
79 int64_t new_max_index_id); | 80 int64_t new_max_index_id); |
80 void RemoveIndex(int64_t object_store_id, int64_t index_id); | 81 void RemoveIndex(int64_t object_store_id, int64_t index_id); |
| 82 void SetIndexName(int64_t object_store_id, |
| 83 int64_t index_id, |
| 84 const base::string16& name); |
81 | 85 |
82 void OpenConnection(std::unique_ptr<IndexedDBPendingConnection> connection); | 86 void OpenConnection(std::unique_ptr<IndexedDBPendingConnection> connection); |
83 void DeleteDatabase(scoped_refptr<IndexedDBCallbacks> callbacks); | 87 void DeleteDatabase(scoped_refptr<IndexedDBCallbacks> callbacks); |
84 const IndexedDBDatabaseMetadata& metadata() const { return metadata_; } | 88 const IndexedDBDatabaseMetadata& metadata() const { return metadata_; } |
85 | 89 |
86 void CreateObjectStore(int64_t transaction_id, | 90 void CreateObjectStore(int64_t transaction_id, |
87 int64_t object_store_id, | 91 int64_t object_store_id, |
88 const base::string16& name, | 92 const base::string16& name, |
89 const IndexedDBKeyPath& key_path, | 93 const IndexedDBKeyPath& key_path, |
90 bool auto_increment); | 94 bool auto_increment); |
91 void DeleteObjectStore(int64_t transaction_id, int64_t object_store_id); | 95 void DeleteObjectStore(int64_t transaction_id, int64_t object_store_id); |
| 96 void RenameObjectStore(int64_t transaction_id, |
| 97 int64_t object_store_id, |
| 98 const base::string16& new_name); |
92 | 99 |
93 // Returns a pointer to a newly created transaction. The object is owned | 100 // Returns a pointer to a newly created transaction. The object is owned |
94 // by |transaction_coordinator_|. | 101 // by |transaction_coordinator_|. |
95 IndexedDBTransaction* CreateTransaction( | 102 IndexedDBTransaction* CreateTransaction( |
96 int64_t transaction_id, | 103 int64_t transaction_id, |
97 IndexedDBConnection* connection, | 104 IndexedDBConnection* connection, |
98 const std::vector<int64_t>& object_store_ids, | 105 const std::vector<int64_t>& object_store_ids, |
99 blink::WebIDBTransactionMode mode); | 106 blink::WebIDBTransactionMode mode); |
100 void Close(IndexedDBConnection* connection, bool forced); | 107 void Close(IndexedDBConnection* connection, bool forced); |
101 void ForceClose(); | 108 void ForceClose(); |
(...skipping 10 matching lines...) Expand all Loading... |
112 void CreateIndex(int64_t transaction_id, | 119 void CreateIndex(int64_t transaction_id, |
113 int64_t object_store_id, | 120 int64_t object_store_id, |
114 int64_t index_id, | 121 int64_t index_id, |
115 const base::string16& name, | 122 const base::string16& name, |
116 const IndexedDBKeyPath& key_path, | 123 const IndexedDBKeyPath& key_path, |
117 bool unique, | 124 bool unique, |
118 bool multi_entry); | 125 bool multi_entry); |
119 void DeleteIndex(int64_t transaction_id, | 126 void DeleteIndex(int64_t transaction_id, |
120 int64_t object_store_id, | 127 int64_t object_store_id, |
121 int64_t index_id); | 128 int64_t index_id); |
| 129 void RenameIndex(int64_t transaction_id, |
| 130 int64_t object_store_id, |
| 131 int64_t index_id, |
| 132 const base::string16& new_name); |
122 | 133 |
123 IndexedDBTransactionCoordinator& transaction_coordinator() { | 134 IndexedDBTransactionCoordinator& transaction_coordinator() { |
124 return transaction_coordinator_; | 135 return transaction_coordinator_; |
125 } | 136 } |
126 const IndexedDBTransactionCoordinator& transaction_coordinator() const { | 137 const IndexedDBTransactionCoordinator& transaction_coordinator() const { |
127 return transaction_coordinator_; | 138 return transaction_coordinator_; |
128 } | 139 } |
129 | 140 |
130 void TransactionCreated(IndexedDBTransaction* transaction); | 141 void TransactionCreated(IndexedDBTransaction* transaction); |
131 void TransactionFinished(IndexedDBTransaction* transaction, bool committed); | 142 void TransactionFinished(IndexedDBTransaction* transaction, bool committed); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 size_t PendingOpenDeleteCount() const { return pending_requests_.size(); } | 217 size_t PendingOpenDeleteCount() const { return pending_requests_.size(); } |
207 | 218 |
208 // Asynchronous tasks scheduled within transactions: | 219 // Asynchronous tasks scheduled within transactions: |
209 void CreateObjectStoreAbortOperation(int64_t object_store_id, | 220 void CreateObjectStoreAbortOperation(int64_t object_store_id, |
210 IndexedDBTransaction* transaction); | 221 IndexedDBTransaction* transaction); |
211 void DeleteObjectStoreOperation(int64_t object_store_id, | 222 void DeleteObjectStoreOperation(int64_t object_store_id, |
212 IndexedDBTransaction* transaction); | 223 IndexedDBTransaction* transaction); |
213 void DeleteObjectStoreAbortOperation( | 224 void DeleteObjectStoreAbortOperation( |
214 const IndexedDBObjectStoreMetadata& object_store_metadata, | 225 const IndexedDBObjectStoreMetadata& object_store_metadata, |
215 IndexedDBTransaction* transaction); | 226 IndexedDBTransaction* transaction); |
| 227 void RenameObjectStoreAbortOperation(int64_t object_store_id, |
| 228 const base::string16 old_name, |
| 229 IndexedDBTransaction* transaction); |
216 void VersionChangeOperation(int64_t version, | 230 void VersionChangeOperation(int64_t version, |
217 scoped_refptr<IndexedDBCallbacks> callbacks, | 231 scoped_refptr<IndexedDBCallbacks> callbacks, |
218 IndexedDBTransaction* transaction); | 232 IndexedDBTransaction* transaction); |
219 void VersionChangeAbortOperation(int64_t previous_version, | 233 void VersionChangeAbortOperation(int64_t previous_version, |
220 IndexedDBTransaction* transaction); | 234 IndexedDBTransaction* transaction); |
221 void DeleteIndexOperation(int64_t object_store_id, | 235 void DeleteIndexOperation(int64_t object_store_id, |
222 int64_t index_id, | 236 int64_t index_id, |
223 IndexedDBTransaction* transaction); | 237 IndexedDBTransaction* transaction); |
224 void CreateIndexAbortOperation(int64_t object_store_id, | 238 void CreateIndexAbortOperation(int64_t object_store_id, |
225 int64_t index_id, | 239 int64_t index_id, |
226 IndexedDBTransaction* transaction); | 240 IndexedDBTransaction* transaction); |
227 void DeleteIndexAbortOperation(int64_t object_store_id, | 241 void DeleteIndexAbortOperation(int64_t object_store_id, |
228 const IndexedDBIndexMetadata& index_metadata, | 242 const IndexedDBIndexMetadata& index_metadata, |
229 IndexedDBTransaction* transaction); | 243 IndexedDBTransaction* transaction); |
| 244 void RenameIndexAbortOperation(int64_t object_store_id, |
| 245 int64_t index_id, |
| 246 const base::string16 old_name, |
| 247 IndexedDBTransaction* transaction); |
230 void GetOperation(int64_t object_store_id, | 248 void GetOperation(int64_t object_store_id, |
231 int64_t index_id, | 249 int64_t index_id, |
232 std::unique_ptr<IndexedDBKeyRange> key_range, | 250 std::unique_ptr<IndexedDBKeyRange> key_range, |
233 indexed_db::CursorType cursor_type, | 251 indexed_db::CursorType cursor_type, |
234 scoped_refptr<IndexedDBCallbacks> callbacks, | 252 scoped_refptr<IndexedDBCallbacks> callbacks, |
235 IndexedDBTransaction* transaction); | 253 IndexedDBTransaction* transaction); |
236 void GetAllOperation(int64_t object_store_id, | 254 void GetAllOperation(int64_t object_store_id, |
237 int64_t index_id, | 255 int64_t index_id, |
238 std::unique_ptr<IndexedDBKeyRange> key_range, | 256 std::unique_ptr<IndexedDBKeyRange> key_range, |
239 indexed_db::CursorType cursor_type, | 257 indexed_db::CursorType cursor_type, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 bool processing_pending_requests_ = false; | 353 bool processing_pending_requests_ = false; |
336 | 354 |
337 bool experimental_web_platform_features_enabled_; | 355 bool experimental_web_platform_features_enabled_; |
338 | 356 |
339 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabase); | 357 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabase); |
340 }; | 358 }; |
341 | 359 |
342 } // namespace content | 360 } // namespace content |
343 | 361 |
344 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ | 362 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ |
OLD | NEW |