| OLD | NEW |
| 1 // Copyright (c) 2010 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 // ProxyScriptFetcher is an async interface for fetching a proxy auto config | 5 // ProxyScriptFetcher is an async interface for fetching a proxy auto config |
| 6 // script. It is specific to fetching a PAC script; enforces timeout, max-size, | 6 // script. It is specific to fetching a PAC script; enforces timeout, max-size, |
| 7 // status code. | 7 // status code. |
| 8 | 8 |
| 9 #ifndef NET_PROXY_PROXY_SCRIPT_FETCHER_H_ | 9 #ifndef NET_PROXY_PROXY_SCRIPT_FETCHER_H_ |
| 10 #define NET_PROXY_PROXY_SCRIPT_FETCHER_H_ | 10 #define NET_PROXY_PROXY_SCRIPT_FETCHER_H_ |
| 11 #pragma once | 11 #pragma once |
| 12 | 12 |
| 13 #include "base/string16.h" | 13 #include "base/string16.h" |
| 14 #include "net/base/completion_callback.h" | 14 #include "net/base/completion_callback.h" |
| 15 | 15 |
| 16 class GURL; | 16 class GURL; |
| 17 class URLRequestContext; | |
| 18 | 17 |
| 19 namespace net { | 18 namespace net { |
| 20 | 19 |
| 20 class URLRequestContext; |
| 21 |
| 21 // Interface for downloading a PAC script. Implementations can enforce | 22 // Interface for downloading a PAC script. Implementations can enforce |
| 22 // timeouts, maximum size constraints, content encoding, etc.. | 23 // timeouts, maximum size constraints, content encoding, etc.. |
| 23 class ProxyScriptFetcher { | 24 class ProxyScriptFetcher { |
| 24 public: | 25 public: |
| 25 // Destruction should cancel any outstanding requests. | 26 // Destruction should cancel any outstanding requests. |
| 26 virtual ~ProxyScriptFetcher() {} | 27 virtual ~ProxyScriptFetcher() {} |
| 27 | 28 |
| 28 // Downloads the given PAC URL, and invokes |callback| on completion. | 29 // Downloads the given PAC URL, and invokes |callback| on completion. |
| 29 // On success |callback| is executed with a result code of OK, |*utf16_text| | 30 // On success |callback| is executed with a result code of OK, |*utf16_text| |
| 30 // is filled with the response. On failure, the result text is | 31 // is filled with the response. On failure, the result text is |
| (...skipping 16 matching lines...) Expand all Loading... |
| 47 virtual void Cancel() = 0; | 48 virtual void Cancel() = 0; |
| 48 | 49 |
| 49 // Returns the request context that this fetcher uses to issue downloads, | 50 // Returns the request context that this fetcher uses to issue downloads, |
| 50 // or NULL. | 51 // or NULL. |
| 51 virtual URLRequestContext* GetRequestContext() = 0; | 52 virtual URLRequestContext* GetRequestContext() = 0; |
| 52 }; | 53 }; |
| 53 | 54 |
| 54 } // namespace net | 55 } // namespace net |
| 55 | 56 |
| 56 #endif // NET_PROXY_PROXY_SCRIPT_FETCHER_H_ | 57 #endif // NET_PROXY_PROXY_SCRIPT_FETCHER_H_ |
| OLD | NEW |