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 until crbug.com/585591 is solved. |
| 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 } |
| 45 |
| 46 // TODO(rtenneti): Temporary until crbug.com/585591 is solved. |
| 47 void QuicSpdyStream::CrashIfInvalid() const { |
| 48 Liveness liveness = liveness_; |
| 49 if (liveness == ALIVE) |
| 50 return; |
| 51 base::debug::Alias(&liveness); |
| 52 CHECK_EQ(ALIVE, liveness); |
40 } | 53 } |
41 | 54 |
42 void QuicSpdyStream::CloseWriteSide() { | 55 void QuicSpdyStream::CloseWriteSide() { |
43 if (version() > QUIC_VERSION_28 && !fin_received() && !rst_received() && | 56 if (version() > QUIC_VERSION_28 && !fin_received() && !rst_received() && |
44 sequencer()->ignore_read_data() && !rst_sent()) { | 57 sequencer()->ignore_read_data() && !rst_sent()) { |
45 DCHECK(fin_sent()); | 58 DCHECK(fin_sent()); |
46 // Tell the peer to stop sending further data. | 59 // Tell the peer to stop sending further data. |
47 DVLOG(1) << ENDPOINT << "Send QUIC_STREAM_NO_ERROR on stream " << id(); | 60 DVLOG(1) << ENDPOINT << "Send QUIC_STREAM_NO_ERROR on stream " << id(); |
48 Reset(QUIC_STREAM_NO_ERROR); | 61 Reset(QUIC_STREAM_NO_ERROR); |
49 } | 62 } |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 if (!FLAGS_quic_supports_trailers) { | 269 if (!FLAGS_quic_supports_trailers) { |
257 return true; | 270 return true; |
258 } | 271 } |
259 // If no further trailing headers are expected, and the decompressed trailers | 272 // If no further trailing headers are expected, and the decompressed trailers |
260 // (if any) have been consumed, then reading of trailers is finished. | 273 // (if any) have been consumed, then reading of trailers is finished. |
261 bool no_more_trailers = fin_received() || trailers_decompressed_; | 274 bool no_more_trailers = fin_received() || trailers_decompressed_; |
262 return no_more_trailers && decompressed_trailers_.empty(); | 275 return no_more_trailers && decompressed_trailers_.empty(); |
263 } | 276 } |
264 | 277 |
265 } // namespace net | 278 } // namespace net |
OLD | NEW |