Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Side by Side Diff: net/tools/hresolv/hresolv.cc

Issue 464084: Cache failed DNS resolutions for 1 second.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Merge changes (to include API change in another file) Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/mock_host_resolver.cc ('k') | net/url_request/url_request_view_net_internals_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 if (!ReadHostsAndTimesFromLooseValues(command_line->GetLooseValues(), 439 if (!ReadHostsAndTimesFromLooseValues(command_line->GetLooseValues(),
440 &hosts_and_times)) { 440 &hosts_and_times)) {
441 exit(1); 441 exit(1);
442 } 442 }
443 } else { 443 } else {
444 if (!ReadHostsAndTimesFromFile(options.input_path, &hosts_and_times)) { 444 if (!ReadHostsAndTimesFromFile(options.input_path, &hosts_and_times)) {
445 exit(1); 445 exit(1);
446 } 446 }
447 } 447 }
448 448
449 net::HostCache* cache = new net::HostCache(
450 options.cache_size,
451 base::TimeDelta::FromMilliseconds(options.cache_ttl),
452 base::TimeDelta::FromSeconds(0));
453
449 scoped_refptr<net::HostResolver> host_resolver( 454 scoped_refptr<net::HostResolver> host_resolver(
450 new net::HostResolverImpl(NULL, options.cache_size, options.cache_ttl)); 455 new net::HostResolverImpl(NULL, cache));
451 ResolverInvoker invoker(host_resolver.get()); 456 ResolverInvoker invoker(host_resolver.get());
452 invoker.ResolveAll(hosts_and_times, options.async); 457 invoker.ResolveAll(hosts_and_times, options.async);
453 458
454 CommandLine::Reset(); 459 CommandLine::Reset();
455 return 0; 460 return 0;
456 } 461 }
OLDNEW
« no previous file with comments | « net/base/mock_host_resolver.cc ('k') | net/url_request/url_request_view_net_internals_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698