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

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

Issue 989273005: Add MarkAlternativeServiceRecentlyBroken. (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 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 stats.packets_received); 1317 stats.packets_received);
1318 1318
1319 if (!session_was_active) 1319 if (!session_was_active)
1320 return; 1320 return;
1321 1321
1322 const HostPortPair& server = server_id.host_port_pair(); 1322 const HostPortPair& server = server_id.host_port_pair();
1323 // Don't try to change the alternate-protocol state, if the 1323 // Don't try to change the alternate-protocol state, if the
1324 // alternate-protocol state is unknown. 1324 // alternate-protocol state is unknown.
1325 const AlternateProtocolInfo alternate = 1325 const AlternateProtocolInfo alternate =
1326 http_server_properties_->GetAlternateProtocol(server); 1326 http_server_properties_->GetAlternateProtocol(server);
1327 if (alternate.protocol == UNINITIALIZED_ALTERNATE_PROTOCOL) 1327 if (alternate.protocol == UNINITIALIZED_ALTERNATE_PROTOCOL)
Bence 2015/03/12 01:12:53 I'm removing these couple of lines, because this u
1328 return; 1328 return;
1329 1329
1330 // TODO(rch): In the special case where the session has received no 1330 // TODO(rch): In the special case where the session has received no
1331 // packets from the peer, we should consider blacklisting this 1331 // packets from the peer, we should consider blacklisting this
1332 // differently so that we still race TCP but we don't consider the 1332 // differently so that we still race TCP but we don't consider the
1333 // session connected until the handshake has been confirmed. 1333 // session connected until the handshake has been confirmed.
1334 HistogramBrokenAlternateProtocolLocation( 1334 HistogramBrokenAlternateProtocolLocation(
1335 BROKEN_ALTERNATE_PROTOCOL_LOCATION_QUIC_STREAM_FACTORY); 1335 BROKEN_ALTERNATE_PROTOCOL_LOCATION_QUIC_STREAM_FACTORY);
1336 DCHECK_EQ(QUIC, alternate.protocol); 1336 DCHECK_EQ(QUIC, alternate.protocol);
1337 1337
1338 // Since the session was active, there's no longer an 1338 // Since the session was active, there's no longer an
1339 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the 1339 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP
1340 // TCP job also fails. So to avoid not using QUIC when we otherwise could, 1340 // job also fails. So to avoid not using QUIC when we otherwise could, we mark
1341 // we mark it as broken, and then immediately re-enable it. This leaves 1341 // it as recently broken, which means that 0-RTT will be disabled but we'll
1342 // QUIC as "recently broken" which means that 0-RTT will be disabled but 1342 // still race.
1343 // we'll still race. 1343 const AlternativeService alternative_service(alternate.protocol,
1344 http_server_properties_->SetBrokenAlternateProtocol(server); 1344 server.host(), alternate.port);
1345 http_server_properties_->ClearAlternateProtocol(server); 1345 http_server_properties_->MarkAlternativeServiceRecentlyBroken(
Ryan Hamilton 2015/03/11 23:02:34 I didn't mention this explicitly, but you can remo
Bence 2015/03/12 01:12:53 You mean remove from HttpServerProperties? We'll
Ryan Hamilton 2015/03/12 03:31:40 Hm. That's possible. I'm not sure that I love requ
1346 http_server_properties_->SetAlternateProtocol( 1346 alternative_service);
Ryan Hamilton 2015/03/11 20:28:02 How 'bout just: http_server_properties_->MarkAl
Bence 2015/03/12 01:12:53 Done.
1347 server, alternate.port, alternate.protocol, 1);
1348 DCHECK_EQ(QUIC, 1347 DCHECK_EQ(QUIC,
1349 http_server_properties_->GetAlternateProtocol(server).protocol); 1348 http_server_properties_->GetAlternateProtocol(server).protocol);
1350 DCHECK(http_server_properties_->WasAlternateProtocolRecentlyBroken(
1351 server));
1352 } 1349 }
1353 1350
1354 } // namespace net 1351 } // namespace net
OLDNEW
« net/http/http_server_properties_impl.cc ('K') | « net/http/http_server_properties_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698