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

Unified Diff: net/http/http_stream_factory_impl_job.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 | « net/http/http_stream_factory_impl.h ('k') | 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 0ed706b6200472bb549bbd0905138275a85bedf3..9c1c320660990c5ce1d8ccdcc220ad416610e731 100644
--- a/net/http/http_stream_factory_impl_job.h
+++ b/net/http/http_stream_factory_impl_job.h
@@ -81,14 +81,11 @@ class HttpStreamFactoryImpl::Job {
int RestartTunnelWithProxyAuth(const AuthCredentials& credentials);
LoadState GetLoadState() const;
- // Tells |this| to wait for |job| to resume it.
- void WaitFor(Job* job);
-
// Tells |this| that |job| has determined it still needs to continue
// connecting, so allow |this| to continue after the specified |delay|. If
// this is not called, then |request_| is expected to cancel |this| by
// deleting it.
- void Resume(Job* job, const base::TimeDelta& delay);
+ void Resume(const base::TimeDelta& delay);
// Used to detach the Job.
void Orphan();
@@ -116,52 +113,21 @@ class HttpStreamFactoryImpl::Job {
// will be orphaned.
void ReportJobSucceededForRequest();
+ // Resume the |this| job after the specified |wait_time_|.
+ void ResumeAfterDelay();
+
// Marks that the other |job| has completed.
void MarkOtherJobComplete(const Job& job);
+ void SetNextState(State state) { next_state_ = state; }
+
JobType job_type() const { return job_type_; }
+ base::TimeDelta wait_time() const { return wait_time_; }
+
private:
FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryImplRequestTest, DelayMainJob);
- 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
- };
-
enum JobStatus {
STATUS_RUNNING,
STATUS_FAILED,
@@ -214,9 +180,6 @@ class HttpStreamFactoryImpl::Job {
const bool is_spdy_alternative_;
};
- // Resume the |this| job after the specified |wait_time_|.
- void ResumeAfterDelay();
-
void OnStreamReadyCallback();
void OnBidirectionalStreamImplReadyCallback();
void OnWebSocketHandshakeStreamReadyCallback();
@@ -243,7 +206,6 @@ class HttpStreamFactoryImpl::Job {
int DoStart();
int DoResolveProxy();
int DoResolveProxyComplete(int result);
- int DoWaitForJob();
int DoWaitForJobComplete(int result);
int DoInitConnection();
int DoInitConnectionComplete(int result);
@@ -360,15 +322,6 @@ class HttpStreamFactoryImpl::Job {
JobType job_type_;
- // This is the Job we're dependent on. It will notify us if/when it's OK to
- // proceed.
- Job* blocking_job_;
-
- // |waiting_job_| is a Job waiting to see if |this| can reuse a connection.
- // If |this| is unable to do so, we'll notify |waiting_job_| that it's ok to
- // proceed and then race the two Jobs.
- Job* waiting_job_;
-
base::TimeDelta wait_time_;
// True if handling a HTTPS request, or using SPDY with SSL
« no previous file with comments | « net/http/http_stream_factory_impl.h ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698