| 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 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/cancelable_callback.h" | 13 #include "base/cancelable_callback.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
| 16 #include "base/location.h" | 16 #include "base/location.h" |
| 17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
| 18 #include "base/run_loop.h" |
| 18 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
| 19 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
| 20 #include "base/strings/string_split.h" | 21 #include "base/strings/string_split.h" |
| 21 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
| 22 #include "base/strings/stringprintf.h" | 23 #include "base/strings/stringprintf.h" |
| 23 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
| 24 #include "base/threading/thread_task_runner_handle.h" | 25 #include "base/threading/thread_task_runner_handle.h" |
| 25 #include "base/time/time.h" | 26 #include "base/time/time.h" |
| 26 #include "net/base/address_list.h" | 27 #include "net/base/address_list.h" |
| 27 #include "net/base/ip_address.h" | 28 #include "net/base/ip_address.h" |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 " [domain_name]\n", | 268 " [domain_name]\n", |
| 268 argv[0]); | 269 argv[0]); |
| 269 return RESULT_WRONG_USAGE; | 270 return RESULT_WRONG_USAGE; |
| 270 } | 271 } |
| 271 | 272 |
| 272 base::MessageLoopForIO loop; | 273 base::MessageLoopForIO loop; |
| 273 | 274 |
| 274 result_ = RESULT_PENDING; | 275 result_ = RESULT_PENDING; |
| 275 Start(); | 276 Start(); |
| 276 if (result_ == RESULT_PENDING) | 277 if (result_ == RESULT_PENDING) |
| 277 base::MessageLoop::current()->Run(); | 278 base::RunLoop().Run(); |
| 278 | 279 |
| 279 // Destroy it while MessageLoopForIO is alive. | 280 // Destroy it while MessageLoopForIO is alive. |
| 280 dns_config_service_.reset(); | 281 dns_config_service_.reset(); |
| 281 return result_; | 282 return result_; |
| 282 } | 283 } |
| 283 | 284 |
| 284 bool GDig::ParseCommandLine(int argc, const char* argv[]) { | 285 bool GDig::ParseCommandLine(int argc, const char* argv[]) { |
| 285 base::CommandLine::Init(argc, argv); | 286 base::CommandLine::Init(argc, argv); |
| 286 const base::CommandLine& parsed_command_line = | 287 const base::CommandLine& parsed_command_line = |
| 287 *base::CommandLine::ForCurrentProcess(); | 288 *base::CommandLine::ForCurrentProcess(); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 } | 515 } |
| 515 | 516 |
| 516 } // empty namespace | 517 } // empty namespace |
| 517 | 518 |
| 518 } // namespace net | 519 } // namespace net |
| 519 | 520 |
| 520 int main(int argc, const char* argv[]) { | 521 int main(int argc, const char* argv[]) { |
| 521 net::GDig dig; | 522 net::GDig dig; |
| 522 return dig.Main(argc, argv); | 523 return dig.Main(argc, argv); |
| 523 } | 524 } |
| OLD | NEW |