OLD | NEW |
1 // Copyright (c) 2011 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 #include "net/base/net_api.h" | 15 #include "net/base/net_export.h" |
16 | 16 |
17 class GURL; | 17 class GURL; |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 | 20 |
21 class URLRequestContext; | 21 class URLRequestContext; |
22 | 22 |
23 // Interface for downloading a PAC script. Implementations can enforce | 23 // Interface for downloading a PAC script. Implementations can enforce |
24 // timeouts, maximum size constraints, content encoding, etc.. | 24 // timeouts, maximum size constraints, content encoding, etc.. |
25 class NET_TEST ProxyScriptFetcher { | 25 class NET_EXPORT_PRIVATE ProxyScriptFetcher { |
26 public: | 26 public: |
27 // Destruction should cancel any outstanding requests. | 27 // Destruction should cancel any outstanding requests. |
28 virtual ~ProxyScriptFetcher() {} | 28 virtual ~ProxyScriptFetcher() {} |
29 | 29 |
30 // Downloads the given PAC URL, and invokes |callback| on completion. | 30 // Downloads the given PAC URL, and invokes |callback| on completion. |
31 // Returns OK on success, otherwise the error code. If the return code is | 31 // Returns OK on success, otherwise the error code. If the return code is |
32 // ERR_IO_PENDING, then the request completes asynchronously, and |callback| | 32 // ERR_IO_PENDING, then the request completes asynchronously, and |callback| |
33 // will be invoked later with the final error code. | 33 // will be invoked later with the final error code. |
34 // After synchronous or asynchronous completion with a result code of OK, | 34 // After synchronous or asynchronous completion with a result code of OK, |
35 // |*utf16_text| is filled with the response. On failure, the result text is | 35 // |*utf16_text| is filled with the response. On failure, the result text is |
(...skipping 16 matching lines...) Expand all Loading... |
52 virtual void Cancel() = 0; | 52 virtual void Cancel() = 0; |
53 | 53 |
54 // Returns the request context that this fetcher uses to issue downloads, | 54 // Returns the request context that this fetcher uses to issue downloads, |
55 // or NULL. | 55 // or NULL. |
56 virtual URLRequestContext* GetRequestContext() const = 0; | 56 virtual URLRequestContext* GetRequestContext() const = 0; |
57 }; | 57 }; |
58 | 58 |
59 } // namespace net | 59 } // namespace net |
60 | 60 |
61 #endif // NET_PROXY_PROXY_SCRIPT_FETCHER_H_ | 61 #endif // NET_PROXY_PROXY_SCRIPT_FETCHER_H_ |
OLD | NEW |