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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
213 bool was_fetched_via_proxy() const; | 213 bool was_fetched_via_proxy() const; |
214 | 214 |
215 // Start the request. After this is called, you may not change any other | 215 // Start the request. After this is called, you may not change any other |
216 // settings. | 216 // settings. |
217 virtual void Start(); | 217 virtual void Start(); |
218 | 218 |
219 // Restarts the URLFetcher with a new URLRequestContextGetter. | 219 // Restarts the URLFetcher with a new URLRequestContextGetter. |
220 void StartWithRequestContextGetter( | 220 void StartWithRequestContextGetter( |
221 net::URLRequestContextGetter* request_context_getter); | 221 net::URLRequestContextGetter* request_context_getter); |
222 | 222 |
223 // Return the URL that we were asked to fetch. | |
224 virtual const GURL& original_url() const; | |
jam
2011/08/15 16:08:25
it's unfortunate that this whole class goes agains
| |
225 | |
223 // Return the URL that this fetcher is processing. | 226 // Return the URL that this fetcher is processing. |
224 virtual const GURL& url() const; | 227 virtual const GURL& url() const; |
225 | 228 |
226 // The status of the URL fetch. | 229 // The status of the URL fetch. |
227 virtual const net::URLRequestStatus& status() const; | 230 virtual const net::URLRequestStatus& status() const; |
228 | 231 |
229 // The http response code received. Will return | 232 // The http response code received. Will return |
230 // URLFetcher::kInvalidHttpResponseCode if an error prevented any response | 233 // URLFetcher::kInvalidHttpResponseCode if an error prevented any response |
231 // from being received. | 234 // from being received. |
232 virtual int response_code() const; | 235 virtual int response_code() const; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
311 | 314 |
312 // Back-off time delay. 0 by default. | 315 // Back-off time delay. 0 by default. |
313 base::TimeDelta backoff_delay_; | 316 base::TimeDelta backoff_delay_; |
314 | 317 |
315 static bool g_interception_enabled; | 318 static bool g_interception_enabled; |
316 | 319 |
317 DISALLOW_COPY_AND_ASSIGN(URLFetcher); | 320 DISALLOW_COPY_AND_ASSIGN(URLFetcher); |
318 }; | 321 }; |
319 | 322 |
320 #endif // CONTENT_COMMON_URL_FETCHER_H_ | 323 #endif // CONTENT_COMMON_URL_FETCHER_H_ |
OLD | NEW |