| 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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 "%s", DnsHostsToString(dns_config.hosts).c_str()); | 414 "%s", DnsHostsToString(dns_config.hosts).c_str()); |
| 415 } | 415 } |
| 416 | 416 |
| 417 if (replay_log_.empty()) { | 417 if (replay_log_.empty()) { |
| 418 Finish(RESULT_OK); | 418 Finish(RESULT_OK); |
| 419 return; | 419 return; |
| 420 } | 420 } |
| 421 | 421 |
| 422 scoped_ptr<DnsClient> dns_client(DnsClient::CreateClient(NULL)); | 422 scoped_ptr<DnsClient> dns_client(DnsClient::CreateClient(NULL)); |
| 423 dns_client->SetConfig(dns_config); | 423 dns_client->SetConfig(dns_config); |
| 424 HostResolver::Options options; |
| 425 options.max_concurrent_resolves = parallellism_; |
| 426 options.max_retry_attempts = 1u; |
| 424 scoped_ptr<HostResolverImpl> resolver( | 427 scoped_ptr<HostResolverImpl> resolver( |
| 425 new HostResolverImpl( | 428 new HostResolverImpl(options, log_.get())); |
| 426 HostCache::CreateDefaultCache(), | |
| 427 PrioritizedDispatcher::Limits(NUM_PRIORITIES, parallellism_), | |
| 428 HostResolverImpl::ProcTaskParams(NULL, 1), | |
| 429 log_.get())); | |
| 430 resolver->SetDnsClient(dns_client.Pass()); | 429 resolver->SetDnsClient(dns_client.Pass()); |
| 431 resolver_ = resolver.Pass(); | 430 resolver_ = resolver.Pass(); |
| 432 | 431 |
| 433 start_time_ = base::Time::Now(); | 432 start_time_ = base::Time::Now(); |
| 434 | 433 |
| 435 ReplayNextEntry(); | 434 ReplayNextEntry(); |
| 436 } | 435 } |
| 437 | 436 |
| 438 void GDig::ReplayNextEntry() { | 437 void GDig::ReplayNextEntry() { |
| 439 DCHECK_LT(replay_log_index_, replay_log_.size()); | 438 DCHECK_LT(replay_log_index_, replay_log_.size()); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 } | 506 } |
| 508 | 507 |
| 509 } // empty namespace | 508 } // empty namespace |
| 510 | 509 |
| 511 } // namespace net | 510 } // namespace net |
| 512 | 511 |
| 513 int main(int argc, const char* argv[]) { | 512 int main(int argc, const char* argv[]) { |
| 514 net::GDig dig; | 513 net::GDig dig; |
| 515 return dig.Main(argc, argv); | 514 return dig.Main(argc, argv); |
| 516 } | 515 } |
| OLD | NEW |