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

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: rebase, resolve conflict Created 5 years, 8 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_stream_factory_impl_job.h ('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 847c5540a4304db586688910ccd745d5d2abc0fd..068e17fc3edd8d01ee9f0c0f405a4cbb058b685a 100644
--- a/net/http/http_stream_factory_impl_job.cc
+++ b/net/http/http_stream_factory_impl_job.cc
@@ -295,6 +295,9 @@ void HttpStreamFactoryImpl::Job::OnStreamReadyCallback() {
DCHECK(stream_.get());
DCHECK(!IsPreconnecting());
DCHECK(!stream_factory_->for_websockets_);
+
+ MaybeCopyConnectionAttemptsFromClientSocketHandleToRequest();
+
if (IsOrphaned()) {
stream_factory_->OnOrphanedJobComplete(this);
} else {
@@ -315,6 +318,9 @@ void HttpStreamFactoryImpl::Job::OnWebSocketHandshakeStreamReadyCallback() {
// An orphaned WebSocket job will be closed immediately and
// never be ready.
DCHECK(!IsOrphaned());
+
+ MaybeCopyConnectionAttemptsFromClientSocketHandleToRequest();
+
request_->Complete(was_npn_negotiated(),
protocol_negotiated(),
using_spdy(),
@@ -335,6 +341,8 @@ void HttpStreamFactoryImpl::Job::OnNewSpdySessionReadyCallback() {
base::WeakPtr<SpdySession> spdy_session = new_spdy_session_;
new_spdy_session_.reset();
+ MaybeCopyConnectionAttemptsFromClientSocketHandleToRequest();
+
// TODO(jgraettinger): Notify the factory, and let that notify |request_|,
// rather than notifying |request_| directly.
if (IsOrphaned()) {
@@ -353,6 +361,9 @@ void HttpStreamFactoryImpl::Job::OnNewSpdySessionReadyCallback() {
void HttpStreamFactoryImpl::Job::OnStreamFailedCallback(int result) {
DCHECK(!IsPreconnecting());
+
+ MaybeCopyConnectionAttemptsFromClientSocketHandleToRequest();
+
if (IsOrphaned())
stream_factory_->OnOrphanedJobComplete(this);
else
@@ -363,6 +374,9 @@ void HttpStreamFactoryImpl::Job::OnStreamFailedCallback(int result) {
void HttpStreamFactoryImpl::Job::OnCertificateErrorCallback(
int result, const SSLInfo& ssl_info) {
DCHECK(!IsPreconnecting());
+
+ MaybeCopyConnectionAttemptsFromClientSocketHandleToRequest();
+
if (IsOrphaned())
stream_factory_->OnOrphanedJobComplete(this);
else
@@ -1477,4 +1491,12 @@ HttpStreamFactoryImpl::Job::GetSocketGroup() const {
return ClientSocketPoolManager::NORMAL_GROUP;
}
+void HttpStreamFactoryImpl::Job::
+ MaybeCopyConnectionAttemptsFromClientSocketHandleToRequest() {
+ if (IsOrphaned() || !connection_)
+ return;
+
+ request_->AddConnectionAttempts(connection_->connection_attempts());
+}
+
} // namespace net
« no previous file with comments | « net/http/http_stream_factory_impl_job.h ('k') | net/http/http_stream_factory_impl_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698