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

Unified Diff: base/feature_list.cc

Issue 1848523002: Changes to support using base/feature_list.h from gin/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 8 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/feature_list.h ('k') | base/test/test_suite.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/feature_list.cc
diff --git a/base/feature_list.cc b/base/feature_list.cc
index dcb76f54e66e860205d869365de97f0af9b4bd9e..da5efe0aaf78eb0d984d104e72e3686718b2c1da 100644
--- a/base/feature_list.cc
+++ b/base/feature_list.cc
@@ -143,7 +143,7 @@ std::vector<std::string> FeatureList::SplitFeatureListString(
}
// static
-void FeatureList::InitializeInstance(const std::string& enable_features,
+bool FeatureList::InitializeInstance(const std::string& enable_features,
const std::string& disable_features) {
// We want to initialize a new instance here to support command-line features
// in testing better. For example, we initialize a dummy instance in
@@ -153,17 +153,20 @@ void FeatureList::InitializeInstance(const std::string& enable_features,
// For example, we initialize an instance in chrome/browser/
// chrome_browser_main.cc and do not override it in content/browser/
// browser_main_loop.cc.
+ bool instance_existed_before = false;
if (g_instance) {
if (g_instance->initialized_from_command_line_)
- return;
+ return false;
delete g_instance;
g_instance = nullptr;
+ instance_existed_before = true;
}
std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
feature_list->InitializeFromCommandLine(enable_features, disable_features);
base::FeatureList::SetInstance(std::move(feature_list));
+ return !instance_existed_before;
}
// static
« no previous file with comments | « base/feature_list.h ('k') | base/test/test_suite.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698