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

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: 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 | no next file » | 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..34b76a77b6f46eebe008ecae06520804fa31c9cb 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,16 @@ 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())) {
mmenke 2017/01/12 22:46:48 DCHECK(alternative_job_)? (If alternate_job_ is r
Zhongyi Shi 2017/01/12 23:17:50 Done. bound_job_ will only be reset to nullptr whe
+ main_job_.reset();
+ } else {
+ main_job_->Orphan();
xunjieli 2017/01/12 23:00:32 Should HttpStreamFactoryImpl::Job::Orphan() also c
xunjieli 2017/01/12 23:04:30 Think that the old code calls OnOrphanedJobComplet
Zhongyi Shi 2017/01/12 23:17:50 For non-websockets case, the Job will continue con
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698