| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // hrseolv is a command line utility which runs the HostResolver in the | 5 // hrseolv is a command line utility which runs the HostResolver in the |
| 6 // Chromium network stack. | 6 // Chromium network stack. |
| 7 // | 7 // |
| 8 // The user specifies the hosts to lookup and when to look them up. | 8 // The user specifies the hosts to lookup and when to look them up. |
| 9 // The hosts must be specified in order. | 9 // The hosts must be specified in order. |
| 10 // The hosts can be contained in a file or on the command line. If no | 10 // The hosts can be contained in a file or on the command line. If no |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 io_callback_(this, &DelayedResolve::OnResolveComplete)) { | 188 io_callback_(this, &DelayedResolve::OnResolveComplete)) { |
| 189 } | 189 } |
| 190 | 190 |
| 191 void Start() { | 191 void Start() { |
| 192 net::CompletionCallback* callback = (is_async_) ? &io_callback_ : NULL; | 192 net::CompletionCallback* callback = (is_async_) ? &io_callback_ : NULL; |
| 193 net::HostResolver::RequestInfo request_info(host_, 80); | 193 net::HostResolver::RequestInfo request_info(host_, 80); |
| 194 int rv = resolver_->Resolve(request_info, | 194 int rv = resolver_->Resolve(request_info, |
| 195 &address_list_, | 195 &address_list_, |
| 196 callback, | 196 callback, |
| 197 NULL, | 197 NULL, |
| 198 NULL); | 198 net::BoundNetLog()); |
| 199 if (rv != net::ERR_IO_PENDING) { | 199 if (rv != net::ERR_IO_PENDING) { |
| 200 OnResolveComplete(rv); | 200 OnResolveComplete(rv); |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 | 203 |
| 204 private: | 204 private: |
| 205 | 205 |
| 206 // Without this, VC++ complains about the private destructor below. | 206 // Without this, VC++ complains about the private destructor below. |
| 207 friend class base::RefCounted<DelayedResolve>; | 207 friend class base::RefCounted<DelayedResolve>; |
| 208 | 208 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 base::TimeDelta::FromSeconds(0)); | 447 base::TimeDelta::FromSeconds(0)); |
| 448 | 448 |
| 449 scoped_refptr<net::HostResolver> host_resolver( | 449 scoped_refptr<net::HostResolver> host_resolver( |
| 450 new net::HostResolverImpl(NULL, cache, NULL, 100u)); | 450 new net::HostResolverImpl(NULL, cache, NULL, 100u)); |
| 451 ResolverInvoker invoker(host_resolver.get()); | 451 ResolverInvoker invoker(host_resolver.get()); |
| 452 invoker.ResolveAll(hosts_and_times, options.async); | 452 invoker.ResolveAll(hosts_and_times, options.async); |
| 453 | 453 |
| 454 CommandLine::Reset(); | 454 CommandLine::Reset(); |
| 455 return 0; | 455 return 0; |
| 456 } | 456 } |
| OLD | NEW |