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

Unified Diff: net/http/http_stream_factory_impl_job.cc

Issue 2595413002: Race preconnects to HTTP2 proxies that support alternate proxies
Patch Set: Rebased, rch comments 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
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 ca3652e917a6a663341d6c9a6d43b1ceea95e0f1..a4fd88e50094b22dcde773ae914157183ef81bdf 100644
--- a/net/http/http_stream_factory_impl_job.cc
+++ b/net/http/http_stream_factory_impl_job.cc
@@ -226,7 +226,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));
@@ -298,7 +298,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);
}
@@ -324,6 +324,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