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 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 entry.domain_name = parsed_command_line.GetArgs()[0]; | 374 entry.domain_name = parsed_command_line.GetArgs()[0]; |
375 #endif | 375 #endif |
376 replay_log_.push_back(entry); | 376 replay_log_.push_back(entry); |
377 } else if (parsed_command_line.GetArgs().size() != 0) { | 377 } else if (parsed_command_line.GetArgs().size() != 0) { |
378 return false; | 378 return false; |
379 } | 379 } |
380 return print_config_ || print_hosts_ || !replay_log_.empty(); | 380 return print_config_ || print_hosts_ || !replay_log_.empty(); |
381 } | 381 } |
382 | 382 |
383 void GDig::Start() { | 383 void GDig::Start() { |
384 if (nameserver_.address().size() > 0) { | 384 if (nameserver_.address().bytes().size() > 0) { |
385 DnsConfig dns_config; | 385 DnsConfig dns_config; |
386 dns_config.attempts = 1; | 386 dns_config.attempts = 1; |
387 dns_config.nameservers.push_back(nameserver_); | 387 dns_config.nameservers.push_back(nameserver_); |
388 OnDnsConfig(dns_config); | 388 OnDnsConfig(dns_config); |
389 } else { | 389 } else { |
390 dns_config_service_ = DnsConfigService::CreateSystemService(); | 390 dns_config_service_ = DnsConfigService::CreateSystemService(); |
391 dns_config_service_->ReadConfig(base::Bind(&GDig::OnDnsConfig, | 391 dns_config_service_->ReadConfig(base::Bind(&GDig::OnDnsConfig, |
392 base::Unretained(this))); | 392 base::Unretained(this))); |
393 timeout_closure_.Reset(base::Bind(&GDig::OnTimeout, | 393 timeout_closure_.Reset(base::Bind(&GDig::OnTimeout, |
394 base::Unretained(this))); | 394 base::Unretained(this))); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 } | 512 } |
513 | 513 |
514 } // empty namespace | 514 } // empty namespace |
515 | 515 |
516 } // namespace net | 516 } // namespace net |
517 | 517 |
518 int main(int argc, const char* argv[]) { | 518 int main(int argc, const char* argv[]) { |
519 net::GDig dig; | 519 net::GDig dig; |
520 return dig.Main(argc, argv); | 520 return dig.Main(argc, argv); |
521 } | 521 } |
OLD | NEW |