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

Unified Diff: chrome/browser/supervised_user/supervised_user_whitelist_service.cc

Issue 1240183002: Update SplitString calls in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « chrome/browser/ssl/ssl_error_classification_unittest.cc ('k') | chrome/browser/sxs_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/supervised_user/supervised_user_whitelist_service.cc
diff --git a/chrome/browser/supervised_user/supervised_user_whitelist_service.cc b/chrome/browser/supervised_user/supervised_user_whitelist_service.cc
index 9619f3de896e29f023b5573a9c9eb83802051c6e..c688abe35f3bed99174dcad6b445349b4ce7410c 100644
--- a/chrome/browser/supervised_user/supervised_user_whitelist_service.cc
+++ b/chrome/browser/supervised_user/supervised_user_whitelist_service.cc
@@ -71,17 +71,17 @@ void SupervisedUserWhitelistService::Init() {
base::CommandLine::ForCurrentProcess();
std::string command_line_whitelists = command_line->GetSwitchValueASCII(
switches::kInstallSupervisedUserWhitelists);
- std::vector<std::string> split_whitelists;
- base::SplitString(command_line_whitelists, ',', &split_whitelists);
- for (const std::string& whitelist : split_whitelists) {
+ for (const base::StringPiece& whitelist : base::SplitStringPiece(
+ command_line_whitelists, ",",
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
std::string id;
std::string name;
size_t separator = whitelist.find(':');
- if (separator != std::string::npos) {
- id = whitelist.substr(0, separator);
- name = whitelist.substr(separator + 1);
+ if (separator != base::StringPiece::npos) {
+ whitelist.substr(0, separator).CopyToString(&id);
+ whitelist.substr(separator + 1).CopyToString(&name);
} else {
- id = whitelist;
+ whitelist.CopyToString(&id);
}
// Skip whitelists that were already registered.
« no previous file with comments | « chrome/browser/ssl/ssl_error_classification_unittest.cc ('k') | chrome/browser/sxs_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698