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

Unified Diff: components/offline_pages/core/prefetch/prefetch_dispatcher_impl.cc

Issue 2920083002: Prefetching: Introduce store commands abstractions to be used by tasks. (Closed)
Patch Set: Added TODO for NWake 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 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 ae20c6239da74ffa9e481a3a30ab8236bc0dad85..59dfc5ff4e3099056fd99fa5db5d66dad7267260 100644
--- a/components/offline_pages/core/prefetch/prefetch_dispatcher_impl.cc
+++ b/components/offline_pages/core/prefetch/prefetch_dispatcher_impl.cc
@@ -13,6 +13,7 @@
#include "components/offline_pages/core/offline_page_feature.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/prefetch/store/prefetch_store_command_factory.h"
#include "url/gurl.h"
namespace offline_pages {
@@ -34,12 +35,16 @@ void PrefetchDispatcherImpl::SetService(PrefetchService* service) {
}
void PrefetchDispatcherImpl::AddCandidatePrefetchURLs(
+ const std::string& name_space,
const std::vector<PrefetchURL>& prefetch_urls) {
if (!IsPrefetchingOfflinePagesEnabled())
return;
+ PrefetchStoreCommandFactory* command_factory =
+ service_->GetPrefetchStoreCommandFactory();
std::unique_ptr<Task> add_task = base::MakeUnique<AddUniqueUrlsTask>(
- service_->GetPrefetchStore(), prefetch_urls);
+ command_factory->createAddUrls(), command_factory->createCleanupZombies(),
+ name_space, prefetch_urls);
task_queue_.AddTask(std::move(add_task));
}

Powered by Google App Engine
This is Rietveld 408576698