Chromium Code Reviews| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 | 189 |
| 190 // Examine the parsed headers to try to determine the response body size. | 190 // Examine the parsed headers to try to determine the response body size. |
| 191 void CalculateResponseBodySize(); | 191 void CalculateResponseBodySize(); |
| 192 | 192 |
| 193 // Uploads statistics about status line compliance with RFC 7230. | 193 // Uploads statistics about status line compliance with RFC 7230. |
| 194 void ValidateStatusLine(const std::string& status_line); | 194 void ValidateStatusLine(const std::string& status_line); |
| 195 | 195 |
| 196 // Check if buffers used to send the request are empty. | 196 // Check if buffers used to send the request are empty. |
| 197 bool SendRequestBuffersEmpty(); | 197 bool SendRequestBuffersEmpty(); |
| 198 | 198 |
| 199 // Sets request_ to null. | |
| 200 void ResetRequestInfo(); | |
| 201 | |
| 199 // Next state of the request, when the current one completes. | 202 // Next state of the request, when the current one completes. |
| 200 State io_state_; | 203 State io_state_; |
| 201 | 204 |
| 202 // The request to send. | 205 // Null when read state machine is invoked. This is to allow the stream |
| 206 // to be shared for reading and to possibly outlive request_'s owner | |
| 207 // URLRequestHttpJob. | |
| 203 const HttpRequestInfo* request_; | 208 const HttpRequestInfo* request_; |
|
Randy Smith (Not in Mondays)
2016/09/01 20:18:31
Though (i.e. not even to the level of suggestion):
| |
| 204 | 209 |
| 210 // upload progress saved while resetting the request info to null. | |
| 211 UploadProgress upload_progress_; | |
| 212 | |
| 205 // The request header data. May include a merged request body. | 213 // The request header data. May include a merged request body. |
| 206 scoped_refptr<DrainableIOBuffer> request_headers_; | 214 scoped_refptr<DrainableIOBuffer> request_headers_; |
| 207 | 215 |
| 208 // Size of just the request headers. May be less than the length of | 216 // Size of just the request headers. May be less than the length of |
| 209 // |request_headers_| if the body was merged with the headers. | 217 // |request_headers_| if the body was merged with the headers. |
| 210 int request_headers_length_; | 218 int request_headers_length_; |
| 211 | 219 |
| 212 // Temporary buffer for reading. | 220 // Temporary buffer for reading. |
| 213 scoped_refptr<GrowableIOBuffer> read_buf_; | 221 scoped_refptr<GrowableIOBuffer> read_buf_; |
| 214 | 222 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 281 int upload_error_; | 289 int upload_error_; |
| 282 | 290 |
| 283 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_; | 291 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_; |
| 284 | 292 |
| 285 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser); | 293 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser); |
| 286 }; | 294 }; |
| 287 | 295 |
| 288 } // namespace net | 296 } // namespace net |
| 289 | 297 |
| 290 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_ | 298 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_ |
| OLD | NEW |