Chromium Code Reviews| 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 7341379f7b29ceddcacded52046b597099728b92..6980d820cc38d97fac3f141b2513de69fd6216fb 100644 |
| --- a/net/http/http_stream_factory_impl_job.h |
| +++ b/net/http/http_stream_factory_impl_job.h |
| @@ -42,6 +42,7 @@ class HttpStreamFactoryImpl::Job { |
| public: |
| // Constructor for non-alternative Job. |
| Job(JobController* job_controller, |
| + JobType job_type, |
| HttpNetworkSession* session, |
| const HttpRequestInfo& request_info, |
| RequestPriority priority, |
| @@ -52,6 +53,7 @@ class HttpStreamFactoryImpl::Job { |
| NetLog* net_log); |
| // Constructor for alternative Job. |
| Job(JobController* job_controller, |
| + JobType job_type, |
| HttpNetworkSession* session, |
| const HttpRequestInfo& request_info, |
| RequestPriority priority, |
| @@ -74,14 +76,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 from |request|. |
| void Orphan(const Request* request); |
| @@ -102,8 +101,8 @@ class HttpStreamFactoryImpl::Job { |
| // Indicates whether or not this job is performing a preconnect. |
| bool IsPreconnecting() const; |
| - // Indicates whether or not this Job has been orphaned by a Request. |
| - bool IsOrphaned() const { return orphaned_; }; |
| + // Indicates whether or not this job has been orphaned by a Request. |
| + bool IsOrphaned() const { return orphaned_; } |
| // Called to indicate that this job succeeded, and some other jobs |
| // will be orphaned. |
| @@ -113,6 +112,8 @@ class HttpStreamFactoryImpl::Job { |
| void MarkOtherJobComplete(const Job& job); |
| private: |
| + friend class JobController; |
|
Ryan Hamilton
2016/05/06 21:33:14
Can we get away without this friendship?
Zhongyi Shi
2016/05/13 00:31:25
Done.
|
| + |
| FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryImplRequestTest, DelayMainJob); |
| enum State { |
| @@ -348,14 +349,7 @@ class HttpStreamFactoryImpl::Job { |
| JobController* job_controller_; |
| - // 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_; |
| + JobType job_type_; |
| base::TimeDelta wait_time_; |