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_winhttp.h" | 5 #include "net/proxy/proxy_resolver_winhttp.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <winhttp.h> | 8 #include <winhttp.h> |
9 | 9 |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // | 101 // |
102 // ([<scheme>=][<scheme>"://"]<server>[":"<port>]) | 102 // ([<scheme>=][<scheme>"://"]<server>[":"<port>]) |
103 // | 103 // |
104 // Based on this description, ProxyInfo::UseNamedProxy() isn't | 104 // Based on this description, ProxyInfo::UseNamedProxy() isn't |
105 // going to handle all the variations (in particular <scheme>=). | 105 // going to handle all the variations (in particular <scheme>=). |
106 // | 106 // |
107 // However in practice, it seems that WinHTTP is simply returning | 107 // However in practice, it seems that WinHTTP is simply returning |
108 // things like "foopy1:80;foopy2:80". It strips out the non-HTTP | 108 // things like "foopy1:80;foopy2:80". It strips out the non-HTTP |
109 // proxy types, and stops the list when PAC encounters a "DIRECT". | 109 // proxy types, and stops the list when PAC encounters a "DIRECT". |
110 // So UseNamedProxy() should work OK. | 110 // So UseNamedProxy() should work OK. |
111 results->UseNamedProxy(WideToASCII(info.lpszProxy)); | 111 results->UseNamedProxy(base::UTF16ToASCII(info.lpszProxy)); |
112 break; | 112 break; |
113 default: | 113 default: |
114 NOTREACHED(); | 114 NOTREACHED(); |
115 rv = ERR_FAILED; | 115 rv = ERR_FAILED; |
116 } | 116 } |
117 | 117 |
118 FreeInfo(&info); | 118 FreeInfo(&info); |
119 return rv; | 119 return rv; |
120 } | 120 } |
121 | 121 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 } | 165 } |
166 | 166 |
167 void ProxyResolverWinHttp::CloseWinHttpSession() { | 167 void ProxyResolverWinHttp::CloseWinHttpSession() { |
168 if (session_handle_) { | 168 if (session_handle_) { |
169 WinHttpCloseHandle(session_handle_); | 169 WinHttpCloseHandle(session_handle_); |
170 session_handle_ = NULL; | 170 session_handle_ = NULL; |
171 } | 171 } |
172 } | 172 } |
173 | 173 |
174 } // namespace net | 174 } // namespace net |
OLD | NEW |