| 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/proxy/proxy_resolver_js_bindings.h" | 5 #include "net/proxy/proxy_resolver_js_bindings.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "net/base/address_list.h" | 9 #include "net/base/address_list.h" |
| 10 #include "net/base/host_cache.h" | 10 #include "net/base/host_cache.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 103 } |
| 104 | 104 |
| 105 // Handler for when an error is encountered. |line_number| may be -1. | 105 // Handler for when an error is encountered. |line_number| may be -1. |
| 106 virtual void OnError(int line_number, const string16& message) { | 106 virtual void OnError(int line_number, const string16& message) { |
| 107 if (line_number == -1) | 107 if (line_number == -1) |
| 108 LOG(INFO) << "PAC-error: " << message; | 108 LOG(INFO) << "PAC-error: " << message; |
| 109 else | 109 else |
| 110 LOG(INFO) << "PAC-error: " << "line: " << line_number << ": " << message; | 110 LOG(INFO) << "PAC-error: " << "line: " << line_number << ": " << message; |
| 111 } | 111 } |
| 112 | 112 |
| 113 virtual void Shutdown() { | |
| 114 host_resolver_->Shutdown(); | |
| 115 } | |
| 116 | |
| 117 private: | 113 private: |
| 118 // Helper to execute a synchronous DNS resolve, using the per-request | 114 // Helper to execute a syncrhonous DNS resolve, using the per-request |
| 119 // DNS cache if there is one. | 115 // DNS cache if there is one. |
| 120 int DnsResolveHelper(const HostResolver::RequestInfo& info, | 116 int DnsResolveHelper(const HostResolver::RequestInfo& info, |
| 121 AddressList* address_list) { | 117 AddressList* address_list) { |
| 122 HostCache::Key cache_key(info.hostname(), | 118 HostCache::Key cache_key(info.hostname(), |
| 123 info.address_family(), | 119 info.address_family(), |
| 124 info.host_resolver_flags()); | 120 info.host_resolver_flags()); |
| 125 | 121 |
| 126 HostCache* host_cache = current_request_context() ? | 122 HostCache* host_cache = current_request_context() ? |
| 127 current_request_context()->host_cache : NULL; | 123 current_request_context()->host_cache : NULL; |
| 128 | 124 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 157 | 153 |
| 158 } // namespace | 154 } // namespace |
| 159 | 155 |
| 160 // static | 156 // static |
| 161 ProxyResolverJSBindings* ProxyResolverJSBindings::CreateDefault( | 157 ProxyResolverJSBindings* ProxyResolverJSBindings::CreateDefault( |
| 162 HostResolver* host_resolver) { | 158 HostResolver* host_resolver) { |
| 163 return new DefaultJSBindings(host_resolver); | 159 return new DefaultJSBindings(host_resolver); |
| 164 } | 160 } |
| 165 | 161 |
| 166 } // namespace net | 162 } // namespace net |
| OLD | NEW |