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

Unified Diff: net/http/http_stream_factory_impl_job_controller.cc

Issue 2707583002: Revert of Resume the main job immediately when QUIC job fails, not wait for the head start timer to exprie (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
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..052a17e3da2ab5a6d5a396109eb900c3d88ba903 100644
--- a/net/http/http_stream_factory_impl_job_controller.cc
+++ b/net/http/http_stream_factory_impl_job_controller.cc
@@ -50,7 +50,6 @@
alternative_job_failed_(false),
job_bound_(false),
main_job_is_blocked_(false),
- main_job_is_resumed_(false),
bound_job_(nullptr),
can_start_alternative_proxy_job_(false),
ptr_factory_(this) {
@@ -517,10 +516,6 @@
}
void HttpStreamFactoryImpl::JobController::ResumeMainJob() {
- if (main_job_is_resumed_)
- return;
-
- main_job_is_resumed_ = true;
main_job_->net_log().AddEvent(
NetLogEventType::HTTP_STREAM_JOB_DELAYED,
base::Bind(&NetLogHttpStreamJobDelayCallback, main_job_wait_time_));
@@ -532,24 +527,15 @@
void HttpStreamFactoryImpl::JobController::MaybeResumeMainJob(
Job* job,
const base::TimeDelta& delay) {
- DCHECK(delay == base::TimeDelta() || delay == main_job_wait_time_);
DCHECK(job == main_job_.get() || job == alternative_job_.get());
- if (job != alternative_job_.get() || !main_job_)
+ if (!main_job_is_blocked_ || job != alternative_job_.get() || !main_job_)
return;
main_job_is_blocked_ = false;
- if (!main_job_->is_waiting()) {
- // There are two cases where the main job is not in WAIT state:
- // 1) The main job hasn't got to waiting state, do not yet post a task to
- // resume since that will happen in ShouldWait().
- // 2) The main job has passed waiting state, so the main job does not need
- // to be resumed.
- return;
- }
-
- main_job_wait_time_ = delay;
+ if (!main_job_->is_waiting())
+ return;
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE,
« no previous file with comments | « net/http/http_stream_factory_impl_job_controller.h ('k') | 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