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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 HostCache* cache = NULL; | 92 HostCache* cache = NULL; |
93 | 93 |
94 if (use_caching_) { | 94 if (use_caching_) { |
95 cache = new HostCache( | 95 cache = new HostCache( |
96 100, // max entries. | 96 100, // max entries. |
97 base::TimeDelta::FromMinutes(1), | 97 base::TimeDelta::FromMinutes(1), |
98 base::TimeDelta::FromSeconds(0)); | 98 base::TimeDelta::FromSeconds(0)); |
99 } | 99 } |
100 | 100 |
101 impl_ = new HostResolverImpl(proc, cache, NULL, 50u); | 101 impl_ = new HostResolverImpl(proc, cache, 50u); |
102 } | 102 } |
103 | 103 |
104 //----------------------------------------------------------------------------- | 104 //----------------------------------------------------------------------------- |
105 | 105 |
106 struct RuleBasedHostResolverProc::Rule { | 106 struct RuleBasedHostResolverProc::Rule { |
107 enum ResolverType { | 107 enum ResolverType { |
108 kResolverTypeFail, | 108 kResolverTypeFail, |
109 kResolverTypeSystem, | 109 kResolverTypeSystem, |
110 kResolverTypeIPLiteral, | 110 kResolverTypeIPLiteral, |
111 }; | 111 }; |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 CHECK_EQ(old_proc, current_proc_); | 254 CHECK_EQ(old_proc, current_proc_); |
255 } | 255 } |
256 | 256 |
257 void ScopedDefaultHostResolverProc::Init(HostResolverProc* proc) { | 257 void ScopedDefaultHostResolverProc::Init(HostResolverProc* proc) { |
258 current_proc_ = proc; | 258 current_proc_ = proc; |
259 previous_proc_ = HostResolverProc::SetDefault(current_proc_); | 259 previous_proc_ = HostResolverProc::SetDefault(current_proc_); |
260 current_proc_->SetLastProc(previous_proc_); | 260 current_proc_->SetLastProc(previous_proc_); |
261 } | 261 } |
262 | 262 |
263 } // namespace net | 263 } // namespace net |
OLD | NEW |