Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: components/offline_pages/core/prefetch/prefetch_dispatcher_impl.cc

Issue 2879013002: Create skeleton for the Prefetching store and initial pipeline step. (Closed)
Patch Set: Dispatcher instance is now injected into Service. Minor changes. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/prefetch/prefetch_service.h"
10 #include "components/offline_pages/core/task.h"
7 #include "url/gurl.h" 11 #include "url/gurl.h"
8 12
9 namespace offline_pages { 13 namespace offline_pages {
10 14
11 PrefetchDispatcherImpl::PrefetchDispatcherImpl() {} 15 PrefetchDispatcherImpl::PrefetchDispatcherImpl() = default;
12 16
13 PrefetchDispatcherImpl::~PrefetchDispatcherImpl() = default; 17 PrefetchDispatcherImpl::~PrefetchDispatcherImpl() = default;
14 18
19 void PrefetchDispatcherImpl::SetService(PrefetchService* service) {
20 CHECK(service);
21 service_ = service;
22 }
23
15 void PrefetchDispatcherImpl::AddCandidatePrefetchURLs( 24 void PrefetchDispatcherImpl::AddCandidatePrefetchURLs(
16 const std::vector<PrefetchURL>& url_suggestions) { 25 const std::string& name_space,
17 NOTIMPLEMENTED(); 26 const std::vector<PrefetchURL>& prefetch_urls) {
27 std::unique_ptr<Task> add_task = base::MakeUnique<AddUniqueUrlsTask>(
28 service_->GetStore(), name_space, prefetch_urls);
29 task_queue_.AddTask(std::move(add_task));
18 } 30 }
31
19 void PrefetchDispatcherImpl::RemoveAllUnprocessedPrefetchURLs( 32 void PrefetchDispatcherImpl::RemoveAllUnprocessedPrefetchURLs(
20 const std::string& name_space) { 33 const std::string& name_space) {
21 NOTIMPLEMENTED(); 34 NOTIMPLEMENTED();
22 } 35 }
23 36
24 void PrefetchDispatcherImpl::RemovePrefetchURLsByClientId( 37 void PrefetchDispatcherImpl::RemovePrefetchURLsByClientId(
25 const ClientId& client_id) { 38 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
39 const std::string& client_id) {
26 NOTIMPLEMENTED(); 40 NOTIMPLEMENTED();
27 } 41 }
28 42
29 void PrefetchDispatcherImpl::BeginBackgroundTask( 43 void PrefetchDispatcherImpl::BeginBackgroundTask(
30 std::unique_ptr<ScopedBackgroundTask> task) { 44 std::unique_ptr<ScopedBackgroundTask> task) {
31 NOTIMPLEMENTED(); 45 NOTIMPLEMENTED();
32 } 46 }
33 47
34 void PrefetchDispatcherImpl::StopBackgroundTask(ScopedBackgroundTask* task) { 48 void PrefetchDispatcherImpl::StopBackgroundTask(ScopedBackgroundTask* task) {
35 NOTIMPLEMENTED(); 49 NOTIMPLEMENTED();
36 } 50 }
37 51
38 } // namespace offline_pages 52 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698