Chromium Code Reviews| Index: net/http/http_stream_factory_impl_job_controller.cc |
| diff --git a/net/http/http_stream_factory_impl_job_controller.cc b/net/http/http_stream_factory_impl_job_controller.cc |
| index 0bb08374dc8e90f0946600b1767183bc6d0f53c6..5a3616a1f07e3b58bed2a112c5b732c1cb38bdef 100644 |
| --- a/net/http/http_stream_factory_impl_job_controller.cc |
| +++ b/net/http/http_stream_factory_impl_job_controller.cc |
| @@ -28,6 +28,9 @@ |
| namespace net { |
| +// The max time to delay the main job if is delayed TCP case. |
|
Ryan Hamilton
2017/02/15 22:26:55
nit: // The maximum time to wait for the alternate
Zhongyi Shi
2017/02/15 23:32:33
Done.
|
| +const base::TimeDelta kMaxDelayTimeForMainJob = base::TimeDelta::FromSeconds(3); |
|
Ryan Hamilton
2017/02/15 22:26:55
Alas, this is a static initializer which is prohib
Zhongyi Shi
2017/02/15 23:32:33
Done.
|
| + |
| std::unique_ptr<base::Value> NetLogJobControllerCallback( |
| const GURL* url, |
| bool is_preconnect, |
| @@ -659,8 +662,10 @@ const NetLogWithSource* HttpStreamFactoryImpl::JobController::GetNetLog( |
| void HttpStreamFactoryImpl::JobController::MaybeSetWaitTimeForMainJob( |
| const base::TimeDelta& delay) { |
| - if (main_job_is_blocked_) |
| - main_job_wait_time_ = delay; |
| + if (main_job_is_blocked_) { |
| + main_job_wait_time_ = |
| + delay > kMaxDelayTimeForMainJob ? kMaxDelayTimeForMainJob : delay; |
|
Ryan Hamilton
2017/02/15 22:26:55
can you do:
main_job_wait_time_ = std::min(delay
Zhongyi Shi
2017/02/15 23:32:33
Done.
|
| + } |
| } |
| bool HttpStreamFactoryImpl::JobController::HasPendingMainJob() const { |