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

Unified Diff: net/http/http_stream_factory_impl_job_controller.cc

Issue 2784143003: Fix a potential infinite loop in HttpStreamFactoryImpl when a new SpdySession is established (Closed)
Patch Set: rebased Created 3 years, 9 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 ba5e01bb2884ce41cd666d6aaab39e58118bda82..4c6ac8f109c102f7b77aa6a2b53b9e9ab3e15388 100644
--- a/net/http/http_stream_factory_impl_job_controller.cc
+++ b/net/http/http_stream_factory_impl_job_controller.cc
@@ -640,23 +640,7 @@ void HttpStreamFactoryImpl::JobController::
return;
DCHECK(request_);
- RemoveRequestFromSpdySessionRequestMap();
-}
-
-void HttpStreamFactoryImpl::JobController::
- RemoveRequestFromSpdySessionRequestMap() {
- const SpdySessionKey* spdy_session_key = request_->spdy_session_key();
- if (spdy_session_key) {
- SpdySessionRequestMap& spdy_session_request_map =
- factory_->spdy_session_request_map_;
- DCHECK(base::ContainsKey(spdy_session_request_map, *spdy_session_key));
- RequestSet& request_set = spdy_session_request_map[*spdy_session_key];
- DCHECK(base::ContainsKey(request_set, request_));
- request_set.erase(request_);
- if (request_set.empty())
- spdy_session_request_map.erase(*spdy_session_key);
- request_->ResetSpdySessionKey();
- }
+ factory_->RemoveRequestFromSpdySessionRequestMap(request_);
}
const NetLogWithSource* HttpStreamFactoryImpl::JobController::GetNetLog(
@@ -773,7 +757,7 @@ void HttpStreamFactoryImpl::JobController::BindJob(Job* job) {
void HttpStreamFactoryImpl::JobController::CancelJobs() {
DCHECK(request_);
- RemoveRequestFromSpdySessionRequestMap();
+ factory_->RemoveRequestFromSpdySessionRequestMap(request_);
if (job_bound_)
return;
if (alternative_job_) {
@@ -788,7 +772,7 @@ void HttpStreamFactoryImpl::JobController::CancelJobs() {
void HttpStreamFactoryImpl::JobController::OrphanUnboundJob() {
DCHECK(request_);
- RemoveRequestFromSpdySessionRequestMap();
+ factory_->RemoveRequestFromSpdySessionRequestMap(request_);
DCHECK(bound_job_);
if (bound_job_->job_type() == MAIN && alternative_job_) {

Powered by Google App Engine
This is Rietveld 408576698