OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |