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

Unified Diff: chrome/browser/prerender/prerender_manager_factory.cc

Issue 2304953002: NoState Prefetch: nostate prefetch browser tests. (Closed)
Patch Set: histogram tests Created 4 years, 3 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: chrome/browser/prerender/prerender_manager_factory.cc
diff --git a/chrome/browser/prerender/prerender_manager_factory.cc b/chrome/browser/prerender/prerender_manager_factory.cc
index 895e4f4423aeb16456b837311cf50c9027410334..630d81ef5e5c2d68519595d6f3d9f1840f976a82 100644
--- a/chrome/browser/prerender/prerender_manager_factory.cc
+++ b/chrome/browser/prerender/prerender_manager_factory.cc
@@ -21,6 +21,10 @@
namespace prerender {
// static
+PrerenderManagerFactory::PrerenderCreateFunction*
+ PrerenderManagerFactory::testing_create_function_ = nullptr;
+
+// static
PrerenderManager* PrerenderManagerFactory::GetForBrowserContext(
content::BrowserContext* context) {
TRACE_EVENT0("browser", "PrerenderManagerFactory::GetForProfile")
@@ -54,6 +58,10 @@ PrerenderManagerFactory::~PrerenderManagerFactory() {
KeyedService* PrerenderManagerFactory::BuildServiceInstanceFor(
content::BrowserContext* browser_context) const {
+ if (testing_create_function_) {
+ return testing_create_function_(
+ Profile::FromBrowserContext(browser_context));
+ }
return new PrerenderManager(Profile::FromBrowserContext(browser_context));
}

Powered by Google App Engine
This is Rietveld 408576698