| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_MAC_H_ | 5 #ifndef NET_PROXY_PROXY_CONFIG_SERVICE_MAC_H_ |
| 6 #define NET_PROXY_PROXY_RESOLVER_MAC_H_ | 6 #define NET_PROXY_PROXY_CONFIG_SERVICE_MAC_H_ |
| 7 | 7 |
| 8 #include <string> | |
| 9 | |
| 10 #include "googleurl/src/gurl.h" | |
| 11 #include "net/base/net_errors.h" | |
| 12 #include "net/proxy/proxy_config_service.h" | 8 #include "net/proxy/proxy_config_service.h" |
| 13 #include "net/proxy/proxy_resolver.h" | |
| 14 | 9 |
| 15 namespace net { | 10 namespace net { |
| 16 | 11 |
| 17 // Implementation of ProxyResolver that uses the Mac CFProxySupport to implement | |
| 18 // proxies. | |
| 19 class ProxyResolverMac : public ProxyResolver { | |
| 20 public: | |
| 21 ProxyResolverMac() : ProxyResolver(false /*expects_pac_bytes*/) {} | |
| 22 | |
| 23 // ProxyResolver methods: | |
| 24 virtual int GetProxyForURL(const GURL& url, | |
| 25 ProxyInfo* results, | |
| 26 CompletionCallback* callback, | |
| 27 RequestHandle* request, | |
| 28 LoadLog* load_log); | |
| 29 | |
| 30 virtual void CancelRequest(RequestHandle request) { | |
| 31 NOTREACHED(); | |
| 32 } | |
| 33 | |
| 34 private: | |
| 35 virtual int SetPacScript(const GURL& pac_url, | |
| 36 const std::string& /*pac_bytes*/, | |
| 37 CompletionCallback* /*callback*/) { | |
| 38 pac_url_ = pac_url; | |
| 39 return OK; | |
| 40 } | |
| 41 | |
| 42 GURL pac_url_; | |
| 43 }; | |
| 44 | |
| 45 class ProxyConfigServiceMac : public ProxyConfigService { | 12 class ProxyConfigServiceMac : public ProxyConfigService { |
| 46 public: | 13 public: |
| 47 // ProxyConfigService methods: | 14 // ProxyConfigService methods: |
| 48 virtual int GetProxyConfig(ProxyConfig* config); | 15 virtual int GetProxyConfig(ProxyConfig* config); |
| 49 }; | 16 }; |
| 50 | 17 |
| 51 } // namespace net | 18 } // namespace net |
| 52 | 19 |
| 53 #endif // NET_PROXY_PROXY_RESOLVER_MAC_H_ | 20 #endif // NET_PROXY_PROXY_CONFIG_SERVICE_MAC_H_ |
| OLD | NEW |