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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 153913009: Make some field trials unforceable via command-line in the official build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 1 param per line Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/metrics/field_trial_unittest.cc ('k') | content/renderer/renderer_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index d8608c9aca69b5f95a749f87c222f169251249ac..043ccad692de473e6f66b280bbff0c28b0a9eb66 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -8,6 +8,7 @@
#include <gtk/gtk.h>
#endif
+#include <set>
#include <string>
#include <vector>
@@ -518,6 +519,7 @@ void InitializeAllPrefHashStores() {
chrome_prefs::InitializePrefHashStoreIfRequired(profile_path);
}
}
+
} // namespace
namespace chrome_browser {
@@ -602,11 +604,17 @@ void ChromeBrowserMainParts::SetupMetricsAndFieldTrials() {
// Ensure any field trials specified on the command line are initialized.
// Also stop the metrics service so that we don't pollute UMA.
if (command_line->HasSwitch(switches::kForceFieldTrials)) {
+ std::set<std::string> unforceable_field_trials;
+#if defined(OFFICIAL_BUILD)
+ unforceable_field_trials.insert("SettingsEnforcement");
+#endif // defined(OFFICIAL_BUILD)
+
// Create field trials without activating them, so that this behaves in a
// consistent manner with field trials created from the server.
bool result = base::FieldTrialList::CreateTrialsFromString(
command_line->GetSwitchValueASCII(switches::kForceFieldTrials),
- base::FieldTrialList::DONT_ACTIVATE_TRIALS);
+ base::FieldTrialList::DONT_ACTIVATE_TRIALS,
+ unforceable_field_trials);
CHECK(result) << "Invalid --" << switches::kForceFieldTrials
<< " list specified.";
}
« no previous file with comments | « base/metrics/field_trial_unittest.cc ('k') | content/renderer/renderer_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698