OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DISPATCHER_IMPL_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DISPATCHER_IMPL_H_ |
6 #define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DISPATCHER_IMPL_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DISPATCHER_IMPL_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "components/offline_pages/core/prefetch/prefetch_dispatcher.h" | 11 #include "components/offline_pages/core/prefetch/prefetch_dispatcher.h" |
| 12 #include "components/offline_pages/core/prefetch/prefetch_store.h" |
| 13 #include "components/offline_pages/core/task_queue.h" |
10 | 14 |
11 namespace offline_pages { | 15 namespace offline_pages { |
| 16 class PrefetchService; |
12 | 17 |
13 class PrefetchDispatcherImpl : public PrefetchDispatcher { | 18 class PrefetchDispatcherImpl : public PrefetchDispatcher { |
14 public: | 19 public: |
15 PrefetchDispatcherImpl(); | 20 PrefetchDispatcherImpl(); |
16 ~PrefetchDispatcherImpl() override; | 21 ~PrefetchDispatcherImpl() override; |
17 | 22 |
18 // PrefetchDispatcher implementation: | 23 // PrefetchDispatcher implementation: |
| 24 void SetService(PrefetchService* service) override; |
19 void AddCandidatePrefetchURLs( | 25 void AddCandidatePrefetchURLs( |
20 const std::vector<PrefetchURL>& suggested_urls) override; | 26 const std::string& name_space, |
| 27 const std::vector<PrefetchURL>& prefetch_urls) override; |
21 void RemoveAllUnprocessedPrefetchURLs(const std::string& name_space) override; | 28 void RemoveAllUnprocessedPrefetchURLs(const std::string& name_space) override; |
22 void RemovePrefetchURLsByClientId(const ClientId& client_id) override; | 29 void RemovePrefetchURLsByClientId(const std::string& name_space, |
| 30 const std::string& client_id) override; |
23 void BeginBackgroundTask(std::unique_ptr<ScopedBackgroundTask> task) override; | 31 void BeginBackgroundTask(std::unique_ptr<ScopedBackgroundTask> task) override; |
24 void StopBackgroundTask(ScopedBackgroundTask* task) override; | 32 void StopBackgroundTask(ScopedBackgroundTask* task) override; |
25 | 33 |
26 private: | 34 private: |
| 35 friend class PrefetchDispatcherTest; |
| 36 |
| 37 PrefetchService* service_; |
| 38 TaskQueue task_queue_; |
| 39 |
27 DISALLOW_COPY_AND_ASSIGN(PrefetchDispatcherImpl); | 40 DISALLOW_COPY_AND_ASSIGN(PrefetchDispatcherImpl); |
28 }; | 41 }; |
29 | 42 |
30 } // namespace offline_pages | 43 } // namespace offline_pages |
31 | 44 |
32 #endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DISPATCHER_IMPL_H_ | 45 #endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DISPATCHER_IMPL_H_ |
OLD | NEW |