| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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_session.h" | 5 #include "net/quic/quic_spdy_session.h" |
| 6 | 6 |
| 7 #include "net/quic/quic_bug_tracker.h" | 7 #include "net/quic/quic_bug_tracker.h" |
| 8 #include "net/quic/quic_headers_stream.h" | 8 #include "net/quic/quic_headers_stream.h" |
| 9 | 9 |
| 10 using base::StringPiece; | 10 using base::StringPiece; |
| 11 using std::string; | 11 using std::string; |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 QuicSpdySession::QuicSpdySession(QuicConnection* connection, | 15 QuicSpdySession::QuicSpdySession(QuicConnection* connection, |
| 16 const QuicConfig& config) | 16 const QuicConfig& config) |
| 17 : QuicSession(connection, config) {} | 17 : QuicSession(connection, config) {} |
| 18 | 18 |
| 19 QuicSpdySession::~QuicSpdySession() {} | 19 QuicSpdySession::~QuicSpdySession() { |
| 20 // Set the streams' session pointers in closed and dynamic stream lists |
| 21 // to null to avoid subsequent use of this session. |
| 22 for (auto const& stream : *closed_streams()) { |
| 23 static_cast<QuicSpdyStream*>(stream)->ClearSession(); |
| 24 } |
| 25 for (auto const& kv : dynamic_streams()) { |
| 26 static_cast<QuicSpdyStream*>(kv.second)->ClearSession(); |
| 27 } |
| 28 } |
| 20 | 29 |
| 21 void QuicSpdySession::Initialize() { | 30 void QuicSpdySession::Initialize() { |
| 22 QuicSession::Initialize(); | 31 QuicSession::Initialize(); |
| 23 | 32 |
| 24 if (perspective() == Perspective::IS_SERVER) { | 33 if (perspective() == Perspective::IS_SERVER) { |
| 25 set_largest_peer_created_stream_id(kHeadersStreamId); | 34 set_largest_peer_created_stream_id(kHeadersStreamId); |
| 26 } else { | 35 } else { |
| 27 QuicStreamId headers_stream_id = GetNextOutgoingStreamId(); | 36 QuicStreamId headers_stream_id = GetNextOutgoingStreamId(); |
| 28 DCHECK_EQ(headers_stream_id, kHeadersStreamId); | 37 DCHECK_EQ(headers_stream_id, kHeadersStreamId); |
| 29 } | 38 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 147 |
| 139 void QuicSpdySession::OnConfigNegotiated() { | 148 void QuicSpdySession::OnConfigNegotiated() { |
| 140 QuicSession::OnConfigNegotiated(); | 149 QuicSession::OnConfigNegotiated(); |
| 141 if (FLAGS_quic_disable_hpack_dynamic_table && | 150 if (FLAGS_quic_disable_hpack_dynamic_table && |
| 142 config()->HasClientSentConnectionOption(kDHDT, perspective())) { | 151 config()->HasClientSentConnectionOption(kDHDT, perspective())) { |
| 143 headers_stream_->DisableHpackDynamicTable(); | 152 headers_stream_->DisableHpackDynamicTable(); |
| 144 } | 153 } |
| 145 } | 154 } |
| 146 | 155 |
| 147 } // namespace net | 156 } // namespace net |
| OLD | NEW |