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_client_session.h" | 5 #include "net/quic/quic_client_session.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/metrics/sparse_histogram.h" | 10 #include "base/metrics/sparse_histogram.h" |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 } | 583 } |
584 if (event == HANDSHAKE_CONFIRMED) { | 584 if (event == HANDSHAKE_CONFIRMED) { |
585 UMA_HISTOGRAM_TIMES("Net.QuicSession.HandshakeConfirmedTime", | 585 UMA_HISTOGRAM_TIMES("Net.QuicSession.HandshakeConfirmedTime", |
586 base::TimeTicks::Now() - handshake_start_); | 586 base::TimeTicks::Now() - handshake_start_); |
587 ObserverSet::iterator it = observers_.begin(); | 587 ObserverSet::iterator it = observers_.begin(); |
588 while (it != observers_.end()) { | 588 while (it != observers_.end()) { |
589 Observer* observer = *it; | 589 Observer* observer = *it; |
590 ++it; | 590 ++it; |
591 observer->OnCryptoHandshakeConfirmed(); | 591 observer->OnCryptoHandshakeConfirmed(); |
592 } | 592 } |
| 593 if (server_info_) |
| 594 server_info_->OnExternalCacheHit(); |
593 } | 595 } |
594 QuicSession::OnCryptoHandshakeEvent(event); | 596 QuicSession::OnCryptoHandshakeEvent(event); |
595 } | 597 } |
596 | 598 |
597 void QuicClientSession::OnCryptoHandshakeMessageSent( | 599 void QuicClientSession::OnCryptoHandshakeMessageSent( |
598 const CryptoHandshakeMessage& message) { | 600 const CryptoHandshakeMessage& message) { |
599 logger_->OnCryptoHandshakeMessageSent(message); | 601 logger_->OnCryptoHandshakeMessageSent(message); |
600 } | 602 } |
601 | 603 |
602 void QuicClientSession::OnCryptoHandshakeMessageReceived( | 604 void QuicClientSession::OnCryptoHandshakeMessageReceived( |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 void QuicClientSession::OnSuccessfulVersionNegotiation( | 677 void QuicClientSession::OnSuccessfulVersionNegotiation( |
676 const QuicVersion& version) { | 678 const QuicVersion& version) { |
677 logger_->OnSuccessfulVersionNegotiation(version); | 679 logger_->OnSuccessfulVersionNegotiation(version); |
678 QuicSession::OnSuccessfulVersionNegotiation(version); | 680 QuicSession::OnSuccessfulVersionNegotiation(version); |
679 } | 681 } |
680 | 682 |
681 void QuicClientSession::OnProofValid( | 683 void QuicClientSession::OnProofValid( |
682 const QuicCryptoClientConfig::CachedState& cached) { | 684 const QuicCryptoClientConfig::CachedState& cached) { |
683 DCHECK(cached.proof_valid()); | 685 DCHECK(cached.proof_valid()); |
684 | 686 |
685 if (!server_info_ || !server_info_->IsReadyToPersist()) { | 687 if (!server_info_) { |
686 return; | 688 return; |
687 } | 689 } |
688 | 690 |
689 QuicServerInfo::State* state = server_info_->mutable_state(); | 691 QuicServerInfo::State* state = server_info_->mutable_state(); |
690 | 692 |
691 state->server_config = cached.server_config(); | 693 state->server_config = cached.server_config(); |
692 state->source_address_token = cached.source_address_token(); | 694 state->source_address_token = cached.source_address_token(); |
693 state->server_config_sig = cached.signature(); | 695 state->server_config_sig = cached.signature(); |
694 state->certs = cached.certs(); | 696 state->certs = cached.certs(); |
695 | 697 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 return; | 889 return; |
888 | 890 |
889 // TODO(rch): re-enable this code once beta is cut. | 891 // TODO(rch): re-enable this code once beta is cut. |
890 // if (stream_factory_) | 892 // if (stream_factory_) |
891 // stream_factory_->OnSessionConnectTimeout(this); | 893 // stream_factory_->OnSessionConnectTimeout(this); |
892 // CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED); | 894 // CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED); |
893 // DCHECK_EQ(0u, GetNumOpenStreams()); | 895 // DCHECK_EQ(0u, GetNumOpenStreams()); |
894 } | 896 } |
895 | 897 |
896 } // namespace net | 898 } // namespace net |
OLD | NEW |