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

Unified Diff: net/http/http_stream_factory_impl_job_controller.cc

Issue 2625133006: Move the logic to cancel main job in OrphanUnboundJob when the alt job succeed while main job is bl… (Closed)
Patch Set: fix test Created 3 years, 11 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 c72fd3db7148254fa21964d411d9c5f363b138f9..052a17e3da2ab5a6d5a396109eb900c3d88ba903 100644
--- a/net/http/http_stream_factory_impl_job_controller.cc
+++ b/net/http/http_stream_factory_impl_job_controller.cc
@@ -152,13 +152,6 @@ void HttpStreamFactoryImpl::JobController::OnRequestComplete() {
} else {
DCHECK(bound_job_->job_type() == ALTERNATIVE);
alternative_job_.reset();
- // If ResumeMainJob() is not executed, reset |main_job_|. Otherwise,
- // OnOrphanedJobComplete() will clean up |this| when the job completes.
- // Use |main_job_is_blocked_| and |!main_job_wait_time_.is_zero()| instead
- // of |main_job_|->is_waiting() because |main_job_| can be in proxy
- // resolution step.
- if (main_job_ && (main_job_is_blocked_ || !main_job_wait_time_.is_zero()))
- main_job_.reset();
}
bound_job_ = nullptr;
}
@@ -743,7 +736,17 @@ void HttpStreamFactoryImpl::JobController::OrphanUnboundJob() {
} else if (bound_job_->job_type() == ALTERNATIVE && main_job_) {
// Orphan main job.
factory_->request_map_.erase(main_job_.get());
- main_job_->Orphan();
+ // If ResumeMainJob() is not executed, reset |main_job_|. Otherwise,
+ // OnOrphanedJobComplete() will clean up |this| when the job completes.
+ // Use |main_job_is_blocked_| and |!main_job_wait_time_.is_zero()| instead
+ // of |main_job_|->is_waiting() because |main_job_| can be in proxy
+ // resolution step.
+ if (main_job_ && (main_job_is_blocked_ || !main_job_wait_time_.is_zero())) {
+ DCHECK(alternative_job_);
+ main_job_.reset();
+ } else {
+ main_job_->Orphan();
+ }
}
}
« 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