| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef NET_PROXY_PROXY_RESOLVER_WINHTTP_H_ | 5 #ifndef NET_PROXY_PROXY_RESOLVER_WINHTTP_H_ |
| 6 #define NET_PROXY_PROXY_RESOLVER_WINHTTP_H_ | 6 #define NET_PROXY_PROXY_RESOLVER_WINHTTP_H_ |
| 7 | 7 |
| 8 #include "net/proxy/proxy_service.h" | 8 #include "net/proxy/proxy_service.h" |
| 9 | 9 |
| 10 typedef LPVOID HINTERNET; // From winhttp.h | 10 typedef LPVOID HINTERNET; // From winhttp.h |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 | 13 |
| 14 // An implementation of ProxyResolver that uses WinHTTP and the system | 14 // An implementation of ProxyResolver that uses WinHTTP and the system |
| 15 // proxy settings. | 15 // proxy settings. |
| 16 class ProxyResolverWinHttp : public ProxyResolver { | 16 class ProxyResolverWinHttp : public ProxyResolver { |
| 17 public: | 17 public: |
| 18 ProxyResolverWinHttp(); | 18 ProxyResolverWinHttp(); |
| 19 ~ProxyResolverWinHttp(); | 19 ~ProxyResolverWinHttp(); |
| 20 | 20 |
| 21 // ProxyResolver implementation: | 21 // ProxyResolver implementation: |
| 22 virtual int GetProxyConfig(ProxyConfig* config); | |
| 23 virtual int GetProxyForURL(const GURL& query_url, | 22 virtual int GetProxyForURL(const GURL& query_url, |
| 24 const GURL& pac_url, | 23 const GURL& pac_url, |
| 25 ProxyInfo* results); | 24 ProxyInfo* results); |
| 26 | 25 |
| 27 private: | 26 private: |
| 28 bool OpenWinHttpSession(); | 27 bool OpenWinHttpSession(); |
| 29 void CloseWinHttpSession(); | 28 void CloseWinHttpSession(); |
| 30 | 29 |
| 31 // Proxy configuration is cached on the session handle. | 30 // Proxy configuration is cached on the session handle. |
| 32 HINTERNET session_handle_; | 31 HINTERNET session_handle_; |
| 33 | 32 |
| 34 DISALLOW_COPY_AND_ASSIGN(ProxyResolverWinHttp); | 33 DISALLOW_COPY_AND_ASSIGN(ProxyResolverWinHttp); |
| 35 }; | 34 }; |
| 36 | 35 |
| 37 } // namespace net | 36 } // namespace net |
| 38 | 37 |
| 39 #endif // NET_PROXY_PROXY_RESOLVER_WINHTTP_H_ | 38 #endif // NET_PROXY_PROXY_RESOLVER_WINHTTP_H_ |
| 40 | 39 |
| OLD | NEW |