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

Unified Diff: content/common/plugin_list.cc

Issue 1272823003: Update SplitString calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « content/common/pepper_plugin_list.cc ('k') | content/common/plugin_list_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/plugin_list.cc
diff --git a/content/common/plugin_list.cc b/content/common/plugin_list.cc
index 7e8d1c2e355ef765513d9d01fbad2e4fab611e58..1cc8fa577e59003d9888b5c4d8bf09c9eb2d46f2 100644
--- a/content/common/plugin_list.cc
+++ b/content/common/plugin_list.cc
@@ -130,11 +130,13 @@ bool PluginList::ParseMimeTypes(
const std::string& file_extensions_str,
const base::string16& mime_type_descriptions_str,
std::vector<WebPluginMimeType>* parsed_mime_types) {
- std::vector<std::string> mime_types, file_extensions;
- std::vector<base::string16> descriptions;
- base::SplitString(mime_types_str, '|', &mime_types);
- base::SplitString(file_extensions_str, '|', &file_extensions);
- base::SplitString(mime_type_descriptions_str, '|', &descriptions);
+ std::vector<std::string> mime_types = base::SplitString(
+ mime_types_str, "|", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
+ std::vector<std::string> file_extensions = base::SplitString(
+ file_extensions_str, "|", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
+ std::vector<base::string16> descriptions = base::SplitString(
+ mime_type_descriptions_str, base::string16(1, '|'), base::TRIM_WHITESPACE,
+ base::SPLIT_WANT_ALL);
parsed_mime_types->clear();
@@ -144,8 +146,10 @@ bool PluginList::ParseMimeTypes(
for (size_t i = 0; i < mime_types.size(); ++i) {
WebPluginMimeType mime_type;
mime_type.mime_type = base::StringToLowerASCII(mime_types[i]);
- if (file_extensions.size() > i)
- base::SplitString(file_extensions[i], ',', &mime_type.file_extensions);
+ if (file_extensions.size() > i) {
+ mime_type.file_extensions = base::SplitString(
+ file_extensions[i], ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
+ }
if (descriptions.size() > i) {
mime_type.description = descriptions[i];
« no previous file with comments | « content/common/pepper_plugin_list.cc ('k') | content/common/plugin_list_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698