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

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

Issue 1035713003: Confirm QUIC alternative service upon success. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify a constructor call. Created 5 years, 9 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
« no previous file with comments | « net/quic/quic_network_transaction_unittest.cc ('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 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 } 1127 }
1128 1128
1129 void QuicStreamFactory::ProcessGoingAwaySession( 1129 void QuicStreamFactory::ProcessGoingAwaySession(
1130 QuicClientSession* session, 1130 QuicClientSession* session,
1131 const QuicServerId& server_id, 1131 const QuicServerId& server_id,
1132 bool session_was_active) { 1132 bool session_was_active) {
1133 if (!http_server_properties_) 1133 if (!http_server_properties_)
1134 return; 1134 return;
1135 1135
1136 const QuicConnectionStats& stats = session->connection()->GetStats(); 1136 const QuicConnectionStats& stats = session->connection()->GetStats();
1137 const AlternativeService alternative_service(QUIC,
1138 server_id.host_port_pair());
1137 if (session->IsCryptoHandshakeConfirmed()) { 1139 if (session->IsCryptoHandshakeConfirmed()) {
1140 http_server_properties_->ConfirmAlternativeService(alternative_service);
1138 ServerNetworkStats network_stats; 1141 ServerNetworkStats network_stats;
1139 network_stats.srtt = base::TimeDelta::FromMicroseconds(stats.srtt_us); 1142 network_stats.srtt = base::TimeDelta::FromMicroseconds(stats.srtt_us);
1140 network_stats.bandwidth_estimate = stats.estimated_bandwidth; 1143 network_stats.bandwidth_estimate = stats.estimated_bandwidth;
1141 http_server_properties_->SetServerNetworkStats(server_id.host_port_pair(), 1144 http_server_properties_->SetServerNetworkStats(server_id.host_port_pair(),
1142 network_stats); 1145 network_stats);
1143 return; 1146 return;
1144 } 1147 }
1145 1148
1146 UMA_HISTOGRAM_COUNTS("Net.QuicHandshakeNotConfirmedNumPacketsReceived", 1149 UMA_HISTOGRAM_COUNTS("Net.QuicHandshakeNotConfirmedNumPacketsReceived",
1147 stats.packets_received); 1150 stats.packets_received);
1148 1151
1149 if (!session_was_active) 1152 if (!session_was_active)
1150 return; 1153 return;
1151 1154
1152 // TODO(rch): In the special case where the session has received no 1155 // TODO(rch): In the special case where the session has received no
1153 // packets from the peer, we should consider blacklisting this 1156 // packets from the peer, we should consider blacklisting this
1154 // differently so that we still race TCP but we don't consider the 1157 // differently so that we still race TCP but we don't consider the
1155 // session connected until the handshake has been confirmed. 1158 // session connected until the handshake has been confirmed.
1156 HistogramBrokenAlternateProtocolLocation( 1159 HistogramBrokenAlternateProtocolLocation(
1157 BROKEN_ALTERNATE_PROTOCOL_LOCATION_QUIC_STREAM_FACTORY); 1160 BROKEN_ALTERNATE_PROTOCOL_LOCATION_QUIC_STREAM_FACTORY);
1158 1161
1159 // Since the session was active, there's no longer an 1162 // Since the session was active, there's no longer an
1160 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP 1163 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP
1161 // job also fails. So to avoid not using QUIC when we otherwise could, we mark 1164 // job also fails. So to avoid not using QUIC when we otherwise could, we mark
1162 // it as recently broken, which means that 0-RTT will be disabled but we'll 1165 // it as recently broken, which means that 0-RTT will be disabled but we'll
1163 // still race. 1166 // still race.
1164 const HostPortPair& server = server_id.host_port_pair();
1165 http_server_properties_->MarkAlternativeServiceRecentlyBroken( 1167 http_server_properties_->MarkAlternativeServiceRecentlyBroken(
1166 AlternativeService(QUIC, server.host(), server.port())); 1168 alternative_service);
1167 } 1169 }
1168 1170
1169 } // namespace net 1171 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_network_transaction_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698