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 f9f6e39883934a6fea57ac53b78702783f21fc26..4ff8fbd9486de0a288a37748c174b46990f23c76 100644 |
--- a/net/http/http_stream_factory_impl_job.cc |
+++ b/net/http/http_stream_factory_impl_job.cc |
@@ -297,6 +297,9 @@ void HttpStreamFactoryImpl::Job::OnStreamReadyCallback() { |
DCHECK(stream_.get()); |
DCHECK(!IsPreconnecting()); |
DCHECK(!stream_factory_->for_websockets_); |
+ |
+ MaybeAddConnectionAttempts(); |
+ |
if (IsOrphaned()) { |
stream_factory_->OnOrphanedJobComplete(this); |
} else { |
@@ -317,6 +320,9 @@ void HttpStreamFactoryImpl::Job::OnWebSocketHandshakeStreamReadyCallback() { |
// An orphaned WebSocket job will be closed immediately and |
// never be ready. |
DCHECK(!IsOrphaned()); |
+ |
+ MaybeAddConnectionAttempts(); |
+ |
request_->Complete(was_npn_negotiated(), |
protocol_negotiated(), |
using_spdy(), |
@@ -337,6 +343,8 @@ void HttpStreamFactoryImpl::Job::OnNewSpdySessionReadyCallback() { |
base::WeakPtr<SpdySession> spdy_session = new_spdy_session_; |
new_spdy_session_.reset(); |
+ MaybeAddConnectionAttempts(); |
+ |
// TODO(jgraettinger): Notify the factory, and let that notify |request_|, |
// rather than notifying |request_| directly. |
if (IsOrphaned()) { |
@@ -355,6 +363,9 @@ void HttpStreamFactoryImpl::Job::OnNewSpdySessionReadyCallback() { |
void HttpStreamFactoryImpl::Job::OnStreamFailedCallback(int result) { |
DCHECK(!IsPreconnecting()); |
+ |
+ MaybeAddConnectionAttempts(); |
+ |
if (IsOrphaned()) |
stream_factory_->OnOrphanedJobComplete(this); |
else |
@@ -365,6 +376,9 @@ void HttpStreamFactoryImpl::Job::OnStreamFailedCallback(int result) { |
void HttpStreamFactoryImpl::Job::OnCertificateErrorCallback( |
int result, const SSLInfo& ssl_info) { |
DCHECK(!IsPreconnecting()); |
+ |
+ MaybeAddConnectionAttempts(); |
+ |
if (IsOrphaned()) |
stream_factory_->OnOrphanedJobComplete(this); |
else |
@@ -1508,4 +1522,11 @@ void HttpStreamFactoryImpl::Job::MaybeMarkAlternateProtocolBroken() { |
} |
} |
+void HttpStreamFactoryImpl::Job::MaybeAddConnectionAttempts() { |
+ if (IsOrphaned() || !connection_) |
+ return; |
+ |
+ request_->AddConnectionAttempts(connection_->connection_attempts()); |
+} |
+ |
} // namespace net |