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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 StreamRequest* request = stream_requests_.front(); | 730 StreamRequest* request = stream_requests_.front(); |
731 stream_requests_.pop_front(); | 731 stream_requests_.pop_front(); |
732 request->OnRequestCompleteSuccess(CreateOutgoingReliableStreamImpl()); | 732 request->OnRequestCompleteSuccess(CreateOutgoingReliableStreamImpl()); |
733 } | 733 } |
734 | 734 |
735 if (GetNumOpenOutgoingStreams() == 0 && stream_factory_) { | 735 if (GetNumOpenOutgoingStreams() == 0 && stream_factory_) { |
736 stream_factory_->OnIdleSession(this); | 736 stream_factory_->OnIdleSession(this); |
737 } | 737 } |
738 } | 738 } |
739 | 739 |
| 740 void QuicChromiumClientSession::OnConfigNegotiated() { |
| 741 QuicClientSessionBase::OnConfigNegotiated(); |
| 742 if (stream_factory_ && config()->HasReceivedAlternateServerAddress()) { |
| 743 // Server has sent an alternate address to connect to. |
| 744 stream_factory_->MigrateSessionToNewSocket( |
| 745 this, config()->ReceivedAlternateServerAddress(), |
| 746 NetworkChangeNotifier::kInvalidNetworkHandle, net_log_, nullptr); |
| 747 } |
| 748 } |
| 749 |
740 void QuicChromiumClientSession::OnCryptoHandshakeEvent( | 750 void QuicChromiumClientSession::OnCryptoHandshakeEvent( |
741 CryptoHandshakeEvent event) { | 751 CryptoHandshakeEvent event) { |
742 if (stream_factory_ && event == HANDSHAKE_CONFIRMED && | 752 if (stream_factory_ && event == HANDSHAKE_CONFIRMED && |
743 (stream_factory_->OnHandshakeConfirmed( | 753 (stream_factory_->OnHandshakeConfirmed( |
744 this, logger_->ReceivedPacketLossRate()))) { | 754 this, logger_->ReceivedPacketLossRate()))) { |
745 return; | 755 return; |
746 } | 756 } |
747 | 757 |
748 if (!callback_.is_null() && | 758 if (!callback_.is_null() && |
749 (!require_confirmation_ || event == HANDSHAKE_CONFIRMED || | 759 (!require_confirmation_ || event == HANDSHAKE_CONFIRMED || |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1227 } | 1237 } |
1228 | 1238 |
1229 void QuicChromiumClientSession::DeletePromised( | 1239 void QuicChromiumClientSession::DeletePromised( |
1230 QuicClientPromisedInfo* promised) { | 1240 QuicClientPromisedInfo* promised) { |
1231 if (IsOpenStream(promised->id())) | 1241 if (IsOpenStream(promised->id())) |
1232 streams_pushed_and_claimed_count_++; | 1242 streams_pushed_and_claimed_count_++; |
1233 QuicClientSessionBase::DeletePromised(promised); | 1243 QuicClientSessionBase::DeletePromised(promised); |
1234 } | 1244 } |
1235 | 1245 |
1236 } // namespace net | 1246 } // namespace net |
OLD | NEW |