| 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 std::string; | 10 using std::string; |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 | 13 |
| 14 QuicSpdySession::QuicSpdySession(QuicConnection* connection, | 14 QuicSpdySession::QuicSpdySession(QuicConnection* connection, |
| 15 const QuicConfig& config) | 15 const QuicConfig& config) |
| 16 : QuicSession(connection, config) {} | 16 : QuicSession(connection, config) {} |
| 17 | 17 |
| 18 QuicSpdySession::~QuicSpdySession() { | 18 QuicSpdySession::~QuicSpdySession() {} |
| 19 // Set the streams' session pointers in closed and dynamic stream lists | |
| 20 // to null to avoid subsequent use of this session. | |
| 21 for (auto const& stream : *closed_streams()) { | |
| 22 static_cast<QuicSpdyStream*>(stream)->ClearSession(); | |
| 23 } | |
| 24 for (auto const& kv : dynamic_streams()) { | |
| 25 static_cast<QuicSpdyStream*>(kv.second)->ClearSession(); | |
| 26 } | |
| 27 } | |
| 28 | 19 |
| 29 void QuicSpdySession::Initialize() { | 20 void QuicSpdySession::Initialize() { |
| 30 QuicSession::Initialize(); | 21 QuicSession::Initialize(); |
| 31 | 22 |
| 32 if (perspective() == Perspective::IS_SERVER) { | 23 if (perspective() == Perspective::IS_SERVER) { |
| 33 set_largest_peer_created_stream_id(kHeadersStreamId); | 24 set_largest_peer_created_stream_id(kHeadersStreamId); |
| 34 } else { | 25 } else { |
| 35 QuicStreamId headers_stream_id = GetNextOutgoingStreamId(); | 26 QuicStreamId headers_stream_id = GetNextOutgoingStreamId(); |
| 36 DCHECK_EQ(headers_stream_id, kHeadersStreamId); | 27 DCHECK_EQ(headers_stream_id, kHeadersStreamId); |
| 37 } | 28 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 void QuicSpdySession::OnPromiseHeadersComplete(QuicStreamId stream_id, | 107 void QuicSpdySession::OnPromiseHeadersComplete(QuicStreamId stream_id, |
| 117 QuicStreamId promised_stream_id, | 108 QuicStreamId promised_stream_id, |
| 118 size_t frame_len) { | 109 size_t frame_len) { |
| 119 string error = "OnPromiseHeadersComplete should be overriden in client code."; | 110 string error = "OnPromiseHeadersComplete should be overriden in client code."; |
| 120 QUIC_BUG << error; | 111 QUIC_BUG << error; |
| 121 connection()->CloseConnection(QUIC_INTERNAL_ERROR, error, | 112 connection()->CloseConnection(QUIC_INTERNAL_ERROR, error, |
| 122 ConnectionCloseBehavior::SILENT_CLOSE); | 113 ConnectionCloseBehavior::SILENT_CLOSE); |
| 123 } | 114 } |
| 124 | 115 |
| 125 } // namespace net | 116 } // namespace net |
| OLD | NEW |