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

Unified Diff: net/quic/quic_stream_factory.h

Issue 881133004: QUIC - Race two connections. One connection which loads data from disk (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/quic_stream_factory.h
diff --git a/net/quic/quic_stream_factory.h b/net/quic/quic_stream_factory.h
index f13156a94a0d16bf81930ec18e7ae429aaaca2af..d6e655d4c517084f49dbe0aa631478e6448d765f 100644
--- a/net/quic/quic_stream_factory.h
+++ b/net/quic/quic_stream_factory.h
@@ -178,6 +178,8 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
quic_server_info_factory_ = quic_server_info_factory;
}
+ bool enable_connection_racing() const { return enable_connection_racing_; }
+
private:
class Job;
friend class test::QuicStreamFactoryPeer;
@@ -204,10 +206,19 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
typedef std::set<QuicClientSession*> SessionSet;
typedef std::map<IpAliasKey, SessionSet> IPAliasMap;
typedef std::map<QuicServerId, QuicCryptoClientConfig*> CryptoConfigMap;
- typedef std::map<QuicServerId, Job*> JobMap;
- typedef std::map<QuicStreamRequest*, Job*> RequestMap;
+ typedef std::set<Job*> JobSet;
+ typedef std::map<QuicServerId, JobSet> JobMap;
+ typedef std::map<QuicStreamRequest*, QuicServerId> RequestMap;
typedef std::set<QuicStreamRequest*> RequestSet;
- typedef std::map<Job*, RequestSet> JobRequestsMap;
+ typedef std::map<QuicServerId, RequestSet> ServerIDRequestsMap;
+
+ // Creates a second job which doesn't wait for server config to be loaded from
+ // the disk cache. This job is created only when main job is waiting for the
+ // disk cache to load server config.
+ int CreateAuxilaryJob(const QuicServerId server_id,
Ryan Hamilton 2015/02/03 18:54:36 This is not super important, but I thought you dec
ramant (doing other things) 2015/02/04 17:40:46 Done.
+ base::StringPiece method,
+ const BoundNetLog& net_log,
+ QuicStreamRequest* request);
// Returns a newly created QuicHttpStream owned by the caller, if a
// matching session already exists. Returns NULL otherwise.
@@ -219,6 +230,7 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
void OnJobComplete(Job* job, int rv);
bool HasActiveSession(const QuicServerId& server_id) const;
bool HasActiveJob(const QuicServerId& server_id) const;
+ void CancelAuxilaryJob(Job* job, const QuicServerId& server_id);
int CreateSession(const QuicServerId& server_id,
scoped_ptr<QuicServerInfo> quic_server_info,
const AddressList& address_list,
@@ -233,6 +245,10 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
int64 GetServerNetworkStatsSmoothedRttInMicroseconds(
const QuicServerId& server_id) const;
+ // Helped methods.
+ bool WasAlternateProtocolRecentlyBroken(const QuicServerId& server_id) const;
+ bool CryptoConfigCacheIsEmpty(const QuicServerId& server_id);
+
// Initializes the cached state associated with |server_id| in
// |crypto_config_| with the information in |server_info|.
void InitializeCachedStateInCryptoConfig(
@@ -274,7 +290,7 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
QuicCryptoClientConfig crypto_config_;
JobMap active_jobs_;
- JobRequestsMap job_requests_map_;
+ ServerIDRequestsMap job_requests_map_;
RequestMap active_requests_;
QuicVersionVector supported_versions_;
@@ -305,6 +321,11 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
// Set this for setting config's BytesForConnectionIdToSend (TCID param) to 0.
bool enable_truncated_connection_ids_;
+ // Set if we want to race connections - one connection that sends
+ // INCHOATE_HELLO and another connection that sends CHLO after loading server
+ // config from the disk cache.
+ bool enable_connection_racing_;
+
// 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 port when

Powered by Google App Engine
This is Rietveld 408576698