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

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

Issue 7360001: Allow one-time randomization in field trials to work even if metrics are disabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Build fix Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/metrics/metrics_service.h » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser_main.h" 5 #include "chrome/browser/browser_main.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 // This will be called after the command-line has been mutated by about:flags 266 // This will be called after the command-line has been mutated by about:flags
267 MetricsService* BrowserMainParts::SetupMetricsAndFieldTrials( 267 MetricsService* BrowserMainParts::SetupMetricsAndFieldTrials(
268 const CommandLine& parsed_command_line, 268 const CommandLine& parsed_command_line,
269 PrefService* local_state) { 269 PrefService* local_state) {
270 // Must initialize metrics after labs have been converted into switches, 270 // Must initialize metrics after labs have been converted into switches,
271 // but before field trials are set up (so that client ID is available for 271 // but before field trials are set up (so that client ID is available for
272 // one-time randomized field trials). 272 // one-time randomized field trials).
273 MetricsService* metrics = InitializeMetrics(parsed_command_line, local_state); 273 MetricsService* metrics = InitializeMetrics(parsed_command_line, local_state);
274 274
275 // Initialize FieldTrialList to support FieldTrials that use one-time 275 // Initialize FieldTrialList to support FieldTrials that use one-time
276 // randomization. The client ID will be empty if the user has not opted 276 // randomization. The client ID will not be empty even if the user has not
jar (doing other things) 2011/07/18 17:33:49 This appears problematic from a privacy perspectiv
277 // to send metrics. 277 // opted to send metrics.
278 field_trial_list_.reset(new base::FieldTrialList(metrics->GetClientId())); 278 field_trial_list_.reset(
279 new base::FieldTrialList(metrics->GetClientIdNonEmpty()));
279 280
280 SetupFieldTrials(metrics->recording_active(), 281 SetupFieldTrials(metrics->recording_active(),
281 local_state->IsManagedPreference( 282 local_state->IsManagedPreference(
282 prefs::kMaxConnectionsPerProxy)); 283 prefs::kMaxConnectionsPerProxy));
283 284
284 // Initialize FieldTrialSynchronizer system. This is a singleton and is used 285 // Initialize FieldTrialSynchronizer system. This is a singleton and is used
285 // for posting tasks via NewRunnableMethod. Its deleted when it goes out of 286 // for posting tasks via NewRunnableMethod. Its deleted when it goes out of
286 // scope. Even though NewRunnableMethod does AddRef and Release, the object 287 // scope. Even though NewRunnableMethod does AddRef and Release, the object
287 // will not be deleted after the Task is executed. 288 // will not be deleted after the Task is executed.
288 field_trial_synchronizer_ = new FieldTrialSynchronizer(); 289 field_trial_synchronizer_ = new FieldTrialSynchronizer();
(...skipping 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after
2086 #if defined(OS_CHROMEOS) 2087 #if defined(OS_CHROMEOS)
2087 // To be precise, logout (browser shutdown) is not yet done, but the 2088 // To be precise, logout (browser shutdown) is not yet done, but the
2088 // remaining work is negligible, hence we say LogoutDone here. 2089 // remaining work is negligible, hence we say LogoutDone here.
2089 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", 2090 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone",
2090 false); 2091 false);
2091 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); 2092 chromeos::BootTimesLoader::Get()->WriteLogoutTimes();
2092 #endif 2093 #endif
2093 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); 2094 TRACE_EVENT_END_ETW("BrowserMain", 0, 0);
2094 return result_code; 2095 return result_code;
2095 } 2096 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/metrics/metrics_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698