| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/quic_spdy_stream.h" | 5 #include "net/quic/quic_spdy_stream.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "net/quic/quic_bug_tracker.h" | 9 #include "net/quic/quic_bug_tracker.h" |
| 10 #include "net/quic/quic_spdy_session.h" | 10 #include "net/quic/quic_spdy_session.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 priority_(kDefaultPriority), | 31 priority_(kDefaultPriority), |
| 32 trailers_decompressed_(false) { | 32 trailers_decompressed_(false) { |
| 33 DCHECK_NE(kCryptoStreamId, id); | 33 DCHECK_NE(kCryptoStreamId, id); |
| 34 // Don't receive any callbacks from the sequencer until headers | 34 // Don't receive any callbacks from the sequencer until headers |
| 35 // are complete. | 35 // are complete. |
| 36 sequencer()->SetBlockedUntilFlush(); | 36 sequencer()->SetBlockedUntilFlush(); |
| 37 spdy_session_->RegisterStreamPriority(id, priority_); | 37 spdy_session_->RegisterStreamPriority(id, priority_); |
| 38 } | 38 } |
| 39 | 39 |
| 40 QuicSpdyStream::~QuicSpdyStream() { | 40 QuicSpdyStream::~QuicSpdyStream() { |
| 41 if (spdy_session_ != nullptr) { | 41 spdy_session_->UnregisterStreamPriority(id()); |
| 42 spdy_session_->UnregisterStreamPriority(id()); | |
| 43 } | |
| 44 } | 42 } |
| 45 | 43 |
| 46 void QuicSpdyStream::CloseWriteSide() { | 44 void QuicSpdyStream::CloseWriteSide() { |
| 47 if (version() > QUIC_VERSION_28 && !fin_received() && !rst_received() && | 45 if (version() > QUIC_VERSION_28 && !fin_received() && !rst_received() && |
| 48 sequencer()->ignore_read_data() && !rst_sent()) { | 46 sequencer()->ignore_read_data() && !rst_sent()) { |
| 49 DCHECK(fin_sent()); | 47 DCHECK(fin_sent()); |
| 50 // Tell the peer to stop sending further data. | 48 // Tell the peer to stop sending further data. |
| 51 DVLOG(1) << ENDPOINT << "Send QUIC_STREAM_NO_ERROR on stream " << id(); | 49 DVLOG(1) << ENDPOINT << "Send QUIC_STREAM_NO_ERROR on stream " << id(); |
| 52 Reset(QUIC_STREAM_NO_ERROR); | 50 Reset(QUIC_STREAM_NO_ERROR); |
| 53 } | 51 } |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 bool QuicSpdyStream::FinishedReadingTrailers() const { | 294 bool QuicSpdyStream::FinishedReadingTrailers() const { |
| 297 // If no further trailing headers are expected, and the decompressed trailers | 295 // If no further trailing headers are expected, and the decompressed trailers |
| 298 // (if any) have been consumed, then reading of trailers is finished. | 296 // (if any) have been consumed, then reading of trailers is finished. |
| 299 bool no_more_trailers = fin_received() || trailers_decompressed_; | 297 bool no_more_trailers = fin_received() || trailers_decompressed_; |
| 300 return no_more_trailers && decompressed_trailers_.empty(); | 298 return no_more_trailers && decompressed_trailers_.empty(); |
| 301 } | 299 } |
| 302 | 300 |
| 303 SpdyPriority QuicSpdyStream::priority() const { | 301 SpdyPriority QuicSpdyStream::priority() const { |
| 304 return priority_; | 302 return priority_; |
| 305 } | 303 } |
| 306 | |
| 307 void QuicSpdyStream::ClearSession() { | |
| 308 spdy_session_ = nullptr; | |
| 309 } | |
| 310 | |
| 311 } // namespace net | 304 } // namespace net |
| OLD | NEW |