OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_HTTP_HTTP_STREAM_PARSER_H_ | 5 #ifndef NET_HTTP_HTTP_STREAM_PARSER_H_ |
6 #define NET_HTTP_HTTP_STREAM_PARSER_H_ | 6 #define NET_HTTP_HTTP_STREAM_PARSER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // -1 if not found yet. | 216 // -1 if not found yet. |
217 int response_header_start_offset_; | 217 int response_header_start_offset_; |
218 | 218 |
219 // The amount of received data. If connection is reused then intermediate | 219 // The amount of received data. If connection is reused then intermediate |
220 // value may be bigger than final. | 220 // value may be bigger than final. |
221 int64_t received_bytes_; | 221 int64_t received_bytes_; |
222 | 222 |
223 // The amount of sent data. | 223 // The amount of sent data. |
224 int64_t sent_bytes_; | 224 int64_t sent_bytes_; |
225 | 225 |
226 // The parsed response headers. Owned by the caller of SendRequest. This | 226 // The parsed response headers. Owned by the caller of SendRequest. This |
227 // cannot be safely accessed after reading the final set of headers, as the | 227 // cannot be safely accessed after reading the final set of headers, as the |
228 // caller of SendRequest may have been destroyed - this happens in the case an | 228 // caller of SendRequest may have been destroyed - this happens in the case an |
229 // HttpResponseBodyDrainer is used. | 229 // HttpResponseBodyDrainer is used. |
230 HttpResponseInfo* response_; | 230 HttpResponseInfo* response_; |
231 | 231 |
232 // Indicates the content length. If this value is less than zero | 232 // Indicates the content length. If this value is less than zero |
233 // (and chunked_decoder_ is null), then we must read until the server | 233 // (and chunked_decoder_ is null), then we must read until the server |
234 // closes the connection. | 234 // closes the connection. |
235 int64_t response_body_length_; | 235 int64_t response_body_length_; |
236 | 236 |
| 237 // True if reading a keep-alive response. False if not, or if don't yet know. |
| 238 bool response_is_keep_alive_; |
| 239 |
237 // Keep track of the number of response body bytes read so far. | 240 // Keep track of the number of response body bytes read so far. |
238 int64_t response_body_read_; | 241 int64_t response_body_read_; |
239 | 242 |
240 // Helper if the data is chunked. | 243 // Helper if the data is chunked. |
241 std::unique_ptr<HttpChunkedDecoder> chunked_decoder_; | 244 std::unique_ptr<HttpChunkedDecoder> chunked_decoder_; |
242 | 245 |
243 // Where the caller wants the body data. | 246 // Where the caller wants the body data. |
244 scoped_refptr<IOBuffer> user_read_buf_; | 247 scoped_refptr<IOBuffer> user_read_buf_; |
245 int user_read_buf_len_; | 248 int user_read_buf_len_; |
246 | 249 |
(...skipping 26 matching lines...) Expand all Loading... |
273 int upload_error_; | 276 int upload_error_; |
274 | 277 |
275 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_; | 278 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_; |
276 | 279 |
277 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser); | 280 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser); |
278 }; | 281 }; |
279 | 282 |
280 } // namespace net | 283 } // namespace net |
281 | 284 |
282 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_ | 285 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_ |
OLD | NEW |