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

Unified Diff: media/base/mime_util.cc

Issue 1274123003: Update SplitString calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no media changes 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
« no previous file with comments | « gpu/config/gpu_util.cc ('k') | media/filters/chunk_demuxer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/mime_util.cc
diff --git a/media/base/mime_util.cc b/media/base/mime_util.cc
index 00a2c744cc4bb0e2e3433f563a87d0d6a6b8d652..50a99c62f61c4a8713644595338f7a137cd41978 100644
--- a/media/base/mime_util.cc
+++ b/media/base/mime_util.cc
@@ -417,9 +417,13 @@ bool MimeUtil::AreSupportedMediaCodecs(
void MimeUtil::ParseCodecString(const std::string& codecs,
std::vector<std::string>* codecs_out,
bool strip) {
- std::string no_quote_codecs;
- base::TrimString(codecs, "\"", &no_quote_codecs);
- base::SplitString(no_quote_codecs, ',', codecs_out);
+ *codecs_out = base::SplitString(
+ base::TrimString(codecs, "\"", base::TRIM_ALL),
+ ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
+
+ // Convert empty or all-whitespace input to 0 results.
+ if (codecs_out->size() == 1 && (*codecs_out)[0].empty())
+ codecs_out->clear();
if (!strip)
return;
« no previous file with comments | « gpu/config/gpu_util.cc ('k') | media/filters/chunk_demuxer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698