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

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

Issue 1200383005: Activate prepopulated fieldtrials (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@codegen_field_trials
Patch Set: Created 5 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
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 <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 626
627 // Create field trials without activating them, so that this behaves in a 627 // Create field trials without activating them, so that this behaves in a
628 // consistent manner with field trials created from the server. 628 // consistent manner with field trials created from the server.
629 bool result = base::FieldTrialList::CreateTrialsFromString( 629 bool result = base::FieldTrialList::CreateTrialsFromString(
630 command_line->GetSwitchValueASCII(switches::kForceFieldTrials), 630 command_line->GetSwitchValueASCII(switches::kForceFieldTrials),
631 base::FieldTrialList::DONT_ACTIVATE_TRIALS, 631 base::FieldTrialList::DONT_ACTIVATE_TRIALS,
632 unforceable_field_trials); 632 unforceable_field_trials);
633 CHECK(result) << "Invalid --" << switches::kForceFieldTrials 633 CHECK(result) << "Invalid --" << switches::kForceFieldTrials
634 << " list specified."; 634 << " list specified.";
635 } 635 }
636
637 #if defined(GOOGLE_CHROME_BUILD) && defined(OFFICIAL_BUILD)
Alexei Svitkine (slow) 2015/07/10 19:22:30 I think OFFICIAL_BUILD is not needed here. I think
danduong 2015/07/10 19:36:56 Hmm... If we were to do this, would I still be abl
brettw 2015/07/10 19:41:21 Yeah, I always get these confused but "chrome_buil
Alexei Svitkine (slow) 2015/07/10 19:44:41 Interesting. I had assumed that's not really a use
danduong 2015/07/10 23:02:36 I guess that would be a lesser use-case. For simpl
638 std::string enable_field_trial_testing = command_line->GetSwitchValueASCII(
639 switches::kEnableFieldTrialTestingConfig);
Alexei Svitkine (slow) 2015/07/10 19:22:29 Convention for switches that start with "enable_*"
danduong 2015/07/10 19:36:56 I can add a check for the variations server stuff.
Alexei Svitkine (slow) 2015/07/10 19:44:41 Right... I remember now - because the perf bots ac
danduong 2015/07/10 23:02:35 Yup. Let's simplify with just using a disable flag
640 if (enable_field_trial_testing.empty()) {
brettw 2015/07/10 19:41:21 No {} one one-line conditionals for consistency.
danduong 2015/07/10 23:02:36 Removed this piece of code altogether.
641 enable_field_trial_testing = "1";
642 }
643
644 if (enable_field_trial_testing == "1" &&
645 !command_line->HasSwitch(switches::kForceFieldTrials)) {
646 bool result = chrome_variations::AssociateDefaultFieldTrialConfig();
647 CHECK(result) << " Enabling field trial testing configuration failed.";
648 }
649 #endif // defined(GOOGLE_CHROME_BUILD) && defined(OFFICIAL_BUILD)
650
636 if (command_line->HasSwitch(switches::kForceVariationIds)) { 651 if (command_line->HasSwitch(switches::kForceVariationIds)) {
637 // Create default variation ids which will always be included in the 652 // Create default variation ids which will always be included in the
638 // X-Client-Data request header. 653 // X-Client-Data request header.
639 variations::VariationsHttpHeaderProvider* provider = 654 variations::VariationsHttpHeaderProvider* provider =
640 variations::VariationsHttpHeaderProvider::GetInstance(); 655 variations::VariationsHttpHeaderProvider::GetInstance();
641 bool result = provider->SetDefaultVariationIds( 656 bool result = provider->SetDefaultVariationIds(
642 command_line->GetSwitchValueASCII(switches::kForceVariationIds)); 657 command_line->GetSwitchValueASCII(switches::kForceVariationIds));
643 CHECK(result) << "Invalid --" << switches::kForceVariationIds 658 CHECK(result) << "Invalid --" << switches::kForceVariationIds
644 << " list specified."; 659 << " list specified.";
645 metrics->AddSyntheticTrialObserver(provider); 660 metrics->AddSyntheticTrialObserver(provider);
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1780 chromeos::CrosSettings::Shutdown(); 1795 chromeos::CrosSettings::Shutdown();
1781 #endif // defined(OS_CHROMEOS) 1796 #endif // defined(OS_CHROMEOS)
1782 #endif // defined(OS_ANDROID) 1797 #endif // defined(OS_ANDROID)
1783 } 1798 }
1784 1799
1785 // Public members: 1800 // Public members:
1786 1801
1787 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1802 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1788 chrome_extra_parts_.push_back(parts); 1803 chrome_extra_parts_.push_back(parts);
1789 } 1804 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/chrome_switches.h » ('j') | chrome/common/variations/variations_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698