diff options
author | rtenneti <rtenneti@chromium.org> | 2015-09-17 12:33:41 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-17 19:34:13 +0000 |
commit | 8332ba58bb3772b0c50b97dc50bfb3d5ee2a8e7e (patch) | |
tree | 4718834afa6a13ed0dc31f95e607e84726d1bb0c /net/quic/quic_stream_factory.h | |
parent | 2f830359d1735966e8a2fe2b63bd0912b2cea58b (diff) | |
download | chromium_src-8332ba58bb3772b0c50b97dc50bfb3d5ee2a8e7e.zip chromium_src-8332ba58bb3772b0c50b97dc50bfb3d5ee2a8e7e.tar.gz chromium_src-8332ba58bb3772b0c50b97dc50bfb3d5ee2a8e7e.tar.bz2 |
QUIC - Delay the TCP job's InitConnection for 1.5 RTT if
QUIC is being tried. If we don't know the RTT for a server
then default RTT as 200ms.
If QUIC succeeds, TCP job will be orphaned.
This code is disabled by default. It could be enabled via
finch trial (delay_tcp_connection).
The following is the note from ianswett:
...
When QUIC is expected to work, we should likely delay the
SSL handshake by over an RTT.
This may be particularly valuable for mobile, where
clients are much more CPU and bandwidth limited.
We have defined "When QUIC is expected to work" as if
client had spoken QUIC before (require_confirmation_ is false).
Internal bug# 22977897
R=rch@chromium.org
Review URL: https://codereview.chromium.org/1312033009
Cr-Commit-Position: refs/heads/master@{#349468}
Diffstat (limited to 'net/quic/quic_stream_factory.h')
-rw-r--r-- | net/quic/quic_stream_factory.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/quic/quic_stream_factory.h b/net/quic/quic_stream_factory.h index c732680..c127362 100644 --- a/net/quic/quic_stream_factory.h +++ b/net/quic/quic_stream_factory.h @@ -12,6 +12,7 @@ #include "base/logging.h" #include "base/memory/weak_ptr.h" +#include "base/time/time.h" #include "net/base/address_list.h" #include "net/base/completion_callback.h" #include "net/base/host_port_pair.h" @@ -71,6 +72,10 @@ class NET_EXPORT_PRIVATE QuicStreamRequest { void OnRequestComplete(int rv); + // Helper method that calls |factory_|'s GetTimeDelayForWaitingJob(). It + // returns the amount of time waiting job should be delayed. + base::TimeDelta GetTimeDelayForWaitingJob() const; + scoped_ptr<QuicHttpStream> ReleaseStream(); void set_stream(scoped_ptr<QuicHttpStream> stream); @@ -87,6 +92,7 @@ class NET_EXPORT_PRIVATE QuicStreamRequest { QuicStreamFactory* factory_; HostPortPair host_port_pair_; std::string origin_host_; + bool is_https_; PrivacyMode privacy_mode_; BoundNetLog net_log_; CompletionCallback callback_; @@ -130,6 +136,7 @@ class NET_EXPORT_PRIVATE QuicStreamFactory int threshold_timeouts_with_streams_open, int threshold_public_resets_post_handshake, int socket_receive_buffer_size, + bool delay_tcp_race, const QuicTagVector& connection_options); ~QuicStreamFactory() override; @@ -215,6 +222,9 @@ class NET_EXPORT_PRIVATE QuicStreamFactory void set_require_confirmation(bool require_confirmation); + // It returns the amount of time waiting job should be delayed. + base::TimeDelta GetTimeDelayForWaitingJob(const QuicServerId& server_id); + QuicConnectionHelper* helper() { return helper_.get(); } bool enable_port_selection() const { return enable_port_selection_; } @@ -236,6 +246,8 @@ class NET_EXPORT_PRIVATE QuicStreamFactory int socket_receive_buffer_size() const { return socket_receive_buffer_size_; } + bool delay_tcp_race() const { return delay_tcp_race_; } + private: class Job; friend class test::QuicStreamFactoryPeer; @@ -305,6 +317,7 @@ class NET_EXPORT_PRIVATE QuicStreamFactory // Helper methods. bool WasQuicRecentlyBroken(const QuicServerId& server_id) const; + bool CryptoConfigCacheIsEmpty(const QuicServerId& server_id); // Initializes the cached state associated with |server_id| in @@ -416,6 +429,9 @@ class NET_EXPORT_PRIVATE QuicStreamFactory // Size of the UDP receive buffer. int socket_receive_buffer_size_; + // Set if we do want to delay TCP connection when it is racing with QUIC. + bool delay_tcp_race_; + // Each profile will (probably) have a unique port_seed_ value. This value // is used to help seed a pseudo-random number generator (PortSuggester) so // that we consistently (within this profile) suggest the same ephemeral |