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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 1278403003: Initial implementation of FeatureList in base/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More comments addressed. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 51500ea5eb9abec4995a26b2f513233dc09c4766..50a3887e536b94415435505eb07eda4c1e639b99 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -15,6 +15,7 @@
#include "base/debug/debugger.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
+#include "base/metrics/feature_list.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h"
#include "base/path_service.h"
@@ -677,11 +678,20 @@ void ChromeBrowserMainParts::SetupMetricsAndFieldTrials() {
<< " list specified.";
metrics->AddSyntheticTrialObserver(provider);
}
+
+ scoped_ptr<base::FeatureList> feature_list(new base::FeatureList);
+ feature_list->InitializeFromCommandLine(
+ command_line->GetSwitchValueASCII(switches::kEnableFeatures),
+ command_line->GetSwitchValueASCII(switches::kDisableFeatures));
+
chrome_variations::VariationsService* variations_service =
browser_process_->variations_service();
if (variations_service)
variations_service->CreateTrialsFromSeed();
+ // TODO(asvitkine): Pass |feature_list| to CreateTrialsFromSeed() above.
+ base::FeatureList::SetInstance(feature_list.Pass());
+
// This must be called after |local_state_| is initialized.
browser_field_trials_.SetupFieldTrials();

Powered by Google App Engine
This is Rietveld 408576698