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 #include "net/base/mock_host_resolver.h" | 5 #include "net/base/mock_host_resolver.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/platform_thread.h" | 8 #include "base/platform_thread.h" |
9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 HostCache* cache = NULL; | 96 HostCache* cache = NULL; |
97 | 97 |
98 if (use_caching_) { | 98 if (use_caching_) { |
99 cache = new HostCache( | 99 cache = new HostCache( |
100 100, // max entries. | 100 100, // max entries. |
101 base::TimeDelta::FromMinutes(1), | 101 base::TimeDelta::FromMinutes(1), |
102 base::TimeDelta::FromSeconds(0)); | 102 base::TimeDelta::FromSeconds(0)); |
103 } | 103 } |
104 | 104 |
105 impl_ = new HostResolverImpl(proc, cache, 50u); | 105 impl_ = new HostResolverImpl(proc, cache, 50u, NULL); |
106 } | 106 } |
107 | 107 |
108 //----------------------------------------------------------------------------- | 108 //----------------------------------------------------------------------------- |
109 | 109 |
110 struct RuleBasedHostResolverProc::Rule { | 110 struct RuleBasedHostResolverProc::Rule { |
111 enum ResolverType { | 111 enum ResolverType { |
112 kResolverTypeFail, | 112 kResolverTypeFail, |
113 kResolverTypeSystem, | 113 kResolverTypeSystem, |
114 kResolverTypeIPLiteral, | 114 kResolverTypeIPLiteral, |
115 }; | 115 }; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 CHECK_EQ(old_proc, current_proc_); | 262 CHECK_EQ(old_proc, current_proc_); |
263 } | 263 } |
264 | 264 |
265 void ScopedDefaultHostResolverProc::Init(HostResolverProc* proc) { | 265 void ScopedDefaultHostResolverProc::Init(HostResolverProc* proc) { |
266 current_proc_ = proc; | 266 current_proc_ = proc; |
267 previous_proc_ = HostResolverProc::SetDefault(current_proc_); | 267 previous_proc_ = HostResolverProc::SetDefault(current_proc_); |
268 current_proc_->SetLastProc(previous_proc_); | 268 current_proc_->SetLastProc(previous_proc_); |
269 } | 269 } |
270 | 270 |
271 } // namespace net | 271 } // namespace net |
OLD | NEW |