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

Unified Diff: net/http/http_stream_factory_impl_job.h

Issue 2932513004: Throttle HttpStreamFactoryImpl::Job to HTTP/2-supported servers (Closed)
Patch Set: add a pair of braces Created 3 years, 6 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
« no previous file with comments | « no previous file | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory_impl_job.h
diff --git a/net/http/http_stream_factory_impl_job.h b/net/http/http_stream_factory_impl_job.h
index 80b9e5232856763409cf7969ca40a0db8035ebda..0c5b61bb922463ec2dc4ebb038ad957f272bf2cf 100644
--- a/net/http/http_stream_factory_impl_job.h
+++ b/net/http/http_stream_factory_impl_job.h
@@ -45,6 +45,11 @@ struct SSLConfig;
// created for the StreamFactory.
class HttpStreamFactoryImpl::Job {
public:
+ // For jobs issued simultaneously to an HTTP/2 supported server, a delay is
+ // applied to avoid unnecessary socket connection establishments.
+ // crbug.com/718576
+ static const int kHTTP2ThrottleMs = 300;
+
// Delegate to report Job's status to Request and HttpStreamFactory.
class NET_EXPORT_PRIVATE Delegate {
public:
@@ -264,6 +269,7 @@ class HttpStreamFactoryImpl::Job {
STATE_WAIT,
STATE_WAIT_COMPLETE,
+ STATE_EVALUATE_THROTTLE,
STATE_INIT_CONNECTION,
STATE_INIT_CONNECTION_COMPLETE,
STATE_WAITING_USER_ACTION,
@@ -308,6 +314,7 @@ class HttpStreamFactoryImpl::Job {
int DoStart();
int DoWait();
int DoWaitComplete(int result);
+ int DoEvaluateThrottle();
int DoInitConnection();
int DoInitConnectionComplete(int result);
int DoWaitingUserAction(int result);
@@ -316,6 +323,7 @@ class HttpStreamFactoryImpl::Job {
int DoRestartTunnelAuth();
int DoRestartTunnelAuthComplete(int result);
+ void ResumeInitConnection();
// Creates a SpdyHttpStream or a BidirectionalStreamImpl from the given values
// and sets to |stream_| or |bidirectional_stream_impl_| respectively. Does
// nothing if |stream_factory_| is for WebSockets.
@@ -479,6 +487,9 @@ class HttpStreamFactoryImpl::Job {
// Type of stream that is requested.
HttpStreamRequest::StreamType stream_type_;
+ // Whether Job has continued to DoInitConnection().
+ bool init_connection_already_resumed_;
+
base::WeakPtrFactory<Job> ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(Job);
« no previous file with comments | « no previous file | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698