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

Unified Diff: net/http/http_stream_factory_impl_job.cc

Issue 2595413002: Race preconnects to HTTP2 proxies that support alternate proxies
Patch Set: ps Created 4 years 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.cc
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc
index 731d4d2949516408a6cff7faeb8ee0a2f2a808d7..3a42001b2b3ae55556f656b557dd1862623c01ae 100644
--- a/net/http/http_stream_factory_impl_job.cc
+++ b/net/http/http_stream_factory_impl_job.cc
@@ -225,7 +225,7 @@ HttpStreamFactoryImpl::Job::Job(Delegate* delegate,
(job_type_ == ALTERNATIVE || job_type_ == PRECONNECT));
// If the alternative proxy server is valid, then the job type must be
// set to ALTERNATIVE.
- DCHECK(!alternative_proxy_server_.is_valid() || job_type_ == ALTERNATIVE);
+ DCHECK(!alternative_proxy_server_.is_valid() || job_type_ != MAIN);
if (IsSpdyAlternative()) {
DCHECK(origin_url_.SchemeIs(url::kHttpsScheme));
@@ -296,7 +296,7 @@ LoadState HttpStreamFactoryImpl::Job::GetLoadState() const {
}
void HttpStreamFactoryImpl::Job::Resume() {
- DCHECK_EQ(job_type_, MAIN);
+ DCHECK(job_type_ == MAIN || job_type_ == PRECONNECT);
DCHECK_EQ(next_state_, STATE_WAIT_COMPLETE);
OnIOComplete(OK);
}
@@ -322,6 +322,11 @@ void HttpStreamFactoryImpl::Job::SetPriority(RequestPriority priority) {
// preconnect state.
}
+void HttpStreamFactoryImpl::Job::RestrictNumStreamsToOne() {
+ DCHECK_EQ(PRECONNECT, job_type_);
+ num_streams_ = 1;
+}
+
bool HttpStreamFactoryImpl::Job::was_alpn_negotiated() const {
return was_alpn_negotiated_;
}

Powered by Google App Engine
This is Rietveld 408576698