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_CURSOR_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_CURSOR_IMPL_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_CURSOR_IMPL_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_CURSOR_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "content/common/indexed_db/indexed_db.mojom.h" | 11 #include "content/common/indexed_db/indexed_db.mojom.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class SingleThreadTaskRunner; | 14 class SingleThreadTaskRunner; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 | 18 |
| 19 class IndexedDBCursor; | 19 class IndexedDBCursor; |
| 20 class IndexedDBDispatcherHost; | 20 class IndexedDBDispatcherHost; |
| 21 class IndexedDBKey; | 21 class IndexedDBKey; |
| 22 | 22 |
| 23 class CursorImpl : public ::indexed_db::mojom::Cursor { | 23 class CursorImpl : public ::indexed_db::mojom::Cursor { |
| 24 public: | 24 public: |
| 25 CursorImpl(std::unique_ptr<IndexedDBCursor> cursor, | 25 CursorImpl(std::unique_ptr<IndexedDBCursor> cursor, |
| 26 const url::Origin& origin, | 26 const url::Origin& origin, |
| 27 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host); | 27 IndexedDBDispatcherHost* dispatcher_host); |
| 28 ~CursorImpl() override; | 28 ~CursorImpl() override; |
| 29 | 29 |
| 30 // ::indexed_db::mojom::Cursor implementation | 30 // ::indexed_db::mojom::Cursor implementation |
| 31 void Advance( | 31 void Advance( |
| 32 uint32_t count, | 32 uint32_t count, |
| 33 ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks) override; | 33 ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks) override; |
| 34 void Continue( | 34 void Continue( |
| 35 const IndexedDBKey& key, | 35 const IndexedDBKey& key, |
| 36 const IndexedDBKey& primary_key, | 36 const IndexedDBKey& primary_key, |
| 37 ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks) override; | 37 ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks) override; |
| 38 void Prefetch( | 38 void Prefetch( |
| 39 int32_t count, | 39 int32_t count, |
| 40 ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks) override; | 40 ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks) override; |
| 41 void PrefetchReset( | 41 void PrefetchReset( |
| 42 int32_t used_prefetches, | 42 int32_t used_prefetches, |
| 43 int32_t unused_prefetches, | 43 int32_t unused_prefetches, |
| 44 const std::vector<std::string>& unused_blob_uuids) override; | 44 const std::vector<std::string>& unused_blob_uuids) override; |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 class IDBThreadHelper; | 47 class IDBThreadHelper; |
| 48 | 48 |
| 49 IDBThreadHelper* helper_; | 49 IDBThreadHelper* helper_; |
| 50 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; | 50 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.
| |
| 51 const url::Origin origin_; | 51 const url::Origin origin_; |
| 52 scoped_refptr<base::SingleThreadTaskRunner> idb_runner_; | 52 scoped_refptr<base::SingleThreadTaskRunner> idb_runner_; |
| 53 | 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(CursorImpl); | 54 DISALLOW_COPY_AND_ASSIGN(CursorImpl); |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } // namespace content | 57 } // namespace content |
| 58 | 58 |
| 59 #endif // CONTENT_BROWSER_INDEXED_DB_CURSOR_IMPL_H_ | 59 #endif // CONTENT_BROWSER_INDEXED_DB_CURSOR_IMPL_H_ |
| OLD | NEW |