| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/offline_pages/core/prefetch/prefetch_dispatcher.h" | 9 #include "components/offline_pages/core/prefetch/prefetch_dispatcher.h" |
| 10 | 10 |
| 11 namespace offline_pages { | 11 namespace offline_pages { |
| 12 | 12 |
| 13 class PrefetchDispatcherImpl : public PrefetchDispatcher { | 13 class PrefetchDispatcherImpl : public PrefetchDispatcher { |
| 14 public: | 14 public: |
| 15 PrefetchDispatcherImpl(); | 15 PrefetchDispatcherImpl(); |
| 16 ~PrefetchDispatcherImpl() override; | 16 ~PrefetchDispatcherImpl() override; |
| 17 | 17 |
| 18 // PrefetchDispatcher implementation: | 18 // PrefetchDispatcher implementation: |
| 19 void AddCandidatePrefetchURLs( | 19 void AddCandidatePrefetchURLs( |
| 20 const std::vector<PrefetchURL>& suggested_urls) override; | 20 const std::vector<PrefetchURL>& suggested_urls) override; |
| 21 void RemoveAllUnprocessedPrefetchURLs(const std::string& name_space) override; | 21 void RemoveAllUnprocessedPrefetchURLs(const std::string& name_space) override; |
| 22 void RemovePrefetchURLsByClientId(const ClientId& client_id) override; | 22 void RemovePrefetchURLsByClientId(const ClientId& client_id) override; |
| 23 void BeginBackgroundTask(std::unique_ptr<ScopedBackgroundTask> task) override; | 23 void BeginBackgroundTask(std::unique_ptr<ScopedBackgroundTask> task) override; |
| 24 void StopBackgroundTask(ScopedBackgroundTask* task) override; | 24 void StopBackgroundTask() override; |
| 25 void RequestFinishBackgroundTaskForTest() override; |
| 25 | 26 |
| 26 private: | 27 private: |
| 28 void DisposeTask(); |
| 29 |
| 30 std::unique_ptr<ScopedBackgroundTask> task_; |
| 31 |
| 27 DISALLOW_COPY_AND_ASSIGN(PrefetchDispatcherImpl); | 32 DISALLOW_COPY_AND_ASSIGN(PrefetchDispatcherImpl); |
| 28 }; | 33 }; |
| 29 | 34 |
| 30 } // namespace offline_pages | 35 } // namespace offline_pages |
| 31 | 36 |
| 32 #endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DISPATCHER_IMPL_H_ | 37 #endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DISPATCHER_IMPL_H_ |
| OLD | NEW |