summaryrefslogtreecommitdiffstats
path: root/extensions/common/permissions
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2015-08-07 17:28:47 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-08 00:29:27 +0000
commit26dab8f049217794bd73a230ea567021adc09672 (patch)
tree226dec9ffde922a61c6d05f0d8ee549f0a9dd02d /extensions/common/permissions
parentdbae293445fa5a6c8ba5cea0c7290f436d1034ab (diff)
downloadchromium_src-26dab8f049217794bd73a230ea567021adc09672.zip
chromium_src-26dab8f049217794bd73a230ea567021adc09672.tar.gz
chromium_src-26dab8f049217794bd73a230ea567021adc09672.tar.bz2
Update SplitString calls to new form
Uses the new form for most (but not quite all) of the remaining users of the old form. Reland of https://codereview.chromium.org/1272823003 but with no changes to the way media parses codec lists. The previous landing attempted to simplify some handling but there are layout tests that expect the old behavior, and I'm not qualified to tell if it's OK to change. TBR=sky Review URL: https://codereview.chromium.org/1274123003 Cr-Commit-Position: refs/heads/master@{#342489}
Diffstat (limited to 'extensions/common/permissions')
-rw-r--r--extensions/common/permissions/socket_permission_data.cc5
-rw-r--r--extensions/common/permissions/socket_permission_entry.cc10
2 files changed, 9 insertions, 6 deletions
diff --git a/extensions/common/permissions/socket_permission_data.cc b/extensions/common/permissions/socket_permission_data.cc
index a01c20f..f22f14a 100644
--- a/extensions/common/permissions/socket_permission_data.cc
+++ b/extensions/common/permissions/socket_permission_data.cc
@@ -124,8 +124,9 @@ SocketPermissionEntry& SocketPermissionData::entry() {
bool SocketPermissionData::Parse(const std::string& permission) {
Reset();
- std::vector<std::string> tokens;
- base::SplitStringDontTrim(permission, kColon, &tokens);
+ std::vector<std::string> tokens =
+ base::SplitString(permission, std::string(1, kColon),
+ base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
if (tokens.empty())
return false;
diff --git a/extensions/common/permissions/socket_permission_entry.cc b/extensions/common/permissions/socket_permission_entry.cc
index 8b2d355..86c61de 100644
--- a/extensions/common/permissions/socket_permission_entry.cc
+++ b/extensions/common/permissions/socket_permission_entry.cc
@@ -128,8 +128,9 @@ bool SocketPermissionEntry::ParseHostPattern(
SocketPermissionRequest::OperationType type,
const std::string& pattern,
SocketPermissionEntry* entry) {
- std::vector<std::string> tokens;
- base::SplitStringDontTrim(pattern, kColon, &tokens);
+ std::vector<std::string> tokens =
+ base::SplitString(pattern, std::string(1, kColon), base::KEEP_WHITESPACE,
+ base::SPLIT_WANT_ALL);
return ParseHostPattern(type, tokens, entry);
}
@@ -168,8 +169,9 @@ bool SocketPermissionEntry::ParseHostPattern(
result.pattern_.host = base::StringToLowerASCII(result.pattern_.host);
// The first component can optionally be '*' to match all subdomains.
- std::vector<std::string> host_components;
- base::SplitString(result.pattern_.host, kDot, &host_components);
+ std::vector<std::string> host_components =
+ base::SplitString(result.pattern_.host, std::string(1, kDot),
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
DCHECK(!host_components.empty());
if (host_components[0] == kWildcard || host_components[0].empty()) {