| 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/proxy/proxy_resolver_js_bindings.h" | 5 #include "net/proxy/proxy_resolver_js_bindings.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 return entry->error; | 256 return entry->error; |
| 257 } | 257 } |
| 258 } | 258 } |
| 259 | 259 |
| 260 // Otherwise ask the host resolver. | 260 // Otherwise ask the host resolver. |
| 261 int result = host_resolver_->Resolve(info, address_list); | 261 int result = host_resolver_->Resolve(info, address_list); |
| 262 | 262 |
| 263 // Save the result back to the per-request DNS cache. | 263 // Save the result back to the per-request DNS cache. |
| 264 if (host_cache) { | 264 if (host_cache) { |
| 265 host_cache->Set(cache_key, result, *address_list, | 265 host_cache->Set(cache_key, result, *address_list, |
| 266 base::TimeDelta::FromMinutes(5), |
| 266 base::TimeTicks::Now()); | 267 base::TimeTicks::Now()); |
| 267 } | 268 } |
| 268 | 269 |
| 269 return result; | 270 return result; |
| 270 } | 271 } |
| 271 | 272 |
| 272 void LogEventToCurrentRequest( | 273 void LogEventToCurrentRequest( |
| 273 NetLog::EventPhase phase, | 274 NetLog::EventPhase phase, |
| 274 NetLog::EventType type, | 275 NetLog::EventType type, |
| 275 scoped_refptr<NetLog::EventParameters> params) { | 276 scoped_refptr<NetLog::EventParameters> params) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 303 | 304 |
| 304 // static | 305 // static |
| 305 ProxyResolverJSBindings* ProxyResolverJSBindings::CreateDefault( | 306 ProxyResolverJSBindings* ProxyResolverJSBindings::CreateDefault( |
| 306 SyncHostResolver* host_resolver, | 307 SyncHostResolver* host_resolver, |
| 307 NetLog* net_log, | 308 NetLog* net_log, |
| 308 ProxyResolverErrorObserver* error_observer) { | 309 ProxyResolverErrorObserver* error_observer) { |
| 309 return new DefaultJSBindings(host_resolver, net_log, error_observer); | 310 return new DefaultJSBindings(host_resolver, net_log, error_observer); |
| 310 } | 311 } |
| 311 | 312 |
| 312 } // namespace net | 313 } // namespace net |
| OLD | NEW |