| 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 29 matching lines...) Expand all Loading... |
| 40 class IndexedDBKey; | 40 class IndexedDBKey; |
| 41 class IndexedDBKeyPath; | 41 class IndexedDBKeyPath; |
| 42 class IndexedDBKeyRange; | 42 class IndexedDBKeyRange; |
| 43 class IndexedDBObserverChanges; | 43 class IndexedDBObserverChanges; |
| 44 class IndexedDBTransaction; | 44 class IndexedDBTransaction; |
| 45 struct IndexedDBValue; | 45 struct IndexedDBValue; |
| 46 | 46 |
| 47 class CONTENT_EXPORT IndexedDBDatabase | 47 class CONTENT_EXPORT IndexedDBDatabase |
| 48 : NON_EXPORTED_BASE(public base::RefCounted<IndexedDBDatabase>) { | 48 : NON_EXPORTED_BASE(public base::RefCounted<IndexedDBDatabase>) { |
| 49 public: | 49 public: |
| 50 // An index and corresponding set of keys | |
| 51 using IndexKeys = std::pair<int64_t, std::vector<IndexedDBKey>>; | |
| 52 | |
| 53 // Identifier is pair of (origin, database name). | 50 // Identifier is pair of (origin, database name). |
| 54 using Identifier = std::pair<url::Origin, base::string16>; | 51 using Identifier = std::pair<url::Origin, base::string16>; |
| 55 | 52 |
| 56 static const int64_t kInvalidId = 0; | 53 static const int64_t kInvalidId = 0; |
| 57 static const int64_t kMinimumIndexId = 30; | 54 static const int64_t kMinimumIndexId = 30; |
| 58 | 55 |
| 59 static scoped_refptr<IndexedDBDatabase> Create( | 56 static scoped_refptr<IndexedDBDatabase> Create( |
| 60 const base::string16& name, | 57 const base::string16& name, |
| 61 IndexedDBBackingStore* backing_store, | 58 IndexedDBBackingStore* backing_store, |
| 62 IndexedDBFactory* factory, | 59 IndexedDBFactory* factory, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 bool key_only, | 165 bool key_only, |
| 169 int64_t max_count, | 166 int64_t max_count, |
| 170 scoped_refptr<IndexedDBCallbacks> callbacks); | 167 scoped_refptr<IndexedDBCallbacks> callbacks); |
| 171 void Put(int64_t transaction_id, | 168 void Put(int64_t transaction_id, |
| 172 int64_t object_store_id, | 169 int64_t object_store_id, |
| 173 IndexedDBValue* value, | 170 IndexedDBValue* value, |
| 174 std::vector<std::unique_ptr<storage::BlobDataHandle>>* handles, | 171 std::vector<std::unique_ptr<storage::BlobDataHandle>>* handles, |
| 175 std::unique_ptr<IndexedDBKey> key, | 172 std::unique_ptr<IndexedDBKey> key, |
| 176 blink::WebIDBPutMode mode, | 173 blink::WebIDBPutMode mode, |
| 177 scoped_refptr<IndexedDBCallbacks> callbacks, | 174 scoped_refptr<IndexedDBCallbacks> callbacks, |
| 178 const std::vector<IndexKeys>& index_keys); | 175 const std::vector<IndexedDBIndexKeys>& index_keys); |
| 179 void SetIndexKeys(int64_t transaction_id, | 176 void SetIndexKeys(int64_t transaction_id, |
| 180 int64_t object_store_id, | 177 int64_t object_store_id, |
| 181 std::unique_ptr<IndexedDBKey> primary_key, | 178 std::unique_ptr<IndexedDBKey> primary_key, |
| 182 const std::vector<IndexKeys>& index_keys); | 179 const std::vector<IndexedDBIndexKeys>& index_keys); |
| 183 void SetIndexesReady(int64_t transaction_id, | 180 void SetIndexesReady(int64_t transaction_id, |
| 184 int64_t object_store_id, | 181 int64_t object_store_id, |
| 185 const std::vector<int64_t>& index_ids); | 182 const std::vector<int64_t>& index_ids); |
| 186 void OpenCursor(int64_t transaction_id, | 183 void OpenCursor(int64_t transaction_id, |
| 187 int64_t object_store_id, | 184 int64_t object_store_id, |
| 188 int64_t index_id, | 185 int64_t index_id, |
| 189 std::unique_ptr<IndexedDBKeyRange> key_range, | 186 std::unique_ptr<IndexedDBKeyRange> key_range, |
| 190 blink::WebIDBCursorDirection, | 187 blink::WebIDBCursorDirection, |
| 191 bool key_only, | 188 bool key_only, |
| 192 blink::WebIDBTaskType task_type, | 189 blink::WebIDBTaskType task_type, |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 // is executing. It prevents rentrant calls if the active request completes | 346 // is executing. It prevents rentrant calls if the active request completes |
| 350 // synchronously. | 347 // synchronously. |
| 351 bool processing_pending_requests_ = false; | 348 bool processing_pending_requests_ = false; |
| 352 | 349 |
| 353 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabase); | 350 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabase); |
| 354 }; | 351 }; |
| 355 | 352 |
| 356 } // namespace content | 353 } // namespace content |
| 357 | 354 |
| 358 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ | 355 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ |
| OLD | NEW |