| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 const std::string& upload_content); | 133 const std::string& upload_content); |
| 134 | 134 |
| 135 // Indicates that the POST data is sent via chunked transfer encoding. | 135 // Indicates that the POST data is sent via chunked transfer encoding. |
| 136 // This may only be called before calling Start(). | 136 // This may only be called before calling Start(). |
| 137 // Use AppendChunkToUpload() to give the data chunks after calling Start(). | 137 // Use AppendChunkToUpload() to give the data chunks after calling Start(). |
| 138 void set_chunked_upload(const std::string& upload_content_type); | 138 void set_chunked_upload(const std::string& upload_content_type); |
| 139 | 139 |
| 140 // Adds the given bytes to a request's POST data transmitted using chunked | 140 // Adds the given bytes to a request's POST data transmitted using chunked |
| 141 // transfer encoding. | 141 // transfer encoding. |
| 142 // This method should be called ONLY after calling Start(). | 142 // This method should be called ONLY after calling Start(). |
| 143 void AppendChunkToUpload(const std::string& data); | 143 void AppendChunkToUpload(const std::string& data, bool is_last_chunk); |
| 144 | |
| 145 // Signals the end of a chunked transfer encoded data stream. This method | |
| 146 // should be called ONLY after calling Start(), set_chunked_upload() and | |
| 147 // typically one or more calls to AppendChunkToUpload. | |
| 148 void MarkEndOfChunks(); | |
| 149 | 144 |
| 150 // Set one or more load flags as defined in net/base/load_flags.h. Must be | 145 // Set one or more load flags as defined in net/base/load_flags.h. Must be |
| 151 // called before the request is started. | 146 // called before the request is started. |
| 152 void set_load_flags(int load_flags); | 147 void set_load_flags(int load_flags); |
| 153 | 148 |
| 154 // Returns the current load flags. | 149 // Returns the current load flags. |
| 155 int load_flags() const; | 150 int load_flags() const; |
| 156 | 151 |
| 157 // The referrer URL for the request. Must be called before the request is | 152 // The referrer URL for the request. Must be called before the request is |
| 158 // started. | 153 // started. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 base::TimeDelta backoff_delay_; | 227 base::TimeDelta backoff_delay_; |
| 233 // Maximum retries allowed. | 228 // Maximum retries allowed. |
| 234 int max_retries_; | 229 int max_retries_; |
| 235 | 230 |
| 236 static bool g_interception_enabled; | 231 static bool g_interception_enabled; |
| 237 | 232 |
| 238 DISALLOW_COPY_AND_ASSIGN(URLFetcher); | 233 DISALLOW_COPY_AND_ASSIGN(URLFetcher); |
| 239 }; | 234 }; |
| 240 | 235 |
| 241 #endif // CHROME_COMMON_NET_URL_FETCHER_H_ | 236 #endif // CHROME_COMMON_NET_URL_FETCHER_H_ |
| OLD | NEW |