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

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

Issue 10830318: Use a different algorithm with the low entropy source for field trials. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/metrics/field_trial_unittest.cc ('k') | chrome/browser/chrome_browser_main_unittest.cc » ('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) 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 <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 #endif // defined(OS_WIN) 540 #endif // defined(OS_WIN)
541 541
542 // Initialize FieldTrialList to support FieldTrials that use one-time 542 // Initialize FieldTrialList to support FieldTrials that use one-time
543 // randomization. 543 // randomization.
544 MetricsService* metrics = browser_process_->metrics_service(); 544 MetricsService* metrics = browser_process_->metrics_service();
545 bool metrics_reporting_enabled = IsMetricsReportingEnabled(); 545 bool metrics_reporting_enabled = IsMetricsReportingEnabled();
546 if (metrics_reporting_enabled) 546 if (metrics_reporting_enabled)
547 metrics->ForceClientIdCreation(); // Needed below. 547 metrics->ForceClientIdCreation(); // Needed below.
548 field_trial_list_.reset( 548 field_trial_list_.reset(
549 new base::FieldTrialList( 549 new base::FieldTrialList(
550 metrics->GetEntropySource(metrics_reporting_enabled))); 550 metrics->CreateEntropyProvider(metrics_reporting_enabled).release()));
551 551
552 // Ensure any field trials specified on the command line are initialized. 552 // Ensure any field trials specified on the command line are initialized.
553 // Also stop the metrics service so that we don't pollute UMA. 553 // Also stop the metrics service so that we don't pollute UMA.
554 #ifndef NDEBUG 554 #ifndef NDEBUG
555 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 555 const CommandLine* command_line = CommandLine::ForCurrentProcess();
556 if (command_line->HasSwitch(switches::kForceFieldTrials)) { 556 if (command_line->HasSwitch(switches::kForceFieldTrials)) {
557 std::string persistent = command_line->GetSwitchValueASCII( 557 std::string persistent = command_line->GetSwitchValueASCII(
558 switches::kForceFieldTrials); 558 switches::kForceFieldTrials);
559 bool ret = base::FieldTrialList::CreateTrialsFromString(persistent); 559 bool ret = base::FieldTrialList::CreateTrialsFromString(persistent);
560 CHECK(ret) << "Invalid --" << switches::kForceFieldTrials << 560 CHECK(ret) << "Invalid --" << switches::kForceFieldTrials <<
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1560 if (base::win::GetVersion() <= base::win::VERSION_XP) 1560 if (base::win::GetVersion() <= base::win::VERSION_XP)
1561 uma_name += "_XP"; 1561 uma_name += "_XP";
1562 1562
1563 uma_name += "_PreRead_"; 1563 uma_name += "_PreRead_";
1564 uma_name += pre_read_percentage; 1564 uma_name += pre_read_percentage;
1565 AddPreReadHistogramTime(uma_name.c_str(), time); 1565 AddPreReadHistogramTime(uma_name.c_str(), time);
1566 } 1566 }
1567 #endif 1567 #endif
1568 #endif 1568 #endif
1569 } 1569 }
OLDNEW
« no previous file with comments | « base/metrics/field_trial_unittest.cc ('k') | chrome/browser/chrome_browser_main_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698