| 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 STRING, // Default: In a std::string | 276 STRING, // Default: In a std::string |
| 277 TEMP_FILE // Write to a temp file | 277 TEMP_FILE // Write to a temp file |
| 278 }; | 278 }; |
| 279 | 279 |
| 280 // Returns the delegate. | 280 // Returns the delegate. |
| 281 Delegate* delegate() const; | 281 Delegate* delegate() const; |
| 282 | 282 |
| 283 // Used by tests. | 283 // Used by tests. |
| 284 const std::string& upload_data() const; | 284 const std::string& upload_data() const; |
| 285 | 285 |
| 286 // Used by tests. |
| 287 void set_was_fetched_via_proxy(bool flag); |
| 288 |
| 289 // Used by tests. |
| 290 void set_response_headers(scoped_refptr<net::HttpResponseHeaders> headers); |
| 291 |
| 286 virtual void SetResponseDestinationForTesting(ResponseDestinationType); | 292 virtual void SetResponseDestinationForTesting(ResponseDestinationType); |
| 287 virtual ResponseDestinationType GetResponseDestinationForTesting() const; | 293 virtual ResponseDestinationType GetResponseDestinationForTesting() const; |
| 288 | 294 |
| 289 private: | 295 private: |
| 290 friend class ScopedURLFetcherFactory; | 296 friend class ScopedURLFetcherFactory; |
| 291 friend class TestURLFetcher; | 297 friend class TestURLFetcher; |
| 292 friend class URLFetcherTest; | 298 friend class URLFetcherTest; |
| 293 | 299 |
| 294 // Only used by URLFetcherTest, returns the number of URLFetcher::Core objects | 300 // Only used by URLFetcherTest, returns the number of URLFetcher::Core objects |
| 295 // actively running. | 301 // actively running. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 313 | 319 |
| 314 // Back-off time delay. 0 by default. | 320 // Back-off time delay. 0 by default. |
| 315 base::TimeDelta backoff_delay_; | 321 base::TimeDelta backoff_delay_; |
| 316 | 322 |
| 317 static bool g_interception_enabled; | 323 static bool g_interception_enabled; |
| 318 | 324 |
| 319 DISALLOW_COPY_AND_ASSIGN(URLFetcher); | 325 DISALLOW_COPY_AND_ASSIGN(URLFetcher); |
| 320 }; | 326 }; |
| 321 | 327 |
| 322 #endif // CONTENT_COMMON_NET_URL_FETCHER_H_ | 328 #endif // CONTENT_COMMON_NET_URL_FETCHER_H_ |
| OLD | NEW |