| 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 |
| 113 private: | 117 private: |
| 114 // Helper to execute a syncrhonous DNS resolve, using the per-request | 118 // Helper to execute a synchronous DNS resolve, using the per-request |
| 115 // DNS cache if there is one. | 119 // DNS cache if there is one. |
| 116 int DnsResolveHelper(const HostResolver::RequestInfo& info, | 120 int DnsResolveHelper(const HostResolver::RequestInfo& info, |
| 117 AddressList* address_list) { | 121 AddressList* address_list) { |
| 118 HostCache::Key cache_key(info.hostname(), | 122 HostCache::Key cache_key(info.hostname(), |
| 119 info.address_family(), | 123 info.address_family(), |
| 120 info.host_resolver_flags()); | 124 info.host_resolver_flags()); |
| 121 | 125 |
| 122 HostCache* host_cache = current_request_context() ? | 126 HostCache* host_cache = current_request_context() ? |
| 123 current_request_context()->host_cache : NULL; | 127 current_request_context()->host_cache : NULL; |
| 124 | 128 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 153 | 157 |
| 154 } // namespace | 158 } // namespace |
| 155 | 159 |
| 156 // static | 160 // static |
| 157 ProxyResolverJSBindings* ProxyResolverJSBindings::CreateDefault( | 161 ProxyResolverJSBindings* ProxyResolverJSBindings::CreateDefault( |
| 158 HostResolver* host_resolver) { | 162 HostResolver* host_resolver) { |
| 159 return new DefaultJSBindings(host_resolver); | 163 return new DefaultJSBindings(host_resolver); |
| 160 } | 164 } |
| 161 | 165 |
| 162 } // namespace net | 166 } // namespace net |
| OLD | NEW |