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

Unified Diff: chrome/browser/predictors/resource_prefetch_predictor.cc

Issue 10752006: Adding a field trial to enable speculative resource prefetching learning. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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/predictors/resource_prefetch_predictor.cc
diff --git a/chrome/browser/predictors/resource_prefetch_predictor.cc b/chrome/browser/predictors/resource_prefetch_predictor.cc
index 44bf63acf597a3011dd4e1399eaf5358cafc3102..5f247e0151d04ad6f3cc1ed8c07f0dfe897ad7d6 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor.cc
+++ b/chrome/browser/predictors/resource_prefetch_predictor.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/history/url_database.h"
#include "chrome/browser/predictors/predictor_database.h"
#include "chrome/browser/predictors/predictor_database_factory.h"
+#include "chrome/browser/prerender/prerender_field_trial.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
@@ -114,10 +115,8 @@ ResourcePrefetchPredictor::~ResourcePrefetchPredictor() {
}
// static
-bool ResourcePrefetchPredictor::IsEnabled() {
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- return command_line->HasSwitch(
- switches::kEnableSpeculativeResourcePrefetching);
+bool ResourcePrefetchPredictor::IsEnabled(Profile* profile) {
+ return prerender::IsSpeculativeResourcePrefetchingLearningEnabled(profile);
}
void ResourcePrefetchPredictor::LazilyInitialize() {

Powered by Google App Engine
This is Rietveld 408576698