| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 bool IsResponseBodyComplete() const; | 66 bool IsResponseBodyComplete() const; |
| 67 | 67 |
| 68 bool CanFindEndOfResponse() const; | 68 bool CanFindEndOfResponse() const; |
| 69 | 69 |
| 70 bool IsMoreDataBuffered() const; | 70 bool IsMoreDataBuffered() const; |
| 71 | 71 |
| 72 bool IsConnectionReused() const; | 72 bool IsConnectionReused() const; |
| 73 | 73 |
| 74 void SetConnectionReused(); | 74 void SetConnectionReused(); |
| 75 | 75 |
| 76 bool IsConnectionReusable() const; | 76 // Returns true if the underlying connection can be reused. |
| 77 // The connection can be reused if: |
| 78 // * It's still connected. |
| 79 // * The response headers indicate the connection can be kept alive. |
| 80 // * The end of the response can be found. |
| 81 // |
| 82 // Note that if response headers have yet to be received, this will return |
| 83 // false. |
| 84 bool CanReuseConnection() const; |
| 77 | 85 |
| 78 int64 received_bytes() const { return received_bytes_; } | 86 int64 received_bytes() const { return received_bytes_; } |
| 79 | 87 |
| 80 void GetSSLInfo(SSLInfo* ssl_info); | 88 void GetSSLInfo(SSLInfo* ssl_info); |
| 81 | 89 |
| 82 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); | 90 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); |
| 83 | 91 |
| 84 // Encodes the given |payload| in the chunked format to |output|. | 92 // Encodes the given |payload| in the chunked format to |output|. |
| 85 // Returns the number of bytes written to |output|. |output_size| should | 93 // Returns the number of bytes written to |output|. |output_size| should |
| 86 // be large enough to store the encoded chunk, which is payload.size() + | 94 // be large enough to store the encoded chunk, which is payload.size() + |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 int upload_error_; | 259 int upload_error_; |
| 252 | 260 |
| 253 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_; | 261 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_; |
| 254 | 262 |
| 255 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser); | 263 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser); |
| 256 }; | 264 }; |
| 257 | 265 |
| 258 } // namespace net | 266 } // namespace net |
| 259 | 267 |
| 260 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_ | 268 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_ |
| OLD | NEW |