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

Side by Side Diff: net/base/mock_host_resolver.cc

Issue 7011044: Add a command line option to turn off retry attempts to resolve host (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 months 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "net/base/mock_host_resolver.h" 5 #include "net/base/mock_host_resolver.h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/string_split.h" 8 #include "base/string_split.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/threading/platform_thread.h" 10 #include "base/threading/platform_thread.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 HostCache* cache = NULL; 79 HostCache* cache = NULL;
80 80
81 if (use_caching_) { 81 if (use_caching_) {
82 cache = new HostCache( 82 cache = new HostCache(
83 100, // max entries. 83 100, // max entries.
84 base::TimeDelta::FromMinutes(1), 84 base::TimeDelta::FromMinutes(1),
85 base::TimeDelta::FromSeconds(0)); 85 base::TimeDelta::FromSeconds(0));
86 } 86 }
87 87
88 impl_.reset(new HostResolverImpl(proc, cache, 50u, NULL)); 88 impl_.reset(new HostResolverImpl(proc, cache, 50u, 4u, NULL));
89 } 89 }
90 90
91 int MockHostResolverBase::Resolve(const RequestInfo& info, 91 int MockHostResolverBase::Resolve(const RequestInfo& info,
92 AddressList* addresses, 92 AddressList* addresses,
93 CompletionCallback* callback, 93 CompletionCallback* callback,
94 RequestHandle* out_req, 94 RequestHandle* out_req,
95 const BoundNetLog& net_log) { 95 const BoundNetLog& net_log) {
96 if (synchronous_mode_) { 96 if (synchronous_mode_) {
97 callback = NULL; 97 callback = NULL;
98 out_req = NULL; 98 out_req = NULL;
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 CHECK_EQ(old_proc, current_proc_); 307 CHECK_EQ(old_proc, current_proc_);
308 } 308 }
309 309
310 void ScopedDefaultHostResolverProc::Init(HostResolverProc* proc) { 310 void ScopedDefaultHostResolverProc::Init(HostResolverProc* proc) {
311 current_proc_ = proc; 311 current_proc_ = proc;
312 previous_proc_ = HostResolverProc::SetDefault(current_proc_); 312 previous_proc_ = HostResolverProc::SetDefault(current_proc_);
313 current_proc_->SetLastProc(previous_proc_); 313 current_proc_->SetLastProc(previous_proc_);
314 } 314 }
315 315
316 } // namespace net 316 } // namespace net
OLDNEW
« no previous file with comments | « net/base/host_resolver_impl_unittest.cc ('k') | net/proxy/proxy_script_fetcher_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698