OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_session.h" | 5 #include "net/quic/quic_session.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "net/quic/quic_connection.h" | 8 #include "net/quic/quic_connection.h" |
9 | 9 |
10 using base::StringPiece; | 10 using base::StringPiece; |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 } | 177 } |
178 | 178 |
179 void QuicSession::CloseStream(QuicStreamId stream_id) { | 179 void QuicSession::CloseStream(QuicStreamId stream_id) { |
180 DLOG(INFO) << "Closing stream " << stream_id; | 180 DLOG(INFO) << "Closing stream " << stream_id; |
181 | 181 |
182 ReliableStreamMap::iterator it = stream_map_.find(stream_id); | 182 ReliableStreamMap::iterator it = stream_map_.find(stream_id); |
183 if (it == stream_map_.end()) { | 183 if (it == stream_map_.end()) { |
184 DLOG(INFO) << "Stream is already closed: " << stream_id; | 184 DLOG(INFO) << "Stream is already closed: " << stream_id; |
185 return; | 185 return; |
186 } | 186 } |
187 it->second->OnClose(); | 187 ReliableQuicStream* stream = it->second; |
188 closed_streams_.push_back(it->second); | 188 closed_streams_.push_back(it->second); |
189 stream_map_.erase(it); | 189 stream_map_.erase(it); |
| 190 stream->OnClose(); |
190 } | 191 } |
191 | 192 |
192 bool QuicSession::IsCryptoHandshakeComplete() { | 193 bool QuicSession::IsCryptoHandshakeComplete() { |
193 return GetCryptoStream()->handshake_complete(); | 194 return GetCryptoStream()->handshake_complete(); |
194 } | 195 } |
195 | 196 |
196 void QuicSession::OnCryptoHandshakeComplete(QuicErrorCode error) { | 197 void QuicSession::OnCryptoHandshakeComplete(QuicErrorCode error) { |
197 // TODO(rch): tear down the connection if error != QUIC_NO_ERROR. | 198 // TODO(rch): tear down the connection if error != QUIC_NO_ERROR. |
198 } | 199 } |
199 | 200 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 void QuicSession::MarkWriteBlocked(QuicStreamId id) { | 298 void QuicSession::MarkWriteBlocked(QuicStreamId id) { |
298 write_blocked_streams_.AddBlockedObject(id); | 299 write_blocked_streams_.AddBlockedObject(id); |
299 } | 300 } |
300 | 301 |
301 void QuicSession::PostProcessAfterData() { | 302 void QuicSession::PostProcessAfterData() { |
302 STLDeleteElements(&closed_streams_); | 303 STLDeleteElements(&closed_streams_); |
303 closed_streams_.clear(); | 304 closed_streams_.clear(); |
304 } | 305 } |
305 | 306 |
306 } // namespace net | 307 } // namespace net |
OLD | NEW |