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

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

Issue 1502453003: QUIC - Disable Preconnect when QUIC can be spoken to a server with 0RTT (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 } 678 }
679 679
680 void QuicStreamFactory::set_require_confirmation(bool require_confirmation) { 680 void QuicStreamFactory::set_require_confirmation(bool require_confirmation) {
681 require_confirmation_ = require_confirmation; 681 require_confirmation_ = require_confirmation;
682 if (!(local_address_ == IPEndPoint())) { 682 if (!(local_address_ == IPEndPoint())) {
683 http_server_properties_->SetSupportsQuic(!require_confirmation, 683 http_server_properties_->SetSupportsQuic(!require_confirmation,
684 local_address_.address()); 684 local_address_.address());
685 } 685 }
686 } 686 }
687 687
688 bool QuicStreamFactory::IsQuicDoingZeroRTT(const HostPortPair& host_port_pair,
689 PrivacyMode privacy_mode) {
690 return !(require_confirmation_ || CryptoConfigCacheIsEmpty(QuicServerId(
691 host_port_pair, privacy_mode)));
Ryan Hamilton 2015/12/05 04:16:17 Is this indented correctly?
ramant (doing other things) 2015/12/07 20:05:39 Done.
692 }
693
688 base::TimeDelta QuicStreamFactory::GetTimeDelayForWaitingJob( 694 base::TimeDelta QuicStreamFactory::GetTimeDelayForWaitingJob(
689 const QuicServerId& server_id) { 695 const QuicServerId& server_id) {
690 if (!delay_tcp_race_ || require_confirmation_) 696 if (!delay_tcp_race_ || require_confirmation_)
691 return base::TimeDelta(); 697 return base::TimeDelta();
692 int64 srtt = 1.5 * GetServerNetworkStatsSmoothedRttInMicroseconds(server_id); 698 int64 srtt = 1.5 * GetServerNetworkStatsSmoothedRttInMicroseconds(server_id);
693 // Picked 300ms based on mean time from 699 // Picked 300ms based on mean time from
694 // Net.QuicSession.HostResolution.HandshakeConfirmedTime histogram. 700 // Net.QuicSession.HostResolution.HandshakeConfirmedTime histogram.
695 const int kDefaultRTT = 300 * kNumMicrosPerMilli; 701 const int kDefaultRTT = 300 * kNumMicrosPerMilli;
696 if (!srtt) 702 if (!srtt)
697 srtt = kDefaultRTT; 703 srtt = kDefaultRTT;
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
1453 // Since the session was active, there's no longer an 1459 // Since the session was active, there's no longer an
1454 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP 1460 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP
1455 // job also fails. So to avoid not using QUIC when we otherwise could, we mark 1461 // job also fails. So to avoid not using QUIC when we otherwise could, we mark
1456 // it as recently broken, which means that 0-RTT will be disabled but we'll 1462 // it as recently broken, which means that 0-RTT will be disabled but we'll
1457 // still race. 1463 // still race.
1458 http_server_properties_->MarkAlternativeServiceRecentlyBroken( 1464 http_server_properties_->MarkAlternativeServiceRecentlyBroken(
1459 alternative_service); 1465 alternative_service);
1460 } 1466 }
1461 1467
1462 } // namespace net 1468 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698