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

Unified Diff: net/http/http_stream_factory_impl_job.cc

Issue 208663003: Revert of Fix SPDY error-handling if the connection gets closed just after use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « net/http/http_proxy_client_socket_pool.cc ('k') | net/http/http_stream_factory_impl_request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e4bfacd9945904af026b544a76c958e2274548a3..8d864f54ea81146607f634496c5612fdc0e59972 100644
--- a/net/http/http_stream_factory_impl_job.cc
+++ b/net/http/http_stream_factory_impl_job.cc
@@ -334,23 +334,20 @@
}
void HttpStreamFactoryImpl::Job::OnNewSpdySessionReadyCallback() {
- DCHECK(stream_.get());
+ DCHECK(!stream_.get());
DCHECK(!IsPreconnecting());
DCHECK(using_spdy());
- // Note: an event loop iteration has passed, so |new_spdy_session_| may be
- // NULL at this point if the SpdySession closed immediately after creation.
+ if (!new_spdy_session_)
+ return;
base::WeakPtr<SpdySession> spdy_session = new_spdy_session_;
new_spdy_session_.reset();
if (IsOrphaned()) {
- if (spdy_session) {
- stream_factory_->OnNewSpdySessionReady(
- spdy_session, spdy_session_direct_, server_ssl_config_, proxy_info_,
- was_npn_negotiated(), protocol_negotiated(), using_spdy(), net_log_);
- }
+ stream_factory_->OnNewSpdySessionReady(
+ spdy_session, spdy_session_direct_, server_ssl_config_, proxy_info_,
+ was_npn_negotiated(), protocol_negotiated(), using_spdy(), net_log_);
stream_factory_->OnOrphanedJobComplete(this);
} else {
- request_->OnNewSpdySessionReady(
- this, stream_.Pass(), spdy_session, spdy_session_direct_);
+ request_->OnNewSpdySessionReady(this, spdy_session, spdy_session_direct_);
}
// |this| may be deleted after this call.
}
@@ -1125,27 +1122,21 @@
SpdySessionPool* spdy_pool = session_->spdy_session_pool();
spdy_session = spdy_pool->FindAvailableSession(spdy_session_key, net_log_);
if (!spdy_session) {
- new_spdy_session_ =
+ int error =
spdy_pool->CreateAvailableSessionFromSocket(spdy_session_key,
connection_.Pass(),
net_log_,
spdy_certificate_error_,
+ &new_spdy_session_,
using_ssl_);
+ if (error != OK)
+ return error;
const HostPortPair& host_port_pair = spdy_session_key.host_port_pair();
base::WeakPtr<HttpServerProperties> http_server_properties =
session_->http_server_properties();
if (http_server_properties)
http_server_properties->SetSupportsSpdy(host_port_pair, true);
spdy_session_direct_ = direct;
-
- // Create a SpdyHttpStream attached to the session;
- // OnNewSpdySessionReadyCallback is not called until an event loop
- // iteration later, so if the SpdySession is closed between then, allow
- // reuse state from the underlying socket, sampled by SpdyHttpStream,
- // bubble up to the request.
- bool use_relative_url = direct || request_info_.url.SchemeIs("https");
- stream_.reset(new SpdyHttpStream(new_spdy_session_, use_relative_url));
-
return OK;
}
}
« no previous file with comments | « net/http/http_proxy_client_socket_pool.cc ('k') | net/http/http_stream_factory_impl_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698