| 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_QUIC_QUIC_HTTP_STREAM_H_ | 5 #ifndef NET_QUIC_QUIC_HTTP_STREAM_H_ |
| 6 #define NET_QUIC_QUIC_HTTP_STREAM_H_ | 6 #define NET_QUIC_QUIC_HTTP_STREAM_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 ~QuicHttpStream() override; | 41 ~QuicHttpStream() override; |
| 42 | 42 |
| 43 // HttpStream implementation. | 43 // HttpStream implementation. |
| 44 int InitializeStream(const HttpRequestInfo* request_info, | 44 int InitializeStream(const HttpRequestInfo* request_info, |
| 45 RequestPriority priority, | 45 RequestPriority priority, |
| 46 const BoundNetLog& net_log, | 46 const BoundNetLog& net_log, |
| 47 const CompletionCallback& callback) override; | 47 const CompletionCallback& callback) override; |
| 48 int SendRequest(const HttpRequestHeaders& request_headers, | 48 int SendRequest(const HttpRequestHeaders& request_headers, |
| 49 HttpResponseInfo* response, | 49 HttpResponseInfo* response, |
| 50 const CompletionCallback& callback) override; | 50 const CompletionCallback& callback) override; |
| 51 UploadProgress GetUploadProgress() const override; | |
| 52 int ReadResponseHeaders(const CompletionCallback& callback) override; | 51 int ReadResponseHeaders(const CompletionCallback& callback) override; |
| 53 int ReadResponseBody(IOBuffer* buf, | 52 int ReadResponseBody(IOBuffer* buf, |
| 54 int buf_len, | 53 int buf_len, |
| 55 const CompletionCallback& callback) override; | 54 const CompletionCallback& callback) override; |
| 56 void Close(bool not_reusable) override; | 55 void Close(bool not_reusable) override; |
| 57 HttpStream* RenewStreamForAuth() override; | 56 HttpStream* RenewStreamForAuth() override; |
| 58 bool IsResponseBodyComplete() const override; | 57 bool IsResponseBodyComplete() const override; |
| 59 bool IsConnectionReused() const override; | 58 bool IsConnectionReused() const override; |
| 60 void SetConnectionReused() override; | 59 void SetConnectionReused() override; |
| 61 bool CanReuseConnection() const override; | 60 bool CanReuseConnection() const override; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 124 |
| 126 int ProcessResponseHeaders(const SpdyHeaderBlock& headers); | 125 int ProcessResponseHeaders(const SpdyHeaderBlock& headers); |
| 127 | 126 |
| 128 int ReadAvailableData(IOBuffer* buf, int buf_len); | 127 int ReadAvailableData(IOBuffer* buf, int buf_len); |
| 129 void EnterStateSendHeaders(); | 128 void EnterStateSendHeaders(); |
| 130 int HandlePromise(); | 129 int HandlePromise(); |
| 131 | 130 |
| 132 void ResetStream(); | 131 void ResetStream(); |
| 133 bool CancelPromiseIfHasBody(); | 132 bool CancelPromiseIfHasBody(); |
| 134 | 133 |
| 134 void ResetRequestInfo(); |
| 135 |
| 135 State next_state_; | 136 State next_state_; |
| 136 | 137 |
| 137 base::WeakPtr<QuicChromiumClientSession> session_; | 138 base::WeakPtr<QuicChromiumClientSession> session_; |
| 138 int session_error_; // Error code from the connection shutdown. | 139 int session_error_; // Error code from the connection shutdown. |
| 139 bool was_handshake_confirmed_; // True if the crypto handshake succeeded. | 140 bool was_handshake_confirmed_; // True if the crypto handshake succeeded. |
| 140 QuicChromiumClientSession::StreamRequest stream_request_; | 141 QuicChromiumClientSession::StreamRequest stream_request_; |
| 141 QuicChromiumClientStream* stream_; // Non-owning. | 142 QuicChromiumClientStream* stream_; // Non-owning. |
| 142 | 143 |
| 143 // The following three fields are all owned by the caller and must | 144 // The following three fields are all owned by the caller and must |
| 144 // outlive this object, according to the HttpStream contract. | 145 // outlive this object, according to the HttpStream contract. |
| 145 | 146 |
| 146 // The request to send. | 147 // The request to send. |
| 148 // Only valid before the response body is read. |
| 147 const HttpRequestInfo* request_info_; | 149 const HttpRequestInfo* request_info_; |
| 150 |
| 148 // The request body to send, if any, owned by the caller. | 151 // The request body to send, if any, owned by the caller. |
| 149 UploadDataStream* request_body_stream_; | 152 UploadDataStream* request_body_stream_; |
| 150 // Time the request was issued. | 153 // Time the request was issued. |
| 151 base::Time request_time_; | 154 base::Time request_time_; |
| 152 // The priority of the request. | 155 // The priority of the request. |
| 153 RequestPriority priority_; | 156 RequestPriority priority_; |
| 154 // |response_info_| is the HTTP response data object which is filled in | 157 // |response_info_| is the HTTP response data object which is filled in |
| 155 // when a the response headers are read. It is not owned by this stream. | 158 // when a the response headers are read. It is not owned by this stream. |
| 156 HttpResponseInfo* response_info_; | 159 HttpResponseInfo* response_info_; |
| 157 // Because response data is buffered, also buffer the response status if the | 160 // Because response data is buffered, also buffer the response status if the |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 bool in_loop_; | 214 bool in_loop_; |
| 212 | 215 |
| 213 base::WeakPtrFactory<QuicHttpStream> weak_factory_; | 216 base::WeakPtrFactory<QuicHttpStream> weak_factory_; |
| 214 | 217 |
| 215 DISALLOW_COPY_AND_ASSIGN(QuicHttpStream); | 218 DISALLOW_COPY_AND_ASSIGN(QuicHttpStream); |
| 216 }; | 219 }; |
| 217 | 220 |
| 218 } // namespace net | 221 } // namespace net |
| 219 | 222 |
| 220 #endif // NET_QUIC_QUIC_HTTP_STREAM_H_ | 223 #endif // NET_QUIC_QUIC_HTTP_STREAM_H_ |
| OLD | NEW |