| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // 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_ |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // Aborts the in-progress fetch (if any). | 43 // Aborts the in-progress fetch (if any). |
| 44 virtual void Cancel() = 0; | 44 virtual void Cancel() = 0; |
| 45 | 45 |
| 46 // Create a ProxyScriptFetcher that uses |url_request_context|. | 46 // Create a ProxyScriptFetcher that uses |url_request_context|. |
| 47 static ProxyScriptFetcher* Create(URLRequestContext* url_request_context); | 47 static ProxyScriptFetcher* Create(URLRequestContext* url_request_context); |
| 48 | 48 |
| 49 // -------------------------------------------------------------------------- | 49 // -------------------------------------------------------------------------- |
| 50 // Testing helpers (only available to unit-tests). | 50 // Testing helpers (only available to unit-tests). |
| 51 // -------------------------------------------------------------------------- | 51 // -------------------------------------------------------------------------- |
| 52 private: | 52 private: |
| 53 FRIEND_TEST(ProxyScriptFetcherTest, DISABLED_Hang); | 53 FRIEND_TEST(ProxyScriptFetcherTest, Hang); |
| 54 FRIEND_TEST(ProxyScriptFetcherTest, DISABLED_TooLarge); | 54 FRIEND_TEST(ProxyScriptFetcherTest, TooLarge); |
| 55 | 55 |
| 56 // Sets the maximum duration for a fetch to |timeout_ms|. Returns the previous | 56 // Sets the maximum duration for a fetch to |timeout_ms|. Returns the previous |
| 57 // bound. | 57 // bound. |
| 58 static int SetTimeoutConstraintForUnittest(int timeout_ms); | 58 static int SetTimeoutConstraintForUnittest(int timeout_ms); |
| 59 | 59 |
| 60 // Sets the maximum response size for a fetch to |size_bytes|. Returns the | 60 // Sets the maximum response size for a fetch to |size_bytes|. Returns the |
| 61 // previous bound. | 61 // previous bound. |
| 62 static size_t SetSizeConstraintForUnittest(size_t size_bytes); | 62 static size_t SetSizeConstraintForUnittest(size_t size_bytes); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace net | 65 } // namespace net |
| 66 | 66 |
| 67 #endif // NET_PROXY_PROXY_SCRIPT_FETCHER_H_ | 67 #endif // NET_PROXY_PROXY_SCRIPT_FETCHER_H_ |
| OLD | NEW |