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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 23534009: Re-enable pre-read experiment as a finch field trial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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
« chrome/app/client_util.cc ('K') | « chrome/app/client_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index e8612a18a4d7a25953c8afaf9187d781462b4dd1..1d374d183f887736167e925fed3ebbaa0cc2f348 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -707,38 +707,28 @@ void ChromeBrowserMainParts::RecordBrowserStartupTime() {
new LoadCompleteListener();
}
-// This code is specific to the Windows-only PreReadExperiment field-trial.
void ChromeBrowserMainParts::RecordPreReadExperimentTime(const char* name,
base::TimeDelta time) {
DCHECK(name != NULL);
- // This gets called with different histogram names, so we don't want to use
- // the UMA_HISTOGRAM_CUSTOM_TIMES macro--it uses a static variable, and the
- // first call wins.
- AddPreReadHistogramTime(name, time);
-
#if defined(OS_WIN)
#if defined(GOOGLE_CHROME_BUILD)
- // The pre-read experiment is Windows and Google Chrome specific.
+ // The pre-read experiment is Windows and Google Chrome specific. Only
+ // initialize the field-trial if the experiment is running (environment
+ // variable is set, and valid).
scoped_ptr<base::Environment> env(base::Environment::Create());
-
- // Only record the sub-histogram result if the experiment is running
- // (environment variable is set, and valid).
- std::string pre_read_percentage;
- if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read_percentage)) {
- std::string uma_name(name);
-
- // We want XP to record a separate histogram, as the loader on XP
- // is very different from the Vista and Win7 loaders.
- if (base::win::GetVersion() <= base::win::VERSION_XP)
- uma_name += "_XP";
-
- uma_name += "_PreRead_";
- uma_name += pre_read_percentage;
- AddPreReadHistogramTime(uma_name.c_str(), time);
+ std::string pre_read_group;
+ if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read_group)) {
Alexei Svitkine (slow) 2013/08/28 17:30:50 We have a script that parses source code to extrac
Roger McFarlane (Chromium) 2013/08/29 15:28:37 I've pulled this out to chrome_browser_field_trial
+ static const char kPreReadTrialName[] = "BrowserPreReadExperiment";
+ base::FieldTrialList::CreateFieldTrial(kPreReadTrialName, pre_read_group);
Alexei Svitkine (slow) 2013/08/28 17:30:50 You need to call group() on returned FieldTrial* o
Roger McFarlane (Chromium) 2013/08/29 15:28:37 Having created a setup function for the experiment
}
#endif
#endif
+
+ // This gets called with different histogram names, so we don't want to use
+ // the UMA_HISTOGRAM_CUSTOM_TIMES macro--it uses a static variable, and the
+ // first call wins.
+ AddPreReadHistogramTime(name, time);
}
// -----------------------------------------------------------------------------
« chrome/app/client_util.cc ('K') | « chrome/app/client_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698