| 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_chromium_client_session.h" | 5 #include "net/quic/quic_chromium_client_session.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 | 698 |
| 699 void QuicChromiumClientSession::OnClosedStream() { | 699 void QuicChromiumClientSession::OnClosedStream() { |
| 700 if (GetNumOpenOutgoingStreams() < max_open_outgoing_streams() && | 700 if (GetNumOpenOutgoingStreams() < max_open_outgoing_streams() && |
| 701 !stream_requests_.empty() && crypto_stream_->encryption_established() && | 701 !stream_requests_.empty() && crypto_stream_->encryption_established() && |
| 702 !goaway_received() && !going_away_ && connection()->connected()) { | 702 !goaway_received() && !going_away_ && connection()->connected()) { |
| 703 StreamRequest* request = stream_requests_.front(); | 703 StreamRequest* request = stream_requests_.front(); |
| 704 stream_requests_.pop_front(); | 704 stream_requests_.pop_front(); |
| 705 request->OnRequestCompleteSuccess(CreateOutgoingReliableStreamImpl()); | 705 request->OnRequestCompleteSuccess(CreateOutgoingReliableStreamImpl()); |
| 706 } | 706 } |
| 707 | 707 |
| 708 if (GetNumOpenOutgoingStreams() == 0) { | 708 if (GetNumOpenOutgoingStreams() == 0 && stream_factory_) { |
| 709 stream_factory_->OnIdleSession(this); | 709 stream_factory_->OnIdleSession(this); |
| 710 } | 710 } |
| 711 } | 711 } |
| 712 | 712 |
| 713 void QuicChromiumClientSession::OnCryptoHandshakeEvent( | 713 void QuicChromiumClientSession::OnCryptoHandshakeEvent( |
| 714 CryptoHandshakeEvent event) { | 714 CryptoHandshakeEvent event) { |
| 715 if (stream_factory_ && event == HANDSHAKE_CONFIRMED && | 715 if (stream_factory_ && event == HANDSHAKE_CONFIRMED && |
| 716 (stream_factory_->OnHandshakeConfirmed( | 716 (stream_factory_->OnHandshakeConfirmed( |
| 717 this, logger_->ReceivedPacketLossRate()))) { | 717 this, logger_->ReceivedPacketLossRate()))) { |
| 718 return; | 718 return; |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 NotifyFactoryOfSessionClosedLater(); | 902 NotifyFactoryOfSessionClosedLater(); |
| 903 } | 903 } |
| 904 | 904 |
| 905 void QuicChromiumClientSession::OnSuccessfulVersionNegotiation( | 905 void QuicChromiumClientSession::OnSuccessfulVersionNegotiation( |
| 906 const QuicVersion& version) { | 906 const QuicVersion& version) { |
| 907 logger_->OnSuccessfulVersionNegotiation(version); | 907 logger_->OnSuccessfulVersionNegotiation(version); |
| 908 QuicSpdySession::OnSuccessfulVersionNegotiation(version); | 908 QuicSpdySession::OnSuccessfulVersionNegotiation(version); |
| 909 } | 909 } |
| 910 | 910 |
| 911 void QuicChromiumClientSession::OnPathDegrading() { | 911 void QuicChromiumClientSession::OnPathDegrading() { |
| 912 stream_factory_->MaybeMigrateSessionEarly(this); | 912 if (stream_factory_) { |
| 913 stream_factory_->MaybeMigrateSessionEarly(this); |
| 914 } |
| 913 } | 915 } |
| 914 | 916 |
| 915 void QuicChromiumClientSession::OnProofValid( | 917 void QuicChromiumClientSession::OnProofValid( |
| 916 const QuicCryptoClientConfig::CachedState& cached) { | 918 const QuicCryptoClientConfig::CachedState& cached) { |
| 917 DCHECK(cached.proof_valid()); | 919 DCHECK(cached.proof_valid()); |
| 918 | 920 |
| 919 if (!server_info_) { | 921 if (!server_info_) { |
| 920 return; | 922 return; |
| 921 } | 923 } |
| 922 | 924 |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1175 } | 1177 } |
| 1176 | 1178 |
| 1177 void QuicChromiumClientSession::DeletePromised( | 1179 void QuicChromiumClientSession::DeletePromised( |
| 1178 QuicClientPromisedInfo* promised) { | 1180 QuicClientPromisedInfo* promised) { |
| 1179 if (IsOpenStream(promised->id())) | 1181 if (IsOpenStream(promised->id())) |
| 1180 streams_pushed_and_claimed_count_++; | 1182 streams_pushed_and_claimed_count_++; |
| 1181 QuicClientSessionBase::DeletePromised(promised); | 1183 QuicClientSessionBase::DeletePromised(promised); |
| 1182 } | 1184 } |
| 1183 | 1185 |
| 1184 } // namespace net | 1186 } // namespace net |
| OLD | NEW |