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