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

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

Issue 17945002: Make --force-fieldtrials not activate them in the browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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
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 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 new base::FieldTrialList( 603 new base::FieldTrialList(
604 metrics->CreateEntropyProvider(metrics_reporting_enabled).release())); 604 metrics->CreateEntropyProvider(metrics_reporting_enabled).release()));
605 605
606 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 606 const CommandLine* command_line = CommandLine::ForCurrentProcess();
607 if (command_line->HasSwitch(switches::kEnableBenchmarking)) 607 if (command_line->HasSwitch(switches::kEnableBenchmarking))
608 base::FieldTrial::EnableBenchmarking(); 608 base::FieldTrial::EnableBenchmarking();
609 609
610 // Ensure any field trials specified on the command line are initialized. 610 // Ensure any field trials specified on the command line are initialized.
611 // Also stop the metrics service so that we don't pollute UMA. 611 // Also stop the metrics service so that we don't pollute UMA.
612 if (command_line->HasSwitch(switches::kForceFieldTrials)) { 612 if (command_line->HasSwitch(switches::kForceFieldTrials)) {
613 std::string persistent = command_line->GetSwitchValueASCII( 613 // Create field trials without activating them, so that this behaves in a
614 switches::kForceFieldTrials); 614 // consistent manner with field trials created from the server.
615 bool ret = base::FieldTrialList::CreateTrialsFromString(persistent); 615 bool result = base::FieldTrialList::CreateTrialsFromString(
616 CHECK(ret) << "Invalid --" << switches::kForceFieldTrials << 616 command_line->GetSwitchValueASCII(switches::kForceFieldTrials),
617 " list specified."; 617 base::FieldTrialList::DONT_ACTIVATE_TRIALS);
618 CHECK(result) << "Invalid --" << switches::kForceFieldTrials
619 << " list specified.";
618 } 620 }
619 621
620 chrome_variations::VariationsService* variations_service = 622 chrome_variations::VariationsService* variations_service =
621 browser_process_->variations_service(); 623 browser_process_->variations_service();
622 if (variations_service) 624 if (variations_service)
623 variations_service->CreateTrialsFromSeed(); 625 variations_service->CreateTrialsFromSeed();
624 626
625 // This must be called after the local state is initialized. 627 // This must be called after the local state is initialized.
626 browser_field_trials_.SetupFieldTrials(local_state_); 628 browser_field_trials_.SetupFieldTrials(local_state_);
627 629
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1771 if (base::win::GetVersion() <= base::win::VERSION_XP) 1773 if (base::win::GetVersion() <= base::win::VERSION_XP)
1772 uma_name += "_XP"; 1774 uma_name += "_XP";
1773 1775
1774 uma_name += "_PreRead_"; 1776 uma_name += "_PreRead_";
1775 uma_name += pre_read_percentage; 1777 uma_name += pre_read_percentage;
1776 AddPreReadHistogramTime(uma_name.c_str(), time); 1778 AddPreReadHistogramTime(uma_name.c_str(), time);
1777 } 1779 }
1778 #endif 1780 #endif
1779 #endif 1781 #endif
1780 } 1782 }
OLDNEW
« no previous file with comments | « base/metrics/field_trial_unittest.cc ('k') | chrome/browser/extensions/api/metrics_private/metrics_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698