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

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: 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
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 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 bool QuicStreamFactory::WasQuicRecentlyBroken( 1065 bool QuicStreamFactory::WasQuicRecentlyBroken(
1066 const QuicServerId& server_id) const { 1066 const QuicServerId& server_id) const {
1067 if (!http_server_properties_) 1067 if (!http_server_properties_)
1068 return false; 1068 return false;
1069 const AlternativeService alternative_service(QUIC, 1069 const AlternativeService alternative_service(QUIC,
1070 server_id.host_port_pair()); 1070 server_id.host_port_pair());
1071 return http_server_properties_->WasAlternativeServiceRecentlyBroken( 1071 return http_server_properties_->WasAlternativeServiceRecentlyBroken(
1072 alternative_service); 1072 alternative_service);
1073 } 1073 }
1074 1074
1075 void QuicStreamFactory::ConfirmQuic(const QuicServerId& server_id) const {
1076 if (!http_server_properties_)
1077 return;
1078 const AlternativeService alternative_service(QUIC,
1079 server_id.host_port_pair());
1080 http_server_properties_->ConfirmAlternativeService(alternative_service);
1081 }
1082
1075 bool QuicStreamFactory::CryptoConfigCacheIsEmpty( 1083 bool QuicStreamFactory::CryptoConfigCacheIsEmpty(
1076 const QuicServerId& server_id) { 1084 const QuicServerId& server_id) {
1077 QuicCryptoClientConfig::CachedState* cached = 1085 QuicCryptoClientConfig::CachedState* cached =
1078 crypto_config_.LookupOrCreate(server_id); 1086 crypto_config_.LookupOrCreate(server_id);
1079 return cached->IsEmpty(); 1087 return cached->IsEmpty();
1080 } 1088 }
1081 1089
1082 void QuicStreamFactory::InitializeCachedStateInCryptoConfig( 1090 void QuicStreamFactory::InitializeCachedStateInCryptoConfig(
1083 const QuicServerId& server_id, 1091 const QuicServerId& server_id,
1084 const scoped_ptr<QuicServerInfo>& server_info) { 1092 const scoped_ptr<QuicServerInfo>& server_info) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1160 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP 1168 // 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 1169 // 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 1170 // it as recently broken, which means that 0-RTT will be disabled but we'll
1163 // still race. 1171 // still race.
1164 const HostPortPair& server = server_id.host_port_pair(); 1172 const HostPortPair& server = server_id.host_port_pair();
1165 http_server_properties_->MarkAlternativeServiceRecentlyBroken( 1173 http_server_properties_->MarkAlternativeServiceRecentlyBroken(
1166 AlternativeService(QUIC, server.host(), server.port())); 1174 AlternativeService(QUIC, server.host(), server.port()));
1167 } 1175 }
1168 1176
1169 } // namespace net 1177 } // namespace net
OLDNEW
« net/quic/quic_client_session.cc ('K') | « net/quic/quic_stream_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698