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 | 8 |
8 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
9 #include "base/bind.h" | 10 #include "base/bind.h" |
10 #include "base/cancelable_callback.h" | 11 #include "base/cancelable_callback.h" |
11 #include "base/command_line.h" | 12 #include "base/command_line.h" |
12 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
13 #include "base/location.h" | 14 #include "base/location.h" |
14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
15 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
16 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 return; | 425 return; |
425 } | 426 } |
426 | 427 |
427 scoped_ptr<DnsClient> dns_client(DnsClient::CreateClient(NULL)); | 428 scoped_ptr<DnsClient> dns_client(DnsClient::CreateClient(NULL)); |
428 dns_client->SetConfig(dns_config); | 429 dns_client->SetConfig(dns_config); |
429 HostResolver::Options options; | 430 HostResolver::Options options; |
430 options.max_concurrent_resolves = parallellism_; | 431 options.max_concurrent_resolves = parallellism_; |
431 options.max_retry_attempts = 1u; | 432 options.max_retry_attempts = 1u; |
432 scoped_ptr<HostResolverImpl> resolver( | 433 scoped_ptr<HostResolverImpl> resolver( |
433 new HostResolverImpl(options, log_.get())); | 434 new HostResolverImpl(options, log_.get())); |
434 resolver->SetDnsClient(dns_client.Pass()); | 435 resolver->SetDnsClient(std::move(dns_client)); |
435 resolver_ = resolver.Pass(); | 436 resolver_ = std::move(resolver); |
436 | 437 |
437 start_time_ = base::Time::Now(); | 438 start_time_ = base::Time::Now(); |
438 | 439 |
439 ReplayNextEntry(); | 440 ReplayNextEntry(); |
440 } | 441 } |
441 | 442 |
442 void GDig::ReplayNextEntry() { | 443 void GDig::ReplayNextEntry() { |
443 DCHECK_LT(replay_log_index_, replay_log_.size()); | 444 DCHECK_LT(replay_log_index_, replay_log_.size()); |
444 | 445 |
445 base::TimeDelta time_since_start = base::Time::Now() - start_time_; | 446 base::TimeDelta time_since_start = base::Time::Now() - start_time_; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 } | 512 } |
512 | 513 |
513 } // empty namespace | 514 } // empty namespace |
514 | 515 |
515 } // namespace net | 516 } // namespace net |
516 | 517 |
517 int main(int argc, const char* argv[]) { | 518 int main(int argc, const char* argv[]) { |
518 net::GDig dig; | 519 net::GDig dig; |
519 return dig.Main(argc, argv); | 520 return dig.Main(argc, argv); |
520 } | 521 } |
OLD | NEW |