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 { |
12 | 16 |
13 class PrefetchDispatcherImpl : public PrefetchDispatcher { | 17 class PrefetchDispatcherImpl : public PrefetchDispatcher { |
14 public: | 18 public: |
15 PrefetchDispatcherImpl(); | 19 PrefetchDispatcherImpl(std::unique_ptr<PrefetchStore> store); |
16 ~PrefetchDispatcherImpl() override; | 20 ~PrefetchDispatcherImpl() override; |
17 | 21 |
18 // PrefetchDispatcher implementation: | 22 // PrefetchDispatcher implementation: |
19 void AddCandidatePrefetchURLs( | 23 void AddCandidatePrefetchURLs( |
20 const std::vector<PrefetchURL>& suggested_urls) override; | 24 const std::string& name_space, |
25 const std::vector<PrefetchURL>& prefetch_urls) override; | |
21 void RemoveAllUnprocessedPrefetchURLs(const std::string& name_space) override; | 26 void RemoveAllUnprocessedPrefetchURLs(const std::string& name_space) override; |
22 void RemovePrefetchURLsByClientId(const ClientId& client_id) override; | 27 void RemovePrefetchURLsByClientId(const std::string& name_space, |
28 const std::string& client_id) override; | |
23 void BeginBackgroundTask(std::unique_ptr<ScopedBackgroundTask> task) override; | 29 void BeginBackgroundTask(std::unique_ptr<ScopedBackgroundTask> task) override; |
24 void StopBackgroundTask(ScopedBackgroundTask* task) override; | 30 void StopBackgroundTask(ScopedBackgroundTask* task) override; |
25 | 31 |
26 private: | 32 private: |
33 friend class PrefetchDispatcherTest; | |
34 | |
35 std::unique_ptr<PrefetchStore> store_; | |
Dmitry Titov
2017/05/18 21:24:02
Should these rather live on PrefetchService and be
carlosk
2017/05/24 20:57:26
Done.
| |
36 TaskQueue task_queue_; | |
37 | |
27 DISALLOW_COPY_AND_ASSIGN(PrefetchDispatcherImpl); | 38 DISALLOW_COPY_AND_ASSIGN(PrefetchDispatcherImpl); |
28 }; | 39 }; |
29 | 40 |
30 } // namespace offline_pages | 41 } // namespace offline_pages |
31 | 42 |
32 #endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DISPATCHER_IMPL_H_ | 43 #endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DISPATCHER_IMPL_H_ |
OLD | NEW |