Chromium Code Reviews| Index: components/offline_pages/core/prefetch/prefetch_dispatcher_impl.cc |
| diff --git a/components/offline_pages/core/prefetch/prefetch_dispatcher_impl.cc b/components/offline_pages/core/prefetch/prefetch_dispatcher_impl.cc |
| index 3c84ca5e937b4883abca3ce91a3b0e33a1b890bf..164619728631fea2bf4175c9db35d638b5530128 100644 |
| --- a/components/offline_pages/core/prefetch/prefetch_dispatcher_impl.cc |
| +++ b/components/offline_pages/core/prefetch/prefetch_dispatcher_impl.cc |
| @@ -4,25 +4,39 @@ |
| #include "components/offline_pages/core/prefetch/prefetch_dispatcher_impl.h" |
| +#include "base/memory/ptr_util.h" |
| +#include "components/offline_pages/core/prefetch/add_unique_urls_task.h" |
| +#include "components/offline_pages/core/prefetch/prefetch_service.h" |
| +#include "components/offline_pages/core/task.h" |
| #include "url/gurl.h" |
| namespace offline_pages { |
| -PrefetchDispatcherImpl::PrefetchDispatcherImpl() {} |
| +PrefetchDispatcherImpl::PrefetchDispatcherImpl() = default; |
| PrefetchDispatcherImpl::~PrefetchDispatcherImpl() = default; |
| +void PrefetchDispatcherImpl::SetService(PrefetchService* service) { |
| + CHECK(service); |
| + service_ = service; |
| +} |
| + |
| void PrefetchDispatcherImpl::AddCandidatePrefetchURLs( |
| - const std::vector<PrefetchURL>& url_suggestions) { |
| - NOTIMPLEMENTED(); |
| + const std::string& name_space, |
| + const std::vector<PrefetchURL>& prefetch_urls) { |
| + std::unique_ptr<Task> add_task = base::MakeUnique<AddUniqueUrlsTask>( |
| + service_->GetStore(), name_space, prefetch_urls); |
| + task_queue_.AddTask(std::move(add_task)); |
| } |
| + |
| void PrefetchDispatcherImpl::RemoveAllUnprocessedPrefetchURLs( |
| const std::string& name_space) { |
| NOTIMPLEMENTED(); |
| } |
| void PrefetchDispatcherImpl::RemovePrefetchURLsByClientId( |
| - const ClientId& client_id) { |
| + const std::string& name_space, |
|
fgorski
2017/05/30 17:21:45
why are you making this change? (I think I lack co
carlosk
2017/06/01 01:49:59
Reverted to using a generalized version of ClientI
|
| + const std::string& client_id) { |
| NOTIMPLEMENTED(); |
| } |