| 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_SERVICE_H_ | 5 #ifndef NET_PROXY_PROXY_SERVICE_H_ | 
| 6 #define NET_PROXY_PROXY_SERVICE_H_ | 6 #define NET_PROXY_PROXY_SERVICE_H_ | 
| 7 | 7 | 
| 8 #include <map> | 8 #include <map> | 
| 9 #include <vector> | 9 #include <vector> | 
| 10 | 10 | 
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 76   // this delay. | 76   // this delay. | 
| 77   base::TimeDelta current_delay; | 77   base::TimeDelta current_delay; | 
| 78 }; | 78 }; | 
| 79 | 79 | 
| 80 // Map of proxy servers with the associated RetryInfo structures. | 80 // Map of proxy servers with the associated RetryInfo structures. | 
| 81 typedef std::map<std::string, ProxyRetryInfo> ProxyRetryInfoMap; | 81 typedef std::map<std::string, ProxyRetryInfo> ProxyRetryInfoMap; | 
| 82 | 82 | 
| 83 // This class can be used to resolve the proxy server to use when loading a | 83 // This class can be used to resolve the proxy server to use when loading a | 
| 84 // HTTP(S) URL.  It uses the given ProxyResolver to handle the actual proxy | 84 // HTTP(S) URL.  It uses the given ProxyResolver to handle the actual proxy | 
| 85 // resolution.  See ProxyResolverWinHttp for example. | 85 // resolution.  See ProxyResolverWinHttp for example. | 
| 86 class ProxyService { | 86 class ProxyService : public base::RefCounted<ProxyService> { | 
| 87  public: | 87  public: | 
| 88   // The instance takes ownership of |resolver|. | 88   // The instance takes ownership of |resolver|. | 
| 89   explicit ProxyService(ProxyResolver* resolver); | 89   explicit ProxyService(ProxyResolver* resolver); | 
| 90 | 90 | 
| 91   // Used internally to handle PAC queries. | 91   // Used internally to handle PAC queries. | 
| 92   class PacRequest; | 92   class PacRequest; | 
| 93 | 93 | 
| 94   // Returns OK if proxy information could be provided synchronously.  Else, | 94   // Returns OK if proxy information could be provided synchronously.  Else, | 
| 95   // ERR_IO_PENDING is returned to indicate that the result will be available | 95   // ERR_IO_PENDING is returned to indicate that the result will be available | 
| 96   // when the callback is run.  The callback is run on the thread that calls | 96   // when the callback is run.  The callback is run on the thread that calls | 
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 131                                 PacRequest** pac_request); | 131                                 PacRequest** pac_request); | 
| 132 | 132 | 
| 133   // Call this method with a non-null |pac_request| to cancel the PAC request. | 133   // Call this method with a non-null |pac_request| to cancel the PAC request. | 
| 134   void CancelPacRequest(PacRequest* pac_request); | 134   void CancelPacRequest(PacRequest* pac_request); | 
| 135 | 135 | 
| 136   // Create a proxy service using the specified settings. If |pi| is NULL then | 136   // Create a proxy service using the specified settings. If |pi| is NULL then | 
| 137   // the system's default proxy settings will be used (on Windows this will | 137   // the system's default proxy settings will be used (on Windows this will | 
| 138   // use IE's settings). | 138   // use IE's settings). | 
| 139   static ProxyService* Create(const ProxyInfo* pi); | 139   static ProxyService* Create(const ProxyInfo* pi); | 
| 140 | 140 | 
|  | 141   // Create a ProxyService which fails every request, causing fallback to a | 
|  | 142   // direct connection. Convenience function used by unit tests. | 
|  | 143   static ProxyService* CreateNull(); | 
|  | 144 | 
| 141   // TODO(eroman): remove once WinHTTP is gone. | 145   // TODO(eroman): remove once WinHTTP is gone. | 
| 142   // Get the ProxyInfo used to create this proxy service (only used by WinHTTP). | 146   // Get the ProxyInfo used to create this proxy service (only used by WinHTTP). | 
| 143   const ProxyInfo* proxy_info() const { | 147   const ProxyInfo* proxy_info() const { | 
| 144     return proxy_info_.get(); | 148     return proxy_info_.get(); | 
| 145   } | 149   } | 
| 146 | 150 | 
| 147  private: | 151  private: | 
| 148   friend class PacRequest; | 152   friend class PacRequest; | 
| 149 | 153 | 
| 150   ProxyResolver* resolver() { return resolver_.get(); } | 154   ProxyResolver* resolver() { return resolver_.get(); } | 
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 304   // code if otherwise. | 308   // code if otherwise. | 
| 305   virtual int GetProxyForURL(const GURL& query_url, | 309   virtual int GetProxyForURL(const GURL& query_url, | 
| 306                              const GURL& pac_url, | 310                              const GURL& pac_url, | 
| 307                              ProxyInfo* results) = 0; | 311                              ProxyInfo* results) = 0; | 
| 308 }; | 312 }; | 
| 309 | 313 | 
| 310 }  // namespace net | 314 }  // namespace net | 
| 311 | 315 | 
| 312 #endif  // NET_PROXY_PROXY_SERVICE_H_ | 316 #endif  // NET_PROXY_PROXY_SERVICE_H_ | 
| 313 | 317 | 
| OLD | NEW | 
|---|