From c4afb05f67511e980cd13c021abf26e04b902977 Mon Sep 17 00:00:00 2001 From: pkasting Date: Thu, 6 Aug 2015 18:29:50 -0700 Subject: Revert of Update SplitString calls to new form (patchset #5 id:80001 of https://codereview.chromium.org/1272823003/ ) Reason for revert: Caused Blink layout test failures in media/encrypted-media/encrypted-media-requestmediakeysystemaccess.html : http://test-results.appspot.com/dashboards/flakiness_dashboard.html#showExpectations=true&tests=media%2Fencrypted-media%2Fencrypted-media-requestmediakeysystemaccess.html Original issue's description: > Update SplitString calls to new form > > Uses the new form for most (but not quite all) of the remaining users of the old form. > > Changes media mime util codec list parsing to expect no result from the string "," rather than two empty strings. The old SplitString call had a special case where if the input was empty, it would return empty, but if it had one split character, it would return two empty strings as results. > > The new one lets you choose but the options are either (1) empty string -> one empty string and "," -> two empty strings, or (2) map both to no results for when you don't want empty results. I'm pretty sure media codec parsing actually wants the latter behavior, so I updated the call to discard empty results and MimeUtilTest.ParseCodecString is updated. > > Committed: https://crrev.com/0aa7c64253cca8b636d52d1d01d94f96ab9c13fa > Cr-Commit-Position: refs/heads/master@{#342238} TBR=sky@chromium.org,dalecurtis@chromium.org,brettw@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1278973003 Cr-Commit-Position: refs/heads/master@{#342257} --- content/child/runtime_features.cc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'content/child') diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc index 1763599..25c6b0e 100644 --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc @@ -209,18 +209,22 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( // Enable explicitly enabled features, and then disable explicitly disabled // ones. if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { - std::vector enabled_features = base::SplitString( - command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), - ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); - for (const std::string& feature : enabled_features) + std::vector enabled_features; + base::SplitString( + command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), ',', + &enabled_features); + for (const std::string& feature : enabled_features) { WebRuntimeFeatures::enableFeatureFromString(feature, true); + } } if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { - std::vector disabled_features = base::SplitString( - command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), - ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); - for (const std::string& feature : disabled_features) + std::vector disabled_features; + base::SplitString( + command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), ',', + &disabled_features); + for (const std::string& feature : disabled_features) { WebRuntimeFeatures::enableFeatureFromString(feature, false); + } } } -- cgit v1.1