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

Unified Diff: net/http/http_stream_factory_impl_job_controller.cc

Issue 2703943002: Cap the delay time for the main job when racing with QUIC for delayed tcp case so that if http_serv… (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | net/http/http_stream_factory_impl_job_controller_unittest.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_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 2e0dffb8b400b475fcb6e3c5233680fcdeaf8095..b9aa8a8132c319e4dd33f17e41c102b9ce15ba56 100644
--- a/net/http/http_stream_factory_impl_job_controller.cc
+++ b/net/http/http_stream_factory_impl_job_controller.cc
@@ -27,6 +27,10 @@
namespace net {
+// The maximum time to wait for the alternate job to complete before resuming
+// the main job.
+const int kMaxDelayTimeForMainJobSecs = 3;
+
// Returns parameters associated with the delay of the HTTP stream job.
std::unique_ptr<base::Value> NetLogHttpStreamJobDelayCallback(
base::TimeDelta delay,
@@ -638,8 +642,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_ = std::min(
+ delay, base::TimeDelta::FromSeconds(kMaxDelayTimeForMainJobSecs));
+ }
}
WebSocketHandshakeStreamBase::CreateHelper* HttpStreamFactoryImpl::
« no previous file with comments | « no previous file | net/http/http_stream_factory_impl_job_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698