Commit 30815427 authored by Clark DuVall's avatar Clark DuVall Committed by Commit Bot

[WebLayer] Fix weblayer_browsertests failing with ASan

the backing string was getting destroyed too early.

base: :FeatureList::SplitFeatureListString takes in a StringPiece, and
Change-Id: Id054a40451031bc41cbae3d4caa95f25568d0011
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1887830Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710436}
parent 017dbb1e
......@@ -66,14 +66,18 @@ void DisableFeaturesIfNotSet(
const std::vector<base::Feature>& features_to_disable) {
auto* cl = base::CommandLine::ForCurrentProcess();
std::vector<std::string> enabled_features;
for (const auto& f : base::FeatureList::SplitFeatureListString(
cl->GetSwitchValueASCII(switches::kEnableFeatures))) {
std::string enabled_features_str =
cl->GetSwitchValueASCII(switches::kEnableFeatures);
for (const auto& f :
base::FeatureList::SplitFeatureListString(enabled_features_str)) {
enabled_features.emplace_back(f);
}
std::vector<std::string> disabled_features;
for (const auto& f : base::FeatureList::SplitFeatureListString(
cl->GetSwitchValueASCII(switches::kDisableFeatures))) {
std::string disabled_features_str =
cl->GetSwitchValueASCII(switches::kDisableFeatures);
for (const auto& f :
base::FeatureList::SplitFeatureListString(disabled_features_str)) {
disabled_features.emplace_back(f);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment