| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 ReliableQuicStream* stream = it->second; | 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 stream->OnClose(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 bool QuicSession::IsCryptoHandshakeComplete() { | 193 bool QuicSession::IsEncryptionEstablished() { |
| 194 return GetCryptoStream()->handshake_complete(); | 194 return GetCryptoStream()->encryption_established(); |
| 195 } | 195 } |
| 196 | 196 |
| 197 void QuicSession::OnCryptoHandshakeComplete(QuicErrorCode error) { | 197 bool QuicSession::IsCryptoHandshakeConfirmed() { |
| 198 // TODO(rch): tear down the connection if error != QUIC_NO_ERROR. | 198 return GetCryptoStream()->handshake_confirmed(); |
| 199 } |
| 200 |
| 201 void QuicSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) { |
| 199 } | 202 } |
| 200 | 203 |
| 201 void QuicSession::ActivateStream(ReliableQuicStream* stream) { | 204 void QuicSession::ActivateStream(ReliableQuicStream* stream) { |
| 202 DLOG(INFO) << "num_streams: " << stream_map_.size() | 205 DLOG(INFO) << "num_streams: " << stream_map_.size() |
| 203 << ". activating " << stream->id(); | 206 << ". activating " << stream->id(); |
| 204 DCHECK(stream_map_.count(stream->id()) == 0); | 207 DCHECK(stream_map_.count(stream->id()) == 0); |
| 205 stream_map_[stream->id()] = stream; | 208 stream_map_[stream->id()] = stream; |
| 206 } | 209 } |
| 207 | 210 |
| 208 QuicStreamId QuicSession::GetNextStreamId() { | 211 QuicStreamId QuicSession::GetNextStreamId() { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 void QuicSession::MarkWriteBlocked(QuicStreamId id) { | 301 void QuicSession::MarkWriteBlocked(QuicStreamId id) { |
| 299 write_blocked_streams_.AddBlockedObject(id); | 302 write_blocked_streams_.AddBlockedObject(id); |
| 300 } | 303 } |
| 301 | 304 |
| 302 void QuicSession::PostProcessAfterData() { | 305 void QuicSession::PostProcessAfterData() { |
| 303 STLDeleteElements(&closed_streams_); | 306 STLDeleteElements(&closed_streams_); |
| 304 closed_streams_.clear(); | 307 closed_streams_.clear(); |
| 305 } | 308 } |
| 306 | 309 |
| 307 } // namespace net | 310 } // namespace net |
| OLD | NEW |