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

Unified Diff: net/http/http_stream_factory_impl_job.cc

Issue 2771263002: Retry upon 421 status code without IP pooling. (Closed)
Patch Set: 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.cc
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc
index d50d24fe13707a6db60bb9cf4537ce6273b2a6aa..725756460ba16c111fe1e1a6dee6c2c234b64d5a 100644
--- a/net/http/http_stream_factory_impl_job.cc
+++ b/net/http/http_stream_factory_impl_job.cc
@@ -170,6 +170,7 @@ HttpStreamFactoryImpl::Job::Job(Delegate* delegate,
const SSLConfig& proxy_ssl_config,
HostPortPair destination,
GURL origin_url,
+ bool enable_ip_based_pooling,
NetLog* net_log)
: Job(delegate,
job_type,
@@ -182,6 +183,7 @@ HttpStreamFactoryImpl::Job::Job(Delegate* delegate,
origin_url,
AlternativeService(),
ProxyServer(),
+ enable_ip_based_pooling,
net_log) {}
HttpStreamFactoryImpl::Job::Job(Delegate* delegate,
@@ -195,6 +197,7 @@ HttpStreamFactoryImpl::Job::Job(Delegate* delegate,
GURL origin_url,
AlternativeService alternative_service,
const ProxyServer& alternative_proxy_server,
+ bool enable_ip_based_pooling,
NetLog* net_log)
: request_info_(request_info),
priority_(priority),
@@ -211,6 +214,7 @@ HttpStreamFactoryImpl::Job::Job(Delegate* delegate,
origin_url_(origin_url),
alternative_service_(alternative_service),
alternative_proxy_server_(alternative_proxy_server),
+ enable_ip_based_pooling_(enable_ip_based_pooling),
delegate_(delegate),
job_type_(job_type),
using_ssl_(false),
@@ -536,14 +540,14 @@ int HttpStreamFactoryImpl::Job::OnHostResolution(
SpdySessionPool* spdy_session_pool,
const SpdySessionKey& spdy_session_key,
const GURL& origin_url,
+ bool enable_ip_based_pooling,
const AddressList& addresses,
const NetLogWithSource& net_log) {
// It is OK to dereference spdy_session_pool, because the
// ClientSocketPoolManager will be destroyed in the same callback that
// destroys the SpdySessionPool.
return spdy_session_pool->FindAvailableSession(
- spdy_session_key, origin_url, /* enable_ip_based_pooling = */ true,
- net_log)
+ spdy_session_key, origin_url, enable_ip_based_pooling, net_log)
Zhongyi Shi 2017/03/29 03:05:06 I thought we could just use the enable_ip_based_po
Bence 2017/03/29 16:46:08 Yes, this method is static. That's why |spdy_sess
Zhongyi Shi 2017/03/30 22:33:02 Acknowledged. I see, I didn't realize it's a stati
? ERR_SPDY_SESSION_ALREADY_EXISTS
: OK;
}
@@ -953,8 +957,7 @@ int HttpStreamFactoryImpl::Job::DoInitConnectionImpl() {
if (CanUseExistingSpdySession()) {
base::WeakPtr<SpdySession> spdy_session =
session_->spdy_session_pool()->FindAvailableSession(
- spdy_session_key, origin_url_, /* enable_ip_based_pooling = */ true,
- net_log_);
+ spdy_session_key, origin_url_, enable_ip_based_pooling_, net_log_);
if (spdy_session) {
// If we're preconnecting, but we already have a SpdySession, we don't
// actually need to preconnect any sockets, so we're done.
@@ -1001,7 +1004,7 @@ int HttpStreamFactoryImpl::Job::DoInitConnectionImpl() {
OnHostResolutionCallback resolution_callback =
CanUseExistingSpdySession()
? base::Bind(&Job::OnHostResolution, session_->spdy_session_pool(),
- spdy_session_key, origin_url_)
+ spdy_session_key, origin_url_, enable_ip_based_pooling_)
Zhongyi Shi 2017/03/29 03:05:06 ditto
Bence 2017/03/29 16:46:08 ditto
: OnHostResolutionCallback();
if (delegate_->for_websockets()) {
// TODO(ricea): Re-enable NPN when WebSockets over SPDY is supported.
@@ -1036,8 +1039,7 @@ int HttpStreamFactoryImpl::Job::DoInitConnectionComplete(int result) {
SpdySessionKey spdy_session_key = GetSpdySessionKey();
existing_spdy_session_ =
session_->spdy_session_pool()->FindAvailableSession(
- spdy_session_key, origin_url_,
- /* enable_ip_based_pooling = */ true, net_log_);
+ spdy_session_key, origin_url_, enable_ip_based_pooling_, net_log_);
if (existing_spdy_session_) {
using_spdy_ = true;
next_state_ = STATE_CREATE_STREAM;
@@ -1249,8 +1251,7 @@ int HttpStreamFactoryImpl::Job::DoCreateStream() {
if (!existing_spdy_session_) {
existing_spdy_session_ =
session_->spdy_session_pool()->FindAvailableSession(
- spdy_session_key, origin_url_,
- /* enable_ip_based_pooling = */ true, net_log_);
+ spdy_session_key, origin_url_, enable_ip_based_pooling_, net_log_);
}
bool direct = !IsHttpsProxyAndHttpUrl();
if (existing_spdy_session_.get()) {

Powered by Google App Engine
This is Rietveld 408576698