| 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 // This file contains URLFetcher, a wrapper around net::URLRequest that handles | 5 // This file contains URLFetcher, a wrapper around net::URLRequest that handles |
| 6 // low-level details like thread safety, ref counting, and incremental buffer | 6 // low-level details like thread safety, ref counting, and incremental buffer |
| 7 // reading. This is useful for callers who simply want to get the data from a | 7 // reading. This is useful for callers who simply want to get the data from a |
| 8 // URL and don't care about all the nitty-gritty details. | 8 // URL and don't care about all the nitty-gritty details. |
| 9 // | 9 // |
| 10 // NOTE(willchan): Only one "IO" thread is supported for URLFetcher. This is a | 10 // NOTE(willchan): Only one "IO" thread is supported for URLFetcher. This is a |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 // called before the request is started. | 136 // called before the request is started. |
| 137 void set_load_flags(int load_flags); | 137 void set_load_flags(int load_flags); |
| 138 | 138 |
| 139 // Returns the current load flags. | 139 // Returns the current load flags. |
| 140 int load_flags() const; | 140 int load_flags() const; |
| 141 | 141 |
| 142 // Set extra headers on the request. Must be called before the request | 142 // Set extra headers on the request. Must be called before the request |
| 143 // is started. | 143 // is started. |
| 144 void set_extra_request_headers(const std::string& extra_request_headers); | 144 void set_extra_request_headers(const std::string& extra_request_headers); |
| 145 | 145 |
| 146 // Set the URLRequestContext on the request. Must be called before the | 146 // Set the net::URLRequestContext on the request. Must be called before the |
| 147 // request is started. | 147 // request is started. |
| 148 void set_request_context( | 148 void set_request_context( |
| 149 URLRequestContextGetter* request_context_getter); | 149 URLRequestContextGetter* request_context_getter); |
| 150 | 150 |
| 151 // If |retry| is false, 5xx responses will be propagated to the observer, | 151 // If |retry| is false, 5xx responses will be propagated to the observer, |
| 152 // if it is true URLFetcher will automatically re-execute the request, | 152 // if it is true URLFetcher will automatically re-execute the request, |
| 153 // after backoff_delay() elapses. URLFetcher has it set to true by default. | 153 // after backoff_delay() elapses. URLFetcher has it set to true by default. |
| 154 void set_automatically_retry_on_5xx(bool retry); | 154 void set_automatically_retry_on_5xx(bool retry); |
| 155 | 155 |
| 156 int max_retries() const { return max_retries_; } | 156 int max_retries() const { return max_retries_; } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 base::TimeDelta backoff_delay_; | 213 base::TimeDelta backoff_delay_; |
| 214 // Maximum retries allowed. | 214 // Maximum retries allowed. |
| 215 int max_retries_; | 215 int max_retries_; |
| 216 | 216 |
| 217 static bool g_interception_enabled; | 217 static bool g_interception_enabled; |
| 218 | 218 |
| 219 DISALLOW_COPY_AND_ASSIGN(URLFetcher); | 219 DISALLOW_COPY_AND_ASSIGN(URLFetcher); |
| 220 }; | 220 }; |
| 221 | 221 |
| 222 #endif // CHROME_COMMON_NET_URL_FETCHER_H_ | 222 #endif // CHROME_COMMON_NET_URL_FETCHER_H_ |
| OLD | NEW |