Chromium Code Reviews| 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 |
| 11 #include <list> | 11 #include <list> |
| 12 #include <map> | 12 #include <map> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <utility> | 14 #include <utility> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "content/browser/indexed_db/indexed_db.h" | 19 #include "content/browser/indexed_db/indexed_db.h" |
| 20 #include "content/browser/indexed_db/indexed_db_backing_store.h" | 20 #include "content/browser/indexed_db/indexed_db_backing_store.h" |
| 21 #include "content/browser/indexed_db/indexed_db_callbacks.h" | 21 #include "content/browser/indexed_db/indexed_db_callbacks.h" |
| 22 #include "content/browser/indexed_db/indexed_db_metadata.h" | 22 #include "content/browser/indexed_db/indexed_db_metadata.h" |
| 23 #include "content/browser/indexed_db/indexed_db_pending_connection.h" | 23 #include "content/browser/indexed_db/indexed_db_pending_connection.h" |
| 24 #include "content/browser/indexed_db/indexed_db_transaction_coordinator.h" | 24 #include "content/browser/indexed_db/indexed_db_transaction_coordinator.h" |
| 25 #include "content/browser/indexed_db/list_set.h" | 25 #include "content/browser/indexed_db/list_set.h" |
| 26 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" | 26 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" |
| 27 #include "url/gurl.h" | 27 |
| 28 namespace url { | |
| 29 class Origin; | |
| 30 } | |
| 28 | 31 |
| 29 namespace content { | 32 namespace content { |
| 30 | 33 |
| 31 class IndexedDBBlobInfo; | 34 class IndexedDBBlobInfo; |
| 32 class IndexedDBConnection; | 35 class IndexedDBConnection; |
| 33 class IndexedDBDatabaseCallbacks; | 36 class IndexedDBDatabaseCallbacks; |
| 34 class IndexedDBFactory; | 37 class IndexedDBFactory; |
| 35 class IndexedDBKey; | 38 class IndexedDBKey; |
| 36 class IndexedDBKeyPath; | 39 class IndexedDBKeyPath; |
| 37 class IndexedDBKeyRange; | 40 class IndexedDBKeyRange; |
| 38 class IndexedDBTransaction; | 41 class IndexedDBTransaction; |
| 39 struct IndexedDBValue; | 42 struct IndexedDBValue; |
| 40 | 43 |
| 41 class CONTENT_EXPORT IndexedDBDatabase | 44 class CONTENT_EXPORT IndexedDBDatabase |
| 42 : NON_EXPORTED_BASE(public base::RefCounted<IndexedDBDatabase>) { | 45 : NON_EXPORTED_BASE(public base::RefCounted<IndexedDBDatabase>) { |
| 43 public: | 46 public: |
| 44 // An index and corresponding set of keys | 47 // An index and corresponding set of keys |
| 45 typedef std::pair<int64_t, std::vector<IndexedDBKey>> IndexKeys; | 48 typedef std::pair<int64_t, std::vector<IndexedDBKey>> IndexKeys; |
| 46 | 49 |
| 47 // Identifier is pair of (origin url, database name). | 50 // Identifier is pair of (origin, database name). |
| 48 typedef std::pair<GURL, base::string16> Identifier; | 51 typedef std::pair<url::Origin, base::string16> Identifier; |
|
cmumford
2016/03/31 20:54:16
using Identifier = std::pair<url::Origin, base::st
jsbell
2016/04/01 20:31:35
Done.
| |
| 49 | 52 |
| 50 static const int64_t kInvalidId = 0; | 53 static const int64_t kInvalidId = 0; |
| 51 static const int64_t kMinimumIndexId = 30; | 54 static const int64_t kMinimumIndexId = 30; |
| 52 | 55 |
| 53 static scoped_refptr<IndexedDBDatabase> Create( | 56 static scoped_refptr<IndexedDBDatabase> Create( |
| 54 const base::string16& name, | 57 const base::string16& name, |
| 55 IndexedDBBackingStore* backing_store, | 58 IndexedDBBackingStore* backing_store, |
| 56 IndexedDBFactory* factory, | 59 IndexedDBFactory* factory, |
| 57 const Identifier& unique_identifier, | 60 const Identifier& unique_identifier, |
| 58 leveldb::Status* s); | 61 leveldb::Status* s); |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 306 PendingDeleteCallList pending_delete_calls_; | 309 PendingDeleteCallList pending_delete_calls_; |
| 307 | 310 |
| 308 ConnectionSet connections_; | 311 ConnectionSet connections_; |
| 309 | 312 |
| 310 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabase); | 313 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabase); |
| 311 }; | 314 }; |
| 312 | 315 |
| 313 } // namespace content | 316 } // namespace content |
| 314 | 317 |
| 315 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ | 318 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ |
| OLD | NEW |