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

Unified Diff: extensions/common/permissions/socket_permission_entry.cc

Issue 296593003: Make various string_util functions take StringPieces instead of char[]. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resync Created 6 years, 7 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 | « components/webdata/common/web_database_migration_unittest.cc ('k') | no next file » | 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 ddadf22c4e6d4eae77063de2a5e5d0c6b05a024f..ba409c58f149c7d9cf9dbb8fb94e0604e6743f6a 100644
--- a/extensions/common/permissions/socket_permission_entry.cc
+++ b/extensions/common/permissions/socket_permission_entry.cc
@@ -28,11 +28,8 @@ const int kWildcardPortNumber = 0;
const int kInvalidPort = -1;
bool StartsOrEndsWithWhitespace(const std::string& str) {
- if (str.find_first_not_of(base::kWhitespaceASCII) != 0)
- return true;
- if (str.find_last_not_of(base::kWhitespaceASCII) != str.length() - 1)
- return true;
- return false;
+ return !str.empty() &&
+ (IsWhitespace(str[0]) || IsWhitespace(str[str.length() - 1]));
}
} // namespace
« no previous file with comments | « components/webdata/common/web_database_migration_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698