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

Unified Diff: tools/ipc_fuzzer/message_tools/message_util.cc

Issue 1284833004: Remove remaining legacy SplitString calls. (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 | « tools/ipc_fuzzer/fuzzer/fuzzer_main.cc ('k') | win8/delegate_execute/delegate_execute_operation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/ipc_fuzzer/message_tools/message_util.cc
diff --git a/tools/ipc_fuzzer/message_tools/message_util.cc b/tools/ipc_fuzzer/message_tools/message_util.cc
index 1d58ecfb6fef40df3f96c7b8b53cebe3fe593f7b..98f2348e88c4d0fa753495ed7ae0bdd43cd4caa8 100644
--- a/tools/ipc_fuzzer/message_tools/message_util.cc
+++ b/tools/ipc_fuzzer/message_tools/message_util.cc
@@ -108,9 +108,7 @@ int main(int argc, char** argv) {
bool invert = cmd->HasSwitch(kInvertSwitch);
bool perform_dump = cmd->HasSwitch(kDumpSwitch);
- std::vector<base::FilePath::StringType> input_file_names;
base::FilePath::StringType output_file_name;
- base::SplitString(args[0], ',', &input_file_names);
if (!perform_dump) {
if (args.size() < 2) {
@@ -121,10 +119,11 @@ int main(int argc, char** argv) {
}
ipc_fuzzer::MessageVector input_message_vector;
- for (std::vector<base::FilePath::StringType>::iterator
- it = input_file_names.begin(); it != input_file_names.end(); ++it) {
+ for (const base::FilePath::StringType& name : base::SplitString(
+ args[0], base::FilePath::StringType(1, ','),
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
ipc_fuzzer::MessageVector message_vector;
- if (!ipc_fuzzer::MessageFile::Read(base::FilePath(*it), &message_vector))
+ if (!ipc_fuzzer::MessageFile::Read(base::FilePath(name), &message_vector))
return EXIT_FAILURE;
input_message_vector.insert(input_message_vector.end(),
message_vector.begin(), message_vector.end());
@@ -136,11 +135,10 @@ int main(int argc, char** argv) {
if (has_indices) {
indices.resize(input_message_vector.size(), false);
- std::vector<std::string> index_strings;
- base::SplitString(cmd->GetSwitchValueASCII(kInSwitch), ',', &index_strings);
- for (std::vector<std::string>::iterator it = index_strings.begin();
- it != index_strings.end(); ++it) {
- int index = atoi(it->c_str());
+ for (const std::string& cur : base::SplitString(
+ cmd->GetSwitchValueASCII(kInSwitch), ",", base::TRIM_WHITESPACE,
+ base::SPLIT_WANT_ALL)) {
+ int index = atoi(cur.c_str());
if (index >= 0 && static_cast<size_t>(index) < indices.size())
indices[index] = true;
}
« no previous file with comments | « tools/ipc_fuzzer/fuzzer/fuzzer_main.cc ('k') | win8/delegate_execute/delegate_execute_operation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698