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 28 matching lines...) Expand all Loading... |
39 const std::string& upload_content) OVERRIDE; | 39 const std::string& upload_content) OVERRIDE; |
40 virtual void SetChunkedUpload( | 40 virtual void SetChunkedUpload( |
41 const std::string& upload_content_type) OVERRIDE; | 41 const std::string& upload_content_type) OVERRIDE; |
42 virtual void AppendChunkToUpload(const std::string& data, | 42 virtual void AppendChunkToUpload(const std::string& data, |
43 bool is_last_chunk) OVERRIDE; | 43 bool is_last_chunk) OVERRIDE; |
44 virtual void SetLoadFlags(int load_flags) OVERRIDE; | 44 virtual void SetLoadFlags(int load_flags) OVERRIDE; |
45 virtual int GetLoadFlags() const OVERRIDE; | 45 virtual int GetLoadFlags() const OVERRIDE; |
46 virtual void SetReferrer(const std::string& referrer) OVERRIDE; | 46 virtual void SetReferrer(const std::string& referrer) OVERRIDE; |
47 virtual void SetExtraRequestHeaders( | 47 virtual void SetExtraRequestHeaders( |
48 const std::string& extra_request_headers) OVERRIDE; | 48 const std::string& extra_request_headers) OVERRIDE; |
| 49 virtual void AddExtraRequestHeader(const std::string& header_line) OVERRIDE; |
49 virtual void GetExtraRequestHeaders( | 50 virtual void GetExtraRequestHeaders( |
50 net::HttpRequestHeaders* headers) OVERRIDE; | 51 net::HttpRequestHeaders* headers) OVERRIDE; |
51 virtual void SetRequestContext( | 52 virtual void SetRequestContext( |
52 net::URLRequestContextGetter* request_context_getter) OVERRIDE; | 53 net::URLRequestContextGetter* request_context_getter) OVERRIDE; |
53 virtual void SetAutomaticallyRetryOn5xx(bool retry) OVERRIDE; | 54 virtual void SetAutomaticallyRetryOn5xx(bool retry) OVERRIDE; |
54 virtual void SetMaxRetries(int max_retries) OVERRIDE; | 55 virtual void SetMaxRetries(int max_retries) OVERRIDE; |
55 virtual int GetMaxRetries() const OVERRIDE; | 56 virtual int GetMaxRetries() const OVERRIDE; |
56 virtual base::TimeDelta GetBackoffDelay() const OVERRIDE; | 57 virtual base::TimeDelta GetBackoffDelay() const OVERRIDE; |
57 virtual void SaveResponseToTemporaryFile( | 58 virtual void SaveResponseToTemporaryFile( |
58 scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy) OVERRIDE; | 59 scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy) OVERRIDE; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // NOTE: for safety, this should only be used through ScopedURLFetcherFactory! | 116 // NOTE: for safety, this should only be used through ScopedURLFetcherFactory! |
116 static void set_factory(content::URLFetcherFactory* factory); | 117 static void set_factory(content::URLFetcherFactory* factory); |
117 | 118 |
118 class Core; | 119 class Core; |
119 scoped_refptr<Core> core_; | 120 scoped_refptr<Core> core_; |
120 | 121 |
121 DISALLOW_COPY_AND_ASSIGN(URLFetcherImpl); | 122 DISALLOW_COPY_AND_ASSIGN(URLFetcherImpl); |
122 }; | 123 }; |
123 | 124 |
124 #endif // CONTENT_COMMON_NET_URL_FETCHER_IMPL_H_ | 125 #endif // CONTENT_COMMON_NET_URL_FETCHER_IMPL_H_ |
OLD | NEW |