| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <iostream> | 5 #include <iostream> |
| 6 #include <set> | 6 #include <set> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 if (args.size() != 2) { | 152 if (args.size() != 2) { |
| 153 usage(); | 153 usage(); |
| 154 return EXIT_FAILURE; | 154 return EXIT_FAILURE; |
| 155 } | 155 } |
| 156 base::FilePath::StringType input_file_name = args[0]; | 156 base::FilePath::StringType input_file_name = args[0]; |
| 157 base::FilePath::StringType output_file_name = args[1]; | 157 base::FilePath::StringType output_file_name = args[1]; |
| 158 | 158 |
| 159 bool permute = cmd->HasSwitch(kPermuteSwitch); | 159 bool permute = cmd->HasSwitch(kPermuteSwitch); |
| 160 | 160 |
| 161 std::string type_string_list = cmd->GetSwitchValueASCII(kTypeListSwitch); | 161 std::string type_string_list = cmd->GetSwitchValueASCII(kTypeListSwitch); |
| 162 std::vector<std::string> type_string_vector; | 162 std::vector<std::string> type_string_vector = base::SplitString( |
| 163 base::SplitString(type_string_list, ',', &type_string_vector); | 163 type_string_list, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 164 std::set<uint32> type_set; | 164 std::set<uint32> type_set; |
| 165 for (size_t i = 0; i < type_string_vector.size(); ++i) { | 165 for (size_t i = 0; i < type_string_vector.size(); ++i) { |
| 166 type_set.insert(atoi(type_string_vector[i].c_str())); | 166 type_set.insert(atoi(type_string_vector[i].c_str())); |
| 167 } | 167 } |
| 168 | 168 |
| 169 FuzzerFunctionMap fuzz_function_map; | 169 FuzzerFunctionMap fuzz_function_map; |
| 170 PopulateFuzzerFunctionMap(&fuzz_function_map); | 170 PopulateFuzzerFunctionMap(&fuzz_function_map); |
| 171 | 171 |
| 172 MessageVector message_vector; | 172 MessageVector message_vector; |
| 173 if (!MessageFile::Read(base::FilePath(input_file_name), &message_vector)) | 173 if (!MessageFile::Read(base::FilePath(input_file_name), &message_vector)) |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 } | 236 } |
| 237 | 237 |
| 238 return result; | 238 return result; |
| 239 } | 239 } |
| 240 | 240 |
| 241 } // namespace ipc_fuzzer | 241 } // namespace ipc_fuzzer |
| 242 | 242 |
| 243 int main(int argc, char** argv) { | 243 int main(int argc, char** argv) { |
| 244 return ipc_fuzzer::FuzzerMain(argc, argv); | 244 return ipc_fuzzer::FuzzerMain(argc, argv); |
| 245 } | 245 } |
| OLD | NEW |