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

Unified Diff: components/offline_pages/content/prefetch_service_factory.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, 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/content/prefetch_service_factory.cc
diff --git a/components/offline_pages/content/prefetch_service_factory.cc b/components/offline_pages/content/prefetch_service_factory.cc
index ffe46b2630825585089479fcd31dfa4165481b54..16247f86e049d2c2248b755cedb229fd79c4f043 100644
--- a/components/offline_pages/content/prefetch_service_factory.cc
+++ b/components/offline_pages/content/prefetch_service_factory.cc
@@ -4,9 +4,14 @@
#include "components/offline_pages/content/prefetch_service_factory.h"
+#include <memory>
+
+#include "base/memory/ptr_util.h"
#include "base/memory/singleton.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "components/offline_pages/core/prefetch/prefetch_dispatcher_impl.h"
#include "components/offline_pages/core/prefetch/prefetch_service_impl.h"
+#include "components/offline_pages/core/prefetch/prefetch_store.h"
#include "content/public/browser/browser_context.h"
namespace offline_pages {
@@ -30,7 +35,12 @@ PrefetchService* PrefetchServiceFactory::GetForBrowserContext(
KeyedService* PrefetchServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
- return new PrefetchServiceImpl();
+ // TODO(carlosk): instantiate actual store implementation once it exists.
+ std::unique_ptr<PrefetchStore> prefetch_store;
+ std::unique_ptr<PrefetchDispatcher> prefetch_dispatcher_impl =
fgorski 2017/05/30 17:21:45 nit: prefetch_dispatcher would be suitable I guess
carlosk 2017/06/01 01:49:59 As here it is specifically an instance of the impl
+ base::MakeUnique<PrefetchDispatcherImpl>();
+ return new PrefetchServiceImpl(std::move(prefetch_store),
+ std::move(prefetch_dispatcher_impl));
}
} // namespace offline_pages

Powered by Google App Engine
This is Rietveld 408576698