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

Unified 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: Made construction params a cost&. Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
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..bad8687c24ab51a2db3a3ae9e64151db24924d2a 100644
--- a/components/offline_pages/core/prefetch/prefetch_dispatcher_impl.cc
+++ b/components/offline_pages/core/prefetch/prefetch_dispatcher_impl.cc
@@ -4,18 +4,29 @@
#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 "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::vector<PrefetchURL>& prefetch_urls) {
+ std::unique_ptr<Task> add_task = base::MakeUnique<AddUniqueUrlsTask>(
+ service_->GetPrefetchStore(), prefetch_urls);
+ task_queue_.AddTask(std::move(add_task));
}
+
void PrefetchDispatcherImpl::RemoveAllUnprocessedPrefetchURLs(
const std::string& name_space) {
NOTIMPLEMENTED();

Powered by Google App Engine
This is Rietveld 408576698