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

Unified Diff: net/http/http_stream_factory_impl_job.cc

Issue 1006643002: Plumb connection attempts from (non-proxy) ConnectJobs to HttpNetworkTransaction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Plumb up to HttpNetworkTransaction Created 5 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 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

Powered by Google App Engine
This is Rietveld 408576698