Chromium Code Reviews| 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 #ifndef CONTENT_BROWSER_INDEXED_DB_DATABASE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_DATABASE_IMPL_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_DATABASE_IMPL_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_DATABASE_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "content/common/indexed_db/indexed_db.mojom.h" | 10 #include "content/common/indexed_db/indexed_db.mojom.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 class IndexedDBConnection; | 14 class IndexedDBConnection; |
| 15 class IndexedDBDispatcherHost; | 15 class IndexedDBDispatcherHost; |
| 16 | 16 |
| 17 class DatabaseImpl : public ::indexed_db::mojom::Database { | 17 class DatabaseImpl : public ::indexed_db::mojom::Database { |
| 18 public: | 18 public: |
| 19 explicit DatabaseImpl(std::unique_ptr<IndexedDBConnection> connection, | 19 explicit DatabaseImpl(std::unique_ptr<IndexedDBConnection> connection, |
| 20 const url::Origin& origin, | 20 const url::Origin& origin, |
| 21 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host); | 21 IndexedDBDispatcherHost* dispatcher_host); |
| 22 ~DatabaseImpl() override; | 22 ~DatabaseImpl() override; |
| 23 | 23 |
| 24 // ::indexed_db::mojom::Database implementation | 24 // ::indexed_db::mojom::Database implementation |
| 25 void CreateObjectStore(int64_t transaction_id, | 25 void CreateObjectStore(int64_t transaction_id, |
| 26 int64_t object_store_id, | 26 int64_t object_store_id, |
| 27 const base::string16& name, | 27 const base::string16& name, |
| 28 const IndexedDBKeyPath& key_path, | 28 const IndexedDBKeyPath& key_path, |
| 29 bool auto_increment) override; | 29 bool auto_increment) override; |
| 30 void DeleteObjectStore(int64_t transaction_id, | 30 void DeleteObjectStore(int64_t transaction_id, |
| 31 int64_t object_store_id) override; | 31 int64_t object_store_id) override; |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 53 void GetAll( | 53 void GetAll( |
| 54 int64_t transaction_id, | 54 int64_t transaction_id, |
| 55 int64_t object_store_id, | 55 int64_t object_store_id, |
| 56 int64_t index_id, | 56 int64_t index_id, |
| 57 const IndexedDBKeyRange& key_range, | 57 const IndexedDBKeyRange& key_range, |
| 58 bool key_only, | 58 bool key_only, |
| 59 int64_t max_count, | 59 int64_t max_count, |
| 60 ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks) override; | 60 ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks) override; |
| 61 void Put(int64_t transaction_id, | 61 void Put(int64_t transaction_id, |
| 62 int64_t object_store_id, | 62 int64_t object_store_id, |
| 63 indexed_db::mojom::ValuePtr value, | 63 ::indexed_db::mojom::ValuePtr value, |
| 64 const IndexedDBKey& key, | 64 const IndexedDBKey& key, |
| 65 blink::WebIDBPutMode mode, | 65 blink::WebIDBPutMode mode, |
| 66 const std::vector<IndexedDBIndexKeys>& index_keys, | 66 const std::vector<IndexedDBIndexKeys>& index_keys, |
| 67 ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks) override; | 67 ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks) override; |
| 68 void SetIndexKeys(int64_t transaction_id, | 68 void SetIndexKeys(int64_t transaction_id, |
| 69 int64_t object_store_id, | 69 int64_t object_store_id, |
| 70 const IndexedDBKey& primary_key, | 70 const IndexedDBKey& primary_key, |
| 71 const std::vector<IndexedDBIndexKeys>& index_keys) override; | 71 const std::vector<IndexedDBIndexKeys>& index_keys) override; |
| 72 void SetIndexesReady(int64_t transaction_id, | 72 void SetIndexesReady(int64_t transaction_id, |
| 73 int64_t object_store_id, | 73 int64_t object_store_id, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 int64_t index_id, | 111 int64_t index_id, |
| 112 const base::string16& new_name) override; | 112 const base::string16& new_name) override; |
| 113 void Abort(int64_t transaction_id) override; | 113 void Abort(int64_t transaction_id) override; |
| 114 void Commit(int64_t transaction_id) override; | 114 void Commit(int64_t transaction_id) override; |
| 115 void AckReceivedBlobs(const std::vector<std::string>& uuids) override; | 115 void AckReceivedBlobs(const std::vector<std::string>& uuids) override; |
| 116 | 116 |
| 117 private: | 117 private: |
| 118 class IDBThreadHelper; | 118 class IDBThreadHelper; |
| 119 | 119 |
| 120 IDBThreadHelper* helper_; | 120 IDBThreadHelper* helper_; |
| 121 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; | 121 IndexedDBDispatcherHost* dispatcher_host_; |
|
Reilly Grant (use Gerrit)
2017/03/03 01:59:59
Add comment:
// This raw pointer is safe because
dmurph
2017/03/04 00:39:41
Done.
| |
| 122 const url::Origin origin_; | 122 const url::Origin origin_; |
| 123 scoped_refptr<base::SingleThreadTaskRunner> idb_runner_; | 123 scoped_refptr<base::SingleThreadTaskRunner> idb_runner_; |
| 124 | 124 |
| 125 DISALLOW_COPY_AND_ASSIGN(DatabaseImpl); | 125 DISALLOW_COPY_AND_ASSIGN(DatabaseImpl); |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 } // namespace content | 128 } // namespace content |
| 129 | 129 |
| 130 #endif // CONTENT_BROWSER_INDEXED_DB_DATABASE_IMPL_H_ | 130 #endif // CONTENT_BROWSER_INDEXED_DB_DATABASE_IMPL_H_ |
| OLD | NEW |