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 |