Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: net/quic/quic_stream_factory.cc

Issue 293063013: Now that the HttpStreamFactoryImpl::Job is not marking Alternate-Protocol (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better test Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_stream_factory.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_stream_factory.h" 5 #include "net/quic/quic_stream_factory.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/cpu.h" 9 #include "base/cpu.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 ++it) { 575 ++it) {
576 DCHECK(active_sessions_.count(*it)); 576 DCHECK(active_sessions_.count(*it));
577 DCHECK_EQ(session, active_sessions_[*it]); 577 DCHECK_EQ(session, active_sessions_[*it]);
578 // Track sessions which have recently gone away so that we can disable 578 // Track sessions which have recently gone away so that we can disable
579 // port suggestions. 579 // port suggestions.
580 if (session->goaway_received()) { 580 if (session->goaway_received()) {
581 gone_away_aliases_.insert(*it); 581 gone_away_aliases_.insert(*it);
582 } 582 }
583 583
584 active_sessions_.erase(*it); 584 active_sessions_.erase(*it);
585 ProcessGoingAwaySession(session, *it); 585 ProcessGoingAwaySession(session, *it, true);
586 } 586 }
587 ProcessGoingAwaySession(session, all_sessions_[session]); 587 ProcessGoingAwaySession(session, all_sessions_[session], false);
588 if (!aliases.empty()) { 588 if (!aliases.empty()) {
589 const IpAliasKey ip_alias_key(session->connection()->peer_address(), 589 const IpAliasKey ip_alias_key(session->connection()->peer_address(),
590 aliases.begin()->is_https()); 590 aliases.begin()->is_https());
591 ip_aliases_[ip_alias_key].erase(session); 591 ip_aliases_[ip_alias_key].erase(session);
592 if (ip_aliases_[ip_alias_key].empty()) { 592 if (ip_aliases_[ip_alias_key].empty()) {
593 ip_aliases_.erase(ip_alias_key); 593 ip_aliases_.erase(ip_alias_key);
594 } 594 }
595 } 595 }
596 session_aliases_.erase(session); 596 session_aliases_.erase(session);
597 } 597 }
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 return; 809 return;
810 810
811 if (!server_id.is_https()) { 811 if (!server_id.is_https()) {
812 // Don't check the certificates for insecure QUIC. 812 // Don't check the certificates for insecure QUIC.
813 cached->SetProofValid(); 813 cached->SetProofValid();
814 } 814 }
815 } 815 }
816 816
817 void QuicStreamFactory::ProcessGoingAwaySession( 817 void QuicStreamFactory::ProcessGoingAwaySession(
818 QuicClientSession* session, 818 QuicClientSession* session,
819 const QuicServerId& server_id) { 819 const QuicServerId& server_id,
820 bool session_was_active) {
820 if (!http_server_properties_) 821 if (!http_server_properties_)
821 return; 822 return;
822 823
823 const QuicConnectionStats& stats = session->connection()->GetStats(); 824 const QuicConnectionStats& stats = session->connection()->GetStats();
824 if (!session->IsCryptoHandshakeConfirmed()) { 825 if (session->IsCryptoHandshakeConfirmed()) {
826 HttpServerProperties::NetworkStats network_stats;
827 network_stats.srtt = base::TimeDelta::FromMicroseconds(stats.srtt_us);
828 network_stats.bandwidth_estimate = stats.estimated_bandwidth;
829 http_server_properties_->SetServerNetworkStats(server_id.host_port_pair(),
830 network_stats);
831 }
jar (doing other things) 2014/05/22 21:03:22 nit: return
832
833 UMA_HISTOGRAM_COUNTS("Net.QuicHandshakeNotConfirmedNumPacketsReceived",
834 stats.packets_received);
835
836 if (session_was_active) {
825 // TODO(rch): In the special case where the session has received no 837 // TODO(rch): In the special case where the session has received no
826 // packets from the peer, we should consider blacklisting this 838 // packets from the peer, we should consider blacklisting this
827 // differently so that we still race TCP but we don't consider the 839 // differently so that we still race TCP but we don't consider the
828 // session connected until the handshake has been confirmed. 840 // session connected until the handshake has been confirmed.
829 HistogramBrokenAlternateProtocolLocation( 841 HistogramBrokenAlternateProtocolLocation(
830 BROKEN_ALTERNATE_PROTOCOL_LOCATION_QUIC_STREAM_FACTORY); 842 BROKEN_ALTERNATE_PROTOCOL_LOCATION_QUIC_STREAM_FACTORY);
831 http_server_properties_->SetBrokenAlternateProtocol( 843 http_server_properties_->SetBrokenAlternateProtocol(
832 server_id.host_port_pair()); 844 server_id.host_port_pair());
833 UMA_HISTOGRAM_COUNTS("Net.QuicHandshakeNotConfirmedNumPacketsReceived",
834 stats.packets_received);
835 return;
836 } 845 }
837
838 HttpServerProperties::NetworkStats network_stats;
839 network_stats.srtt = base::TimeDelta::FromMicroseconds(stats.srtt_us);
840 network_stats.bandwidth_estimate = stats.estimated_bandwidth;
841 http_server_properties_->SetServerNetworkStats(server_id.host_port_pair(),
842 network_stats);
843 } 846 }
844 847
845 } // namespace net 848 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698