diff options
author | brettw <brettw@chromium.org> | 2015-07-21 14:37:38 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-21 21:38:12 +0000 |
commit | c6f82b158f374c172a46326699f03d97777faa8e (patch) | |
tree | c96472fa185ca20b22fad773cd195689e4097894 /chrome/browser/sxs_linux.cc | |
parent | db484c3eff68c46ddf1530dd60441dba4614cb5c (diff) | |
download | chromium_src-c6f82b158f374c172a46326699f03d97777faa8e.zip chromium_src-c6f82b158f374c172a46326699f03d97777faa8e.tar.gz chromium_src-c6f82b158f374c172a46326699f03d97777faa8e.tar.bz2 |
Update SplitString calls in chrome.
In many places that iterated over the results, the code was changed to use a range-based for loop over the result of the SplitStirng call.
Review URL: https://codereview.chromium.org/1240183002
Cr-Commit-Position: refs/heads/master@{#339753}
Diffstat (limited to 'chrome/browser/sxs_linux.cc')
-rw-r--r-- | chrome/browser/sxs_linux.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/chrome/browser/sxs_linux.cc b/chrome/browser/sxs_linux.cc index 2990693..5ab67ae 100644 --- a/chrome/browser/sxs_linux.cc +++ b/chrome/browser/sxs_linux.cc @@ -68,8 +68,10 @@ bool DoAddChannelMarkToUserDataDir(const base::FilePath& user_data_dir) { // and legitimate that it doesn't exist, e.g. for new profile or for profile // existing before channel marks have been introduced. std::string channels_contents; - if (base::ReadFileToString(channels_path, &channels_contents)) - base::SplitString(channels_contents, '\n', &user_data_dir_channels); + if (base::ReadFileToString(channels_path, &channels_contents)) { + base::SplitString(channels_contents, "\n", + base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); + } if (std::find(user_data_dir_channels.begin(), user_data_dir_channels.end(), @@ -126,8 +128,8 @@ int MigrateUserDataDir() { return chrome::RESULT_CODE_SXS_MIGRATION_FAILED; } - std::vector<std::string> user_data_dir_channels; - base::SplitString(channels_contents, '\n', &user_data_dir_channels); + std::vector<std::string> user_data_dir_channels = base::SplitString( + channels_contents, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); if (user_data_dir_channels.size() != 1) { LOG(WARNING) << "User data dir migration is only possible when the profile " |