| 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_CONFIG_SERVICE_WIN_H_ |
| 6 #define NET_PROXY_PROXY_RESOLVER_WINHTTP_H_ | 6 #define NET_PROXY_PROXY_CONFIG_SERVICE_WIN_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 | |
| 11 | |
| 12 namespace net { | 10 namespace net { |
| 13 | 11 |
| 14 // An implementation of ProxyResolver that uses WinHTTP and the system | 12 // Implementation of ProxyConfigService that retrieves the system proxy |
| 15 // proxy settings. | 13 // settings. |
| 16 class ProxyResolverWinHttp : public ProxyResolver { | 14 class ProxyConfigServiceWin : public ProxyConfigService { |
| 17 public: | 15 public: |
| 18 ProxyResolverWinHttp(); | 16 // ProxyConfigService methods. |
| 19 ~ProxyResolverWinHttp(); | |
| 20 | |
| 21 // ProxyResolver implementation: | |
| 22 virtual int GetProxyConfig(ProxyConfig* config); | 17 virtual int GetProxyConfig(ProxyConfig* config); |
| 23 virtual int GetProxyForURL(const GURL& query_url, | |
| 24 const GURL& pac_url, | |
| 25 ProxyInfo* results); | |
| 26 | |
| 27 private: | |
| 28 bool OpenWinHttpSession(); | |
| 29 void CloseWinHttpSession(); | |
| 30 | |
| 31 // Proxy configuration is cached on the session handle. | |
| 32 HINTERNET session_handle_; | |
| 33 | |
| 34 DISALLOW_COPY_AND_ASSIGN(ProxyResolverWinHttp); | |
| 35 }; | 18 }; |
| 36 | 19 |
| 37 } // namespace net | 20 } // namespace net |
| 38 | 21 |
| 39 #endif // NET_PROXY_PROXY_RESOLVER_WINHTTP_H_ | 22 #endif // NET_PROXY_PROXY_CONFIG_SERVICE_WIN_H_ |
| 40 | 23 |
| OLD | NEW |