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

Unified Diff: net/http/http_stream_factory_impl.h

Issue 1952423002: JobController 2: Remove reference between HttpStreamFactoryImpl::Jobs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Job_Controller_1
Patch Set: sync to JobController1, and move DoWaitForJob to JobController Created 4 years, 7 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.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory_impl.h
diff --git a/net/http/http_stream_factory_impl.h b/net/http/http_stream_factory_impl.h
index 7ba87ca8706cae8af0f79781dd365c978c3d460c..ed89f31cff2417139288ee68c53dc4f81fdc630f 100644
--- a/net/http/http_stream_factory_impl.h
+++ b/net/http/http_stream_factory_impl.h
@@ -68,6 +68,44 @@ class NET_EXPORT_PRIVATE HttpStreamFactoryImpl : public HttpStreamFactory {
PRECONNECT,
};
+ enum State {
+ STATE_START,
+ STATE_RESOLVE_PROXY,
+ STATE_RESOLVE_PROXY_COMPLETE,
+
+ // Note that when Alternate-Protocol says we can connect to an alternate
+ // port using a different protocol, we have the choice of communicating over
+ // the original protocol, or speaking the alternate protocol (currently,
+ // only npn-spdy) over an alternate port. For a cold page load, the http
+ // connection that delivers the http response that has the
+ // Alternate-Protocol header will already be warm. So, blocking the next
+ // http request on establishing a new npn-spdy connection would incur extra
+ // latency. Even if the http connection was not reused, establishing a new
+ // http connection is typically faster than npn-spdy, since npn-spdy
+ // requires a SSL handshake. Therefore, we start both the http and the
+ // npn-spdy jobs in parallel. In order not to unnecessarily waste sockets,
+ // we have the http job block on the npn-spdy job after proxy resolution.
+ // The npn-spdy job will Resume() the http job if, in
+ // STATE_INIT_CONNECTION_COMPLETE, it detects an error or does not find an
+ // existing SpdySession. In that case, the http and npn-spdy jobs will race.
+ // When QUIC protocol is used by the npn-spdy job, then http job will wait
+ // for |wait_time_| when the http job was resumed.
+ STATE_WAIT_FOR_JOB,
+ STATE_WAIT_FOR_JOB_COMPLETE,
+
+ STATE_INIT_CONNECTION,
+ STATE_INIT_CONNECTION_COMPLETE,
+ STATE_WAITING_USER_ACTION,
+ STATE_RESTART_TUNNEL_AUTH,
+ STATE_RESTART_TUNNEL_AUTH_COMPLETE,
+ STATE_CREATE_STREAM,
+ STATE_CREATE_STREAM_COMPLETE,
+ STATE_DRAIN_BODY_FOR_AUTH_RESTART,
+ STATE_DRAIN_BODY_FOR_AUTH_RESTART_COMPLETE,
+ STATE_DONE,
+ STATE_NONE
+ };
+
private:
FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryImplRequestTest, SetPriority);
FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryImplRequestTest, DelayMainJob);
« no previous file with comments | « no previous file | net/http/http_stream_factory_impl_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698