OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 void set_expected_content_size(const int64& size) { | 188 void set_expected_content_size(const int64& size) { |
189 expected_content_size_ = size; | 189 expected_content_size_ = size; |
190 } | 190 } |
191 | 191 |
192 // Whether we have processed the response for that request yet. | 192 // Whether we have processed the response for that request yet. |
193 bool has_response_started() const { return has_handled_response_; } | 193 bool has_response_started() const { return has_handled_response_; } |
194 | 194 |
195 // FilterContext methods: | 195 // FilterContext methods: |
196 // These methods are not applicable to all connections. | 196 // These methods are not applicable to all connections. |
197 virtual bool GetMimeType(std::string* mime_type) const { return false; } | 197 virtual bool GetMimeType(std::string* mime_type) const { return false; } |
| 198 virtual int64 GetByteReadCount() const; |
198 virtual bool GetURL(GURL* gurl) const; | 199 virtual bool GetURL(GURL* gurl) const; |
199 virtual base::Time GetRequestTime() const; | 200 virtual base::Time GetRequestTime() const; |
200 virtual bool IsCachedContent() const; | 201 virtual bool IsCachedContent() const; |
201 virtual int GetInputStreambufferSize() const { return kFilterBufSize; } | 202 virtual int GetInputStreamBufferSize() const { return kFilterBufSize; } |
202 | 203 |
203 protected: | 204 protected: |
204 // Notifies the job that headers have been received. | 205 // Notifies the job that headers have been received. |
205 void NotifyHeadersComplete(); | 206 void NotifyHeadersComplete(); |
206 | 207 |
207 // Notifies the request that the job has completed a Read operation. | 208 // Notifies the request that the job has completed a Read operation. |
208 void NotifyReadComplete(int bytes_read); | 209 void NotifyReadComplete(int bytes_read); |
209 | 210 |
210 // Notifies the request that a start error has occurred. | 211 // Notifies the request that a start error has occurred. |
211 void NotifyStartError(const URLRequestStatus& status); | 212 void NotifyStartError(const URLRequestStatus& status); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 net::IOBuffer *read_buffer_; | 309 net::IOBuffer *read_buffer_; |
309 int read_buffer_len_; | 310 int read_buffer_len_; |
310 | 311 |
311 // Used by HandleResponseIfNecessary to track whether we've sent the | 312 // Used by HandleResponseIfNecessary to track whether we've sent the |
312 // OnResponseStarted callback and potentially redirect callbacks as well. | 313 // OnResponseStarted callback and potentially redirect callbacks as well. |
313 bool has_handled_response_; | 314 bool has_handled_response_; |
314 | 315 |
315 // Expected content size | 316 // Expected content size |
316 int64 expected_content_size_; | 317 int64 expected_content_size_; |
317 | 318 |
| 319 // Total number of bytes read from network (or cache) and and typically handed |
| 320 // to filter to process. Used to histogram compression ratios, and error |
| 321 // recovery scenarios in filters. |
| 322 int64 filter_input_byte_count_; |
| 323 |
318 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); | 324 DISALLOW_COPY_AND_ASSIGN(URLRequestJob); |
319 }; | 325 }; |
320 | 326 |
321 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ | 327 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ |
OLD | NEW |