| 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/crypto/proof_verifier.h" | 8 #include "net/quic/crypto/proof_verifier.h" |
| 9 #include "net/quic/quic_connection.h" | 9 #include "net/quic/quic_connection.h" |
| 10 #include "net/quic/quic_headers_stream.h" | 10 #include "net/quic/quic_headers_stream.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 79 } |
| 80 | 80 |
| 81 virtual bool HasPendingWrites() const OVERRIDE { | 81 virtual bool HasPendingWrites() const OVERRIDE { |
| 82 return session_->HasPendingWrites(); | 82 return session_->HasPendingWrites(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 virtual bool HasPendingHandshake() const OVERRIDE { | 85 virtual bool HasPendingHandshake() const OVERRIDE { |
| 86 return session_->HasPendingHandshake(); | 86 return session_->HasPendingHandshake(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 virtual bool HasOpenDataStreams() const OVERRIDE { |
| 90 return session_->HasOpenDataStreams(); |
| 91 } |
| 92 |
| 89 private: | 93 private: |
| 90 QuicSession* session_; | 94 QuicSession* session_; |
| 91 }; | 95 }; |
| 92 | 96 |
| 93 QuicSession::QuicSession(QuicConnection* connection, | 97 QuicSession::QuicSession(QuicConnection* connection, |
| 94 const QuicConfig& config) | 98 const QuicConfig& config) |
| 95 : connection_(connection), | 99 : connection_(connection), |
| 96 visitor_shim_(new VisitorShim(this)), | 100 visitor_shim_(new VisitorShim(this)), |
| 97 config_(config), | 101 config_(config), |
| 98 max_open_streams_(config_.max_streams_per_connection()), | 102 max_open_streams_(config_.max_streams_per_connection()), |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 } | 298 } |
| 295 | 299 |
| 296 bool QuicSession::HasPendingWrites() const { | 300 bool QuicSession::HasPendingWrites() const { |
| 297 return write_blocked_streams_.HasWriteBlockedStreams(); | 301 return write_blocked_streams_.HasWriteBlockedStreams(); |
| 298 } | 302 } |
| 299 | 303 |
| 300 bool QuicSession::HasPendingHandshake() const { | 304 bool QuicSession::HasPendingHandshake() const { |
| 301 return has_pending_handshake_; | 305 return has_pending_handshake_; |
| 302 } | 306 } |
| 303 | 307 |
| 308 bool QuicSession::HasOpenDataStreams() const { |
| 309 return GetNumOpenStreams() > 0; |
| 310 } |
| 311 |
| 304 QuicConsumedData QuicSession::WritevData( | 312 QuicConsumedData QuicSession::WritevData( |
| 305 QuicStreamId id, | 313 QuicStreamId id, |
| 306 const IOVector& data, | 314 const IOVector& data, |
| 307 QuicStreamOffset offset, | 315 QuicStreamOffset offset, |
| 308 bool fin, | 316 bool fin, |
| 309 QuicAckNotifier::DelegateInterface* ack_notifier_delegate) { | 317 QuicAckNotifier::DelegateInterface* ack_notifier_delegate) { |
| 310 return connection_->SendStreamData(id, data, offset, fin, | 318 return connection_->SendStreamData(id, data, offset, fin, |
| 311 ack_notifier_delegate); | 319 ack_notifier_delegate); |
| 312 } | 320 } |
| 313 | 321 |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 NOTIMPLEMENTED(); | 599 NOTIMPLEMENTED(); |
| 592 return false; | 600 return false; |
| 593 } | 601 } |
| 594 | 602 |
| 595 void QuicSession::PostProcessAfterData() { | 603 void QuicSession::PostProcessAfterData() { |
| 596 STLDeleteElements(&closed_streams_); | 604 STLDeleteElements(&closed_streams_); |
| 597 closed_streams_.clear(); | 605 closed_streams_.clear(); |
| 598 } | 606 } |
| 599 | 607 |
| 600 } // namespace net | 608 } // namespace net |
| OLD | NEW |