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

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: rebase Created 7 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/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 8f70eff8f12122bb3b98729ee3ddf2fd20dedf1d..a17f551515e993c6ff97e0aa73f3df874b7dc64a 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -366,20 +366,6 @@ OSStatus KeychainCallback(SecKeychainEvent keychain_event,
}
#endif
-// This code is specific to the Windows-only PreReadExperiment field-trial.
-void AddPreReadHistogramTime(const char* name, base::TimeDelta time) {
- const base::TimeDelta kMin(base::TimeDelta::FromMilliseconds(1));
- const base::TimeDelta kMax(base::TimeDelta::FromHours(1));
- static const size_t kBuckets(100);
-
- // FactoryTimeGet will always return a pointer to the same histogram object,
- // keyed on its name. There's no need for us to store it explicitly anywhere.
- base::HistogramBase* counter = base::Histogram::FactoryTimeGet(
- name, kMin, kMax, kBuckets, base::Histogram::kUmaTargetedHistogramFlag);
-
- counter->AddTime(time);
-}
-
void RegisterComponentsForUpdate(const CommandLine& command_line) {
ComponentUpdateService* cus = g_browser_process->component_updater();
@@ -703,8 +689,8 @@ void ChromeBrowserMainParts::RecordBrowserStartupTime() {
base::CurrentProcessInfo::CreationTime();
if (!is_first_run && !process_creation_time.is_null()) {
- RecordPreReadExperimentTime("Startup.BrowserMessageLoopStartTime",
- base::Time::Now() - process_creation_time);
+ base::TimeDelta delay = base::Time::Now() - process_creation_time;
+ UMA_HISTOGRAM_LONG_TIMES_100("Startup.BrowserMessageLoopStartTime", delay);
}
#endif // defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX)
@@ -715,40 +701,6 @@ 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.
- 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);
- }
-#endif
-#endif
-}
-
// -----------------------------------------------------------------------------
// TODO(viettrungluu): move more/rest of BrowserMain() into BrowserMainParts.
@@ -1561,8 +1513,8 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
parameters().autorelease_pool->Recycle();
#endif
- RecordPreReadExperimentTime("Startup.BrowserOpenTabs",
- base::TimeTicks::Now() - browser_open_start);
+ base::TimeDelta delay = base::TimeTicks::Now() - browser_open_start;
+ UMA_HISTOGRAM_LONG_TIMES_100("Startup.BrowserOpenTabs", delay);
// If we're running tests (ui_task is non-null), then we don't want to
// call FetchLanguageListFromTranslateServer or
« chrome/app/client_util.cc ('K') | « chrome/browser/chrome_browser_field_trials_desktop.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698