| 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 // TODO(rtenneti): Temporary while investigating crbug.com/585591. | |
| 8 #include "base/debug/alias.h" | |
| 9 #include "base/logging.h" | 7 #include "base/logging.h" |
| 10 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 11 #include "net/quic/quic_bug_tracker.h" | 9 #include "net/quic/quic_bug_tracker.h" |
| 12 #include "net/quic/quic_spdy_session.h" | 10 #include "net/quic/quic_spdy_session.h" |
| 13 #include "net/quic/quic_utils.h" | 11 #include "net/quic/quic_utils.h" |
| 14 #include "net/quic/quic_write_blocked_list.h" | 12 #include "net/quic/quic_write_blocked_list.h" |
| 15 | 13 |
| 16 using base::StringPiece; | 14 using base::StringPiece; |
| 17 using std::min; | 15 using std::min; |
| 18 using net::SpdyPriority; | 16 using net::SpdyPriority; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 32 trailers_decompressed_(false) { | 30 trailers_decompressed_(false) { |
| 33 DCHECK_NE(kCryptoStreamId, id); | 31 DCHECK_NE(kCryptoStreamId, id); |
| 34 // Don't receive any callbacks from the sequencer until headers | 32 // Don't receive any callbacks from the sequencer until headers |
| 35 // are complete. | 33 // are complete. |
| 36 sequencer()->SetBlockedUntilFlush(); | 34 sequencer()->SetBlockedUntilFlush(); |
| 37 spdy_session_->RegisterStreamPriority(id, priority_); | 35 spdy_session_->RegisterStreamPriority(id, priority_); |
| 38 } | 36 } |
| 39 | 37 |
| 40 QuicSpdyStream::~QuicSpdyStream() { | 38 QuicSpdyStream::~QuicSpdyStream() { |
| 41 spdy_session_->UnregisterStreamPriority(id()); | 39 spdy_session_->UnregisterStreamPriority(id()); |
| 42 // TODO(rtenneti): Temporary until crbug.com/585591 is solved. | |
| 43 liveness_ = DEAD; | |
| 44 // Get callstack, if the object is going away and we are doing a Read(). | |
| 45 bool read_in_progress = read_in_progress_; | |
| 46 base::debug::Alias(&read_in_progress); | |
| 47 CHECK(!read_in_progress); | |
| 48 } | |
| 49 | |
| 50 // TODO(rtenneti): Temporary until crbug.com/585591 is solved. | |
| 51 void QuicSpdyStream::CrashIfInvalid() const { | |
| 52 Liveness liveness = liveness_; | |
| 53 if (liveness == ALIVE) | |
| 54 return; | |
| 55 base::debug::Alias(&liveness); | |
| 56 CHECK_EQ(ALIVE, liveness); | |
| 57 } | 40 } |
| 58 | 41 |
| 59 void QuicSpdyStream::CloseWriteSide() { | 42 void QuicSpdyStream::CloseWriteSide() { |
| 60 if (version() > QUIC_VERSION_28 && !fin_received() && !rst_received() && | 43 if (version() > QUIC_VERSION_28 && !fin_received() && !rst_received() && |
| 61 sequencer()->ignore_read_data() && !rst_sent()) { | 44 sequencer()->ignore_read_data() && !rst_sent()) { |
| 62 DCHECK(fin_sent()); | 45 DCHECK(fin_sent()); |
| 63 // Tell the peer to stop sending further data. | 46 // Tell the peer to stop sending further data. |
| 64 DVLOG(1) << ENDPOINT << "Send QUIC_STREAM_NO_ERROR on stream " << id(); | 47 DVLOG(1) << ENDPOINT << "Send QUIC_STREAM_NO_ERROR on stream " << id(); |
| 65 Reset(QUIC_STREAM_NO_ERROR); | 48 Reset(QUIC_STREAM_NO_ERROR); |
| 66 } | 49 } |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 // If no further trailing headers are expected, and the decompressed trailers | 255 // If no further trailing headers are expected, and the decompressed trailers |
| 273 // (if any) have been consumed, then reading of trailers is finished. | 256 // (if any) have been consumed, then reading of trailers is finished. |
| 274 bool no_more_trailers = fin_received() || trailers_decompressed_; | 257 bool no_more_trailers = fin_received() || trailers_decompressed_; |
| 275 return no_more_trailers && decompressed_trailers_.empty(); | 258 return no_more_trailers && decompressed_trailers_.empty(); |
| 276 } | 259 } |
| 277 | 260 |
| 278 SpdyPriority QuicSpdyStream::priority() const { | 261 SpdyPriority QuicSpdyStream::priority() const { |
| 279 return priority_; | 262 return priority_; |
| 280 } | 263 } |
| 281 } // namespace net | 264 } // namespace net |
| OLD | NEW |