| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // Returns true if the underlying connection can be reused. | 78 // Returns true if the underlying connection can be reused. |
| 79 // The connection can be reused if: | 79 // The connection can be reused if: |
| 80 // * It's still connected. | 80 // * It's still connected. |
| 81 // * The response headers indicate the connection can be kept alive. | 81 // * The response headers indicate the connection can be kept alive. |
| 82 // * The end of the response can be found. | 82 // * The end of the response can be found. |
| 83 // | 83 // |
| 84 // Note that if response headers have yet to be received, this will return | 84 // Note that if response headers have yet to be received, this will return |
| 85 // false. | 85 // false. |
| 86 bool CanReuseConnection() const; | 86 bool CanReuseConnection() const; |
| 87 | 87 |
| 88 int64 received_bytes() const { return received_bytes_; } | 88 int64_t received_bytes() const { return received_bytes_; } |
| 89 | 89 |
| 90 int64_t sent_bytes() const { return sent_bytes_; } | 90 int64_t sent_bytes() const { return sent_bytes_; } |
| 91 | 91 |
| 92 void GetSSLInfo(SSLInfo* ssl_info); | 92 void GetSSLInfo(SSLInfo* ssl_info); |
| 93 | 93 |
| 94 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); | 94 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); |
| 95 | 95 |
| 96 // Encodes the given |payload| in the chunked format to |output|. | 96 // Encodes the given |payload| in the chunked format to |output|. |
| 97 // Returns the number of bytes written to |output|. |output_size| should | 97 // Returns the number of bytes written to |output|. |output_size| should |
| 98 // be large enough to store the encoded chunk, which is payload.size() + | 98 // be large enough to store the encoded chunk, which is payload.size() + |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 // body data in the same packet as header data but is zero when reading | 204 // body data in the same packet as header data but is zero when reading |
| 205 // headers. | 205 // headers. |
| 206 int read_buf_unused_offset_; | 206 int read_buf_unused_offset_; |
| 207 | 207 |
| 208 // The amount beyond |read_buf_unused_offset_| where the status line starts; | 208 // The amount beyond |read_buf_unused_offset_| where the status line starts; |
| 209 // -1 if not found yet. | 209 // -1 if not found yet. |
| 210 int response_header_start_offset_; | 210 int response_header_start_offset_; |
| 211 | 211 |
| 212 // The amount of received data. If connection is reused then intermediate | 212 // The amount of received data. If connection is reused then intermediate |
| 213 // value may be bigger than final. | 213 // value may be bigger than final. |
| 214 int64 received_bytes_; | 214 int64_t received_bytes_; |
| 215 | 215 |
| 216 // The amount of sent data. | 216 // The amount of sent data. |
| 217 int64_t sent_bytes_; | 217 int64_t sent_bytes_; |
| 218 | 218 |
| 219 // The parsed response headers. Owned by the caller of SendRequest. This | 219 // The parsed response headers. Owned by the caller of SendRequest. This |
| 220 // cannot be safely accessed after reading the final set of headers, as the | 220 // cannot be safely accessed after reading the final set of headers, as the |
| 221 // caller of SendRequest may have been destroyed - this happens in the case an | 221 // caller of SendRequest may have been destroyed - this happens in the case an |
| 222 // HttpResponseBodyDrainer is used. | 222 // HttpResponseBodyDrainer is used. |
| 223 HttpResponseInfo* response_; | 223 HttpResponseInfo* response_; |
| 224 | 224 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 int upload_error_; | 266 int upload_error_; |
| 267 | 267 |
| 268 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_; | 268 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_; |
| 269 | 269 |
| 270 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser); | 270 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser); |
| 271 }; | 271 }; |
| 272 | 272 |
| 273 } // namespace net | 273 } // namespace net |
| 274 | 274 |
| 275 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_ | 275 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_ |
| OLD | NEW |