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

Unified Diff: extensions/common/permissions/socket_permission_entry.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 | « extensions/common/permissions/socket_permission_data.cc ('k') | extensions/common/url_pattern.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/permissions/socket_permission_entry.cc
diff --git a/extensions/common/permissions/socket_permission_entry.cc b/extensions/common/permissions/socket_permission_entry.cc
index 8b2d355acc70a80e4d0413c77fb62a989350fb5f..86c61de043f5e651303a35567a2d381c9cb0263a 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()) {
« no previous file with comments | « extensions/common/permissions/socket_permission_data.cc ('k') | extensions/common/url_pattern.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698