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

Side by Side 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: Declare all of the experiment groups... and other refactorings. 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #if defined(TOOLKIT_GTK) 7 #if defined(TOOLKIT_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 } 700 }
701 #endif // defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX) 701 #endif // defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX)
702 702
703 // Record collected startup metrics. 703 // Record collected startup metrics.
704 startup_metric_utils::OnBrowserStartupComplete(is_first_run); 704 startup_metric_utils::OnBrowserStartupComplete(is_first_run);
705 705
706 // Deletes self. 706 // Deletes self.
707 new LoadCompleteListener(); 707 new LoadCompleteListener();
708 } 708 }
709 709
710 // This code is specific to the Windows-only PreReadExperiment field-trial.
711 void ChromeBrowserMainParts::RecordPreReadExperimentTime(const char* name, 710 void ChromeBrowserMainParts::RecordPreReadExperimentTime(const char* name,
712 base::TimeDelta time) { 711 base::TimeDelta time) {
713 DCHECK(name != NULL); 712 DCHECK(name != NULL);
714 713
715 // This gets called with different histogram names, so we don't want to use 714 // This gets called with different histogram names, so we don't want to use
716 // the UMA_HISTOGRAM_CUSTOM_TIMES macro--it uses a static variable, and the 715 // the UMA_HISTOGRAM_CUSTOM_TIMES macro--it uses a static variable, and the
717 // first call wins. 716 // first call wins.
718 AddPreReadHistogramTime(name, time); 717 AddPreReadHistogramTime(name, time);
Roger McFarlane (Chromium) 2013/08/29 15:28:37 As this function has now been reduced to nothing,
Alexei Svitkine (slow) 2013/08/29 17:44:05 I agree, it should just be replaced with an equiva
Roger McFarlane (Chromium) 2013/08/30 21:27:37 Done.
719
720 #if defined(OS_WIN)
721 #if defined(GOOGLE_CHROME_BUILD)
722 // The pre-read experiment is Windows and Google Chrome specific.
723 scoped_ptr<base::Environment> env(base::Environment::Create());
724
725 // Only record the sub-histogram result if the experiment is running
726 // (environment variable is set, and valid).
727 std::string pre_read_percentage;
728 if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read_percentage)) {
729 std::string uma_name(name);
730
731 // We want XP to record a separate histogram, as the loader on XP
732 // is very different from the Vista and Win7 loaders.
733 if (base::win::GetVersion() <= base::win::VERSION_XP)
734 uma_name += "_XP";
735
736 uma_name += "_PreRead_";
737 uma_name += pre_read_percentage;
738 AddPreReadHistogramTime(uma_name.c_str(), time);
739 }
740 #endif
741 #endif
742 } 718 }
743 719
744 // ----------------------------------------------------------------------------- 720 // -----------------------------------------------------------------------------
745 // TODO(viettrungluu): move more/rest of BrowserMain() into BrowserMainParts. 721 // TODO(viettrungluu): move more/rest of BrowserMain() into BrowserMainParts.
746 722
747 #if defined(OS_WIN) 723 #if defined(OS_WIN)
748 #define DLLEXPORT __declspec(dllexport) 724 #define DLLEXPORT __declspec(dllexport)
749 725
750 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. 726 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling.
751 extern "C" { 727 extern "C" {
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 chromeos::CrosSettings::Shutdown(); 1676 chromeos::CrosSettings::Shutdown();
1701 #endif 1677 #endif
1702 #endif 1678 #endif
1703 } 1679 }
1704 1680
1705 // Public members: 1681 // Public members:
1706 1682
1707 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1683 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1708 chrome_extra_parts_.push_back(parts); 1684 chrome_extra_parts_.push_back(parts);
1709 } 1685 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698