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

Unified Diff: net/http/http_stream_factory_impl_job_controller.cc

Issue 2690393005: Cap the delay time for the main job when racing with QUIC for delayed (Closed)
Patch Set: add comments Created 3 years, 10 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
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 {

Powered by Google App Engine
This is Rietveld 408576698