| 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_SPDY_SPDY_HTTP_STREAM_H_ | 5 #ifndef NET_SPDY_SPDY_HTTP_STREAM_H_ |
| 6 #define NET_SPDY_SPDY_HTTP_STREAM_H_ | 6 #define NET_SPDY_SPDY_HTTP_STREAM_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // which does not support that. | 129 // which does not support that. |
| 130 void MaybePostRequestCallback(int rv); | 130 void MaybePostRequestCallback(int rv); |
| 131 | 131 |
| 132 // Call the user callback associated with reading the response. | 132 // Call the user callback associated with reading the response. |
| 133 void DoResponseCallback(int rv); | 133 void DoResponseCallback(int rv); |
| 134 | 134 |
| 135 void ScheduleBufferedReadCallback(); | 135 void ScheduleBufferedReadCallback(); |
| 136 void DoBufferedReadCallback(); | 136 void DoBufferedReadCallback(); |
| 137 bool ShouldWaitForMoreBufferedData() const; | 137 bool ShouldWaitForMoreBufferedData() const; |
| 138 | 138 |
| 139 void ResetRequestInfo(); |
| 140 |
| 139 const base::WeakPtr<SpdySession> spdy_session_; | 141 const base::WeakPtr<SpdySession> spdy_session_; |
| 140 bool is_reused_; | 142 bool is_reused_; |
| 141 SpdyStreamRequest stream_request_; | 143 SpdyStreamRequest stream_request_; |
| 142 base::WeakPtr<SpdyStream> stream_; | 144 base::WeakPtr<SpdyStream> stream_; |
| 143 | 145 |
| 144 bool stream_closed_; | 146 bool stream_closed_; |
| 145 | 147 |
| 146 // Set only when |stream_closed_| is true. | 148 // Set only when |stream_closed_| is true. |
| 147 int closed_stream_status_; | 149 int closed_stream_status_; |
| 148 SpdyStreamId closed_stream_id_; | 150 SpdyStreamId closed_stream_id_; |
| 149 bool closed_stream_has_load_timing_info_; | 151 bool closed_stream_has_load_timing_info_; |
| 150 LoadTimingInfo closed_stream_load_timing_info_; | 152 LoadTimingInfo closed_stream_load_timing_info_; |
| 151 // After |stream_| has been closed, this keeps track of the total number of | 153 // After |stream_| has been closed, this keeps track of the total number of |
| 152 // bytes received over the network for |stream_| while it was open. | 154 // bytes received over the network for |stream_| while it was open. |
| 153 int64_t closed_stream_received_bytes_; | 155 int64_t closed_stream_received_bytes_; |
| 154 // After |stream_| has been closed, this keeps track of the total number of | 156 // After |stream_| has been closed, this keeps track of the total number of |
| 155 // bytes sent over the network for |stream_| while it was open. | 157 // bytes sent over the network for |stream_| while it was open. |
| 156 int64_t closed_stream_sent_bytes_; | 158 int64_t closed_stream_sent_bytes_; |
| 157 | 159 |
| 158 // The request to send. | 160 // The request to send. |
| 161 // Set to null when response body is starting to be read. This is to allow |
| 162 // the stream to be shared for reading and to possibly outlive request_info_'s |
| 163 // owner URLRequestHttpJob. |
| 159 const HttpRequestInfo* request_info_; | 164 const HttpRequestInfo* request_info_; |
| 160 | 165 |
| 166 // upload progress saved while resetting the request info to null. |
| 167 UploadProgress upload_progress_; |
| 168 |
| 161 // |response_info_| is the HTTP response data object which is filled in | 169 // |response_info_| is the HTTP response data object which is filled in |
| 162 // when a response HEADERS comes in for the stream. | 170 // when a response HEADERS comes in for the stream. |
| 163 // It is not owned by this stream object, or point to |push_response_info_|. | 171 // It is not owned by this stream object, or point to |push_response_info_|. |
| 164 HttpResponseInfo* response_info_; | 172 HttpResponseInfo* response_info_; |
| 165 | 173 |
| 166 std::unique_ptr<HttpResponseInfo> push_response_info_; | 174 std::unique_ptr<HttpResponseInfo> push_response_info_; |
| 167 | 175 |
| 168 // We don't use SpdyStream's |response_header_status_| as we | 176 // We don't use SpdyStream's |response_header_status_| as we |
| 169 // sometimes call back into our delegate before it is updated. | 177 // sometimes call back into our delegate before it is updated. |
| 170 SpdyResponseHeadersStatus response_headers_status_; | 178 SpdyResponseHeadersStatus response_headers_status_; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 197 NextProto negotiated_protocol_; | 205 NextProto negotiated_protocol_; |
| 198 | 206 |
| 199 base::WeakPtrFactory<SpdyHttpStream> weak_factory_; | 207 base::WeakPtrFactory<SpdyHttpStream> weak_factory_; |
| 200 | 208 |
| 201 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream); | 209 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream); |
| 202 }; | 210 }; |
| 203 | 211 |
| 204 } // namespace net | 212 } // namespace net |
| 205 | 213 |
| 206 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_ | 214 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_ |
| OLD | NEW |