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

Side by Side Diff: tools/ipc_fuzzer/mutate/message_util.cc

Issue 819223002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years 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 unified diff | Download patch
« no previous file with comments | « tools/ipc_fuzzer/mutate/generate.cc ('k') | tools/ipc_fuzzer/mutate/mutate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <limits.h> 5 #include <limits.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #include <iostream> 7 #include <iostream>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 return ipc_fuzzer::MessageNames::GetInstance()->TypeToName(msg->type()); 66 return ipc_fuzzer::MessageNames::GetInstance()->TypeToName(msg->type());
67 } 67 }
68 68
69 bool MessageMatches(const IPC::Message* msg, const RE2& pattern) { 69 bool MessageMatches(const IPC::Message* msg, const RE2& pattern) {
70 return RE2::FullMatch(MessageName(msg), pattern); 70 return RE2::FullMatch(MessageName(msg), pattern);
71 } 71 }
72 72
73 } // namespace 73 } // namespace
74 74
75 int main(int argc, char** argv) { 75 int main(int argc, char** argv) {
76 CommandLine::Init(argc, argv); 76 base::CommandLine::Init(argc, argv);
77 CommandLine* cmd = CommandLine::ForCurrentProcess(); 77 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
78 CommandLine::StringVector args = cmd->GetArgs(); 78 base::CommandLine::StringVector args = cmd->GetArgs();
79 79
80 if (args.size() < 1 || args.size() > 2 || cmd->HasSwitch(kHelpSwitch)) { 80 if (args.size() < 1 || args.size() > 2 || cmd->HasSwitch(kHelpSwitch)) {
81 usage(); 81 usage();
82 return EXIT_FAILURE; 82 return EXIT_FAILURE;
83 } 83 }
84 84
85 size_t start_index = 0; 85 size_t start_index = 0;
86 if (cmd->HasSwitch(kStartSwitch)) { 86 if (cmd->HasSwitch(kStartSwitch)) {
87 int temp = atoi(cmd->GetSwitchValueASCII(kStartSwitch).c_str()); 87 int temp = atoi(cmd->GetSwitchValueASCII(kStartSwitch).c_str());
88 if (temp > 0 ) 88 if (temp > 0 )
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 147 }
148 } else { 148 } else {
149 if (!ipc_fuzzer::MessageFile::Write( 149 if (!ipc_fuzzer::MessageFile::Write(
150 base::FilePath(output_file_name), output_message_vector)) { 150 base::FilePath(output_file_name), output_message_vector)) {
151 return EXIT_FAILURE; 151 return EXIT_FAILURE;
152 } 152 }
153 } 153 }
154 154
155 return EXIT_SUCCESS; 155 return EXIT_SUCCESS;
156 } 156 }
OLDNEW
« no previous file with comments | « tools/ipc_fuzzer/mutate/generate.cc ('k') | tools/ipc_fuzzer/mutate/mutate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698