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 #ifdef TEMP_INSTRUMENTATION_585591 | |
9 #include "base/debug/alias.h" | |
10 #endif | |
7 #include "base/logging.h" | 11 #include "base/logging.h" |
8 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
9 #include "net/quic/quic_bug_tracker.h" | 13 #include "net/quic/quic_bug_tracker.h" |
10 #include "net/quic/quic_spdy_session.h" | 14 #include "net/quic/quic_spdy_session.h" |
11 #include "net/quic/quic_utils.h" | 15 #include "net/quic/quic_utils.h" |
12 #include "net/quic/quic_write_blocked_list.h" | 16 #include "net/quic/quic_write_blocked_list.h" |
13 | 17 |
14 using base::StringPiece; | 18 using base::StringPiece; |
15 using std::min; | 19 using std::min; |
16 using net::SpdyPriority; | 20 using net::SpdyPriority; |
(...skipping 13 matching lines...) Expand all Loading... | |
30 trailers_decompressed_(false) { | 34 trailers_decompressed_(false) { |
31 DCHECK_NE(kCryptoStreamId, id); | 35 DCHECK_NE(kCryptoStreamId, id); |
32 // Don't receive any callbacks from the sequencer until headers | 36 // Don't receive any callbacks from the sequencer until headers |
33 // are complete. | 37 // are complete. |
34 sequencer()->SetBlockedUntilFlush(); | 38 sequencer()->SetBlockedUntilFlush(); |
35 spdy_session_->RegisterStreamPriority(id, priority_); | 39 spdy_session_->RegisterStreamPriority(id, priority_); |
36 } | 40 } |
37 | 41 |
38 QuicSpdyStream::~QuicSpdyStream() { | 42 QuicSpdyStream::~QuicSpdyStream() { |
39 spdy_session_->UnregisterStreamPriority(id()); | 43 spdy_session_->UnregisterStreamPriority(id()); |
44 // TODO(rtenneti): Temporary until crbug.com/585591 is solved. | |
45 liveness_ = DEAD; | |
46 #ifdef TEMP_INSTRUMENTATION_585591 | |
47 stack_trace_ = base::debug::StackTrace(); | |
48 // Probably not necessary, but just in case compiler tries to optimize out | |
49 // the writes to stack_trace_. | |
50 base::debug::Alias(&stack_trace_); | |
51 // Get callstack, if the object is going away and we are doing a Read(). | |
52 CHECK(!read_is_called_); | |
53 #endif | |
54 } | |
55 | |
56 // TODO(rtenneti): Temporary until crbug.com/585591 is solved. | |
57 void QuicSpdyStream::CrashIfInvalid() const { | |
eroman
2016/02/12 01:42:46
I believe you want to either copy stack_trace_ to
ramant (doing other things)
2016/02/12 02:47:09
+1. Removed the stack_trace_.
Done.
| |
58 Liveness liveness = liveness_; | |
59 if (liveness == ALIVE) | |
60 return; | |
61 base::debug::Alias(&liveness); | |
62 CHECK_EQ(ALIVE, liveness); | |
40 } | 63 } |
41 | 64 |
42 void QuicSpdyStream::CloseWriteSide() { | 65 void QuicSpdyStream::CloseWriteSide() { |
43 if (version() > QUIC_VERSION_28 && !fin_received() && !rst_received() && | 66 if (version() > QUIC_VERSION_28 && !fin_received() && !rst_received() && |
44 sequencer()->ignore_read_data() && !rst_sent()) { | 67 sequencer()->ignore_read_data() && !rst_sent()) { |
45 DCHECK(fin_sent()); | 68 DCHECK(fin_sent()); |
46 // Tell the peer to stop sending further data. | 69 // Tell the peer to stop sending further data. |
47 DVLOG(1) << ENDPOINT << "Send QUIC_STREAM_NO_ERROR on stream " << id(); | 70 DVLOG(1) << ENDPOINT << "Send QUIC_STREAM_NO_ERROR on stream " << id(); |
48 Reset(QUIC_STREAM_NO_ERROR); | 71 Reset(QUIC_STREAM_NO_ERROR); |
49 } | 72 } |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
256 if (!FLAGS_quic_supports_trailers) { | 279 if (!FLAGS_quic_supports_trailers) { |
257 return true; | 280 return true; |
258 } | 281 } |
259 // If no further trailing headers are expected, and the decompressed trailers | 282 // If no further trailing headers are expected, and the decompressed trailers |
260 // (if any) have been consumed, then reading of trailers is finished. | 283 // (if any) have been consumed, then reading of trailers is finished. |
261 bool no_more_trailers = fin_received() || trailers_decompressed_; | 284 bool no_more_trailers = fin_received() || trailers_decompressed_; |
262 return no_more_trailers && decompressed_trailers_.empty(); | 285 return no_more_trailers && decompressed_trailers_.empty(); |
263 } | 286 } |
264 | 287 |
265 } // namespace net | 288 } // namespace net |
OLD | NEW |