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 #include "components/offline_pages/core/prefetch/prefetch_dispatcher_impl.h" | 5 #include "components/offline_pages/core/prefetch/prefetch_dispatcher_impl.h" |
6 | 6 |
| 7 #include "base/memory/ptr_util.h" |
| 8 #include "components/offline_pages/core/prefetch/add_unique_urls_task.h" |
| 9 #include "components/offline_pages/core/task.h" |
7 #include "url/gurl.h" | 10 #include "url/gurl.h" |
8 | 11 |
9 namespace offline_pages { | 12 namespace offline_pages { |
10 | 13 |
11 PrefetchDispatcherImpl::PrefetchDispatcherImpl() {} | 14 PrefetchDispatcherImpl::PrefetchDispatcherImpl( |
| 15 std::unique_ptr<PrefetchStore> store) |
| 16 : store_(std::move(store)) {} |
12 | 17 |
13 PrefetchDispatcherImpl::~PrefetchDispatcherImpl() = default; | 18 PrefetchDispatcherImpl::~PrefetchDispatcherImpl() = default; |
14 | 19 |
15 void PrefetchDispatcherImpl::AddCandidatePrefetchURLs( | 20 void PrefetchDispatcherImpl::AddCandidatePrefetchURLs( |
16 const std::vector<PrefetchURL>& url_suggestions) { | 21 const std::string& name_space, |
17 NOTIMPLEMENTED(); | 22 const std::vector<PrefetchURL>& prefetch_urls) { |
| 23 std::unique_ptr<Task> add_task = base::MakeUnique<AddUniqueUrlsTask>( |
| 24 store_.get(), name_space, prefetch_urls); |
| 25 task_queue_.AddTask(std::move(add_task)); |
18 } | 26 } |
| 27 |
19 void PrefetchDispatcherImpl::RemoveAllUnprocessedPrefetchURLs( | 28 void PrefetchDispatcherImpl::RemoveAllUnprocessedPrefetchURLs( |
20 const std::string& name_space) { | 29 const std::string& name_space) { |
21 NOTIMPLEMENTED(); | 30 NOTIMPLEMENTED(); |
22 } | 31 } |
23 | 32 |
24 void PrefetchDispatcherImpl::RemovePrefetchURLsByClientId( | 33 void PrefetchDispatcherImpl::RemovePrefetchURLsByClientId( |
25 const ClientId& client_id) { | 34 const std::string& name_space, |
| 35 const std::string& client_id) { |
26 NOTIMPLEMENTED(); | 36 NOTIMPLEMENTED(); |
27 } | 37 } |
28 | 38 |
29 void PrefetchDispatcherImpl::BeginBackgroundTask( | 39 void PrefetchDispatcherImpl::BeginBackgroundTask( |
30 std::unique_ptr<ScopedBackgroundTask> task) { | 40 std::unique_ptr<ScopedBackgroundTask> task) { |
31 NOTIMPLEMENTED(); | 41 NOTIMPLEMENTED(); |
32 } | 42 } |
33 | 43 |
34 void PrefetchDispatcherImpl::StopBackgroundTask(ScopedBackgroundTask* task) { | 44 void PrefetchDispatcherImpl::StopBackgroundTask(ScopedBackgroundTask* task) { |
35 NOTIMPLEMENTED(); | 45 NOTIMPLEMENTED(); |
36 } | 46 } |
37 | 47 |
38 } // namespace offline_pages | 48 } // namespace offline_pages |
OLD | NEW |