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 #include "net/quic/reliable_quic_stream.h" | 5 #include "net/quic/reliable_quic_stream.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "net/quic/iovector.h" | 8 #include "net/quic/iovector.h" |
9 #include "net/quic/quic_ack_listener_interface.h" | 9 #include "net/quic/quic_ack_listener_interface.h" |
10 #include "net/quic/quic_flags.h" | 10 #include "net/quic/quic_flags.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // OnFinRead can be called due to a FIN flag in a headers block, so there may | 174 // OnFinRead can be called due to a FIN flag in a headers block, so there may |
175 // have been no OnStreamFrame call with a FIN in the frame. | 175 // have been no OnStreamFrame call with a FIN in the frame. |
176 fin_received_ = true; | 176 fin_received_ = true; |
177 // If fin_sent_ is true, then CloseWriteSide has already been called, and the | 177 // If fin_sent_ is true, then CloseWriteSide has already been called, and the |
178 // stream will be destroyed by CloseReadSide, so don't need to call | 178 // stream will be destroyed by CloseReadSide, so don't need to call |
179 // StreamDraining. | 179 // StreamDraining. |
180 CloseReadSide(); | 180 CloseReadSide(); |
181 } | 181 } |
182 | 182 |
183 void ReliableQuicStream::Reset(QuicRstStreamErrorCode error) { | 183 void ReliableQuicStream::Reset(QuicRstStreamErrorCode error) { |
184 DCHECK_NE(QUIC_STREAM_NO_ERROR, error); | |
185 stream_error_ = error; | 184 stream_error_ = error; |
186 // Sending a RstStream results in calling CloseStream. | 185 // Sending a RstStream results in calling CloseStream. |
187 session()->SendRstStream(id(), error, stream_bytes_written_); | 186 session()->SendRstStream(id(), error, stream_bytes_written_); |
188 rst_sent_ = true; | 187 rst_sent_ = true; |
189 } | 188 } |
190 | 189 |
191 void ReliableQuicStream::CloseConnection(QuicErrorCode error) { | 190 void ReliableQuicStream::CloseConnection(QuicErrorCode error) { |
192 session()->connection()->SendConnectionClose(error); | 191 session()->connection()->SendConnectionClose(error); |
193 } | 192 } |
194 | 193 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 } | 464 } |
466 } | 465 } |
467 | 466 |
468 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) { | 467 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) { |
469 if (flow_controller_.UpdateSendWindowOffset(new_window)) { | 468 if (flow_controller_.UpdateSendWindowOffset(new_window)) { |
470 OnCanWrite(); | 469 OnCanWrite(); |
471 } | 470 } |
472 } | 471 } |
473 | 472 |
474 } // namespace net | 473 } // namespace net |
OLD | NEW |