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