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

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 2380043002: Do not register synthetic field trial before initializing TaskScheduler. (Closed)
Patch Set: rebase Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 command_line->HasSwitch(switches::kTraceUploadURL)) { 883 command_line->HasSwitch(switches::kTraceUploadURL)) {
884 tracing::SetupNavigationTracing(); 884 tracing::SetupNavigationTracing();
885 } 885 }
886 886
887 // Initialize FieldTrialSynchronizer system. This is a singleton and is used 887 // Initialize FieldTrialSynchronizer system. This is a singleton and is used
888 // for posting tasks via base::Bind. Its deleted when it goes out of scope. 888 // for posting tasks via base::Bind. Its deleted when it goes out of scope.
889 // Even though base::Bind does AddRef and Release, the object will not be 889 // Even though base::Bind does AddRef and Release, the object will not be
890 // deleted after the Task is executed. 890 // deleted after the Task is executed.
891 field_trial_synchronizer_ = new FieldTrialSynchronizer(); 891 field_trial_synchronizer_ = new FieldTrialSynchronizer();
892 892
893 // Register a synthetic field trial for the sampling profiler configuration
894 // that was already chosen.
895 std::string trial_name, group_name;
896 if (sampling_profiler_config_.GetSyntheticFieldTrial(&trial_name,
897 &group_name)) {
898 ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial(trial_name,
899 group_name);
900 }
901
902 #if defined(OS_WIN) || defined(OS_MACOSX) || \ 893 #if defined(OS_WIN) || defined(OS_MACOSX) || \
903 (defined(OS_LINUX) && !defined(OS_CHROMEOS)) 894 (defined(OS_LINUX) && !defined(OS_CHROMEOS))
904 metrics::DesktopSessionDurationTracker::Initialize(); 895 metrics::DesktopSessionDurationTracker::Initialize();
905 #endif 896 #endif
906 897
907 #if defined(OS_WIN) 898 #if defined(OS_WIN)
908 // Cleanup the PreRead field trial registry key. 899 // Cleanup the PreRead field trial registry key.
909 // TODO(fdoray): Remove this when M56 hits stable. 900 // TODO(fdoray): Remove this when M56 hits stable.
910 const base::string16 pre_read_field_trial_registry_path = 901 const base::string16 pre_read_field_trial_registry_path =
robliao 2016/09/30 18:10:56 This is intended to be in this CL or a different C
fdoray 2016/09/30 19:06:40 I did not change this block of code in this CL. I
robliao 2016/09/30 19:08:10 My mistake. I looked at the wrong diff mode!
911 BrowserDistribution::GetDistribution()->GetRegistryPath() + 902 BrowserDistribution::GetDistribution()->GetRegistryPath() +
912 L"\\PreReadFieldTrial"; 903 L"\\PreReadFieldTrial";
913 base::win::RegKey(HKEY_CURRENT_USER, 904 base::win::RegKey(HKEY_CURRENT_USER,
914 pre_read_field_trial_registry_path.c_str(), KEY_SET_VALUE) 905 pre_read_field_trial_registry_path.c_str(), KEY_SET_VALUE)
915 .DeleteKey(L""); 906 .DeleteKey(L"");
916 #endif // defined(OS_WIN) 907 #endif // defined(OS_WIN)
917 } 908 }
918 909
919 void ChromeBrowserMainParts::SetupMetrics() { 910 void ChromeBrowserMainParts::SetupMetrics() {
920 TRACE_EVENT0("startup", "ChromeBrowserMainParts::SetupMetrics"); 911 TRACE_EVENT0("startup", "ChromeBrowserMainParts::SetupMetrics");
(...skipping 19 matching lines...) Expand all
940 break; 931 break;
941 } 932 }
942 } 933 }
943 934
944 void ChromeBrowserMainParts::StartMetricsRecording() { 935 void ChromeBrowserMainParts::StartMetricsRecording() {
945 TRACE_EVENT0("startup", "ChromeBrowserMainParts::StartMetricsRecording"); 936 TRACE_EVENT0("startup", "ChromeBrowserMainParts::StartMetricsRecording");
946 937
947 g_browser_process->metrics_service()->CheckForClonedInstall( 938 g_browser_process->metrics_service()->CheckForClonedInstall(
948 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)); 939 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE));
949 940
941 // Register a synthetic field trial for the sampling profiler configuration
942 // that was already chosen.
943 std::string trial_name, group_name;
944 if (sampling_profiler_config_.GetSyntheticFieldTrial(&trial_name,
945 &group_name)) {
946 ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial(trial_name,
947 group_name);
948 }
949
950 g_browser_process->GetMetricsServicesManager()->UpdateUploadPermissions(true); 950 g_browser_process->GetMetricsServicesManager()->UpdateUploadPermissions(true);
951 } 951 }
952 952
953 void ChromeBrowserMainParts::RecordBrowserStartupTime() { 953 void ChromeBrowserMainParts::RecordBrowserStartupTime() {
954 // Don't record any metrics if UI was displayed before this point e.g. 954 // Don't record any metrics if UI was displayed before this point e.g.
955 // warning dialogs. 955 // warning dialogs.
956 if (startup_metric_utils::WasNonBrowserUIDisplayed()) 956 if (startup_metric_utils::WasNonBrowserUIDisplayed())
957 return; 957 return;
958 958
959 bool is_first_run = false; 959 bool is_first_run = false;
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after
2223 chromeos::CrosSettings::Shutdown(); 2223 chromeos::CrosSettings::Shutdown();
2224 #endif // defined(OS_CHROMEOS) 2224 #endif // defined(OS_CHROMEOS)
2225 #endif // defined(OS_ANDROID) 2225 #endif // defined(OS_ANDROID)
2226 } 2226 }
2227 2227
2228 // Public members: 2228 // Public members:
2229 2229
2230 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 2230 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
2231 chrome_extra_parts_.push_back(parts); 2231 chrome_extra_parts_.push_back(parts);
2232 } 2232 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698