OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stdio.h> | 5 #include <stdio.h> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 Start(); | 269 Start(); |
270 if (result_ == RESULT_PENDING) | 270 if (result_ == RESULT_PENDING) |
271 base::MessageLoop::current()->Run(); | 271 base::MessageLoop::current()->Run(); |
272 | 272 |
273 // Destroy it while MessageLoopForIO is alive. | 273 // Destroy it while MessageLoopForIO is alive. |
274 dns_config_service_.reset(); | 274 dns_config_service_.reset(); |
275 return result_; | 275 return result_; |
276 } | 276 } |
277 | 277 |
278 bool GDig::ParseCommandLine(int argc, const char* argv[]) { | 278 bool GDig::ParseCommandLine(int argc, const char* argv[]) { |
279 CommandLine::Init(argc, argv); | 279 base::CommandLine::Init(argc, argv); |
280 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 280 const base::CommandLine& parsed_command_line = |
| 281 *base::CommandLine::ForCurrentProcess(); |
281 | 282 |
282 if (parsed_command_line.HasSwitch("config_timeout")) { | 283 if (parsed_command_line.HasSwitch("config_timeout")) { |
283 int timeout_seconds = 0; | 284 int timeout_seconds = 0; |
284 bool parsed = base::StringToInt( | 285 bool parsed = base::StringToInt( |
285 parsed_command_line.GetSwitchValueASCII("config_timeout"), | 286 parsed_command_line.GetSwitchValueASCII("config_timeout"), |
286 &timeout_seconds); | 287 &timeout_seconds); |
287 if (parsed && timeout_seconds > 0) { | 288 if (parsed && timeout_seconds > 0) { |
288 config_timeout_ = base::TimeDelta::FromSeconds(timeout_seconds); | 289 config_timeout_ = base::TimeDelta::FromSeconds(timeout_seconds); |
289 } else { | 290 } else { |
290 fprintf(stderr, "Invalid config_timeout parameter\n"); | 291 fprintf(stderr, "Invalid config_timeout parameter\n"); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 } | 507 } |
507 | 508 |
508 } // empty namespace | 509 } // empty namespace |
509 | 510 |
510 } // namespace net | 511 } // namespace net |
511 | 512 |
512 int main(int argc, const char* argv[]) { | 513 int main(int argc, const char* argv[]) { |
513 net::GDig dig; | 514 net::GDig dig; |
514 return dig.Main(argc, argv); | 515 return dig.Main(argc, argv); |
515 } | 516 } |
OLD | NEW |