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

Unified Diff: net/http/http_stream_factory_impl_job.cc

Issue 1096203006: Collect all ConnectionAttempts from both sockets in TransportConnectJob. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@domrel_serverip1
Patch Set: Document why Do*ConnectComplete don't delete other socket Created 5 years, 7 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 57148a71da61bf9fa5f99521f3d690240fe2e0df..e25915a45e67be1e1c96c71d7db221cd94a0ecd9 100644
--- a/net/http/http_stream_factory_impl_job.cc
+++ b/net/http/http_stream_factory_impl_job.cc
@@ -296,7 +296,7 @@ void HttpStreamFactoryImpl::Job::OnStreamReadyCallback() {
DCHECK(!IsPreconnecting());
DCHECK(!stream_factory_->for_websockets_);
- MaybeCopyConnectionAttemptsFromClientSocketHandleToRequest();
+ MaybeCopyConnectionAttempts();
if (IsOrphaned()) {
stream_factory_->OnOrphanedJobComplete(this);
@@ -319,7 +319,7 @@ void HttpStreamFactoryImpl::Job::OnWebSocketHandshakeStreamReadyCallback() {
// never be ready.
DCHECK(!IsOrphaned());
- MaybeCopyConnectionAttemptsFromClientSocketHandleToRequest();
+ MaybeCopyConnectionAttempts();
request_->Complete(was_npn_negotiated(),
protocol_negotiated(),
@@ -341,7 +341,7 @@ void HttpStreamFactoryImpl::Job::OnNewSpdySessionReadyCallback() {
base::WeakPtr<SpdySession> spdy_session = new_spdy_session_;
new_spdy_session_.reset();
- MaybeCopyConnectionAttemptsFromClientSocketHandleToRequest();
+ MaybeCopyConnectionAttempts();
// TODO(jgraettinger): Notify the factory, and let that notify |request_|,
// rather than notifying |request_| directly.
@@ -362,7 +362,7 @@ void HttpStreamFactoryImpl::Job::OnNewSpdySessionReadyCallback() {
void HttpStreamFactoryImpl::Job::OnStreamFailedCallback(int result) {
DCHECK(!IsPreconnecting());
- MaybeCopyConnectionAttemptsFromClientSocketHandleToRequest();
+ MaybeCopyConnectionAttempts();
if (IsOrphaned())
stream_factory_->OnOrphanedJobComplete(this);
@@ -375,7 +375,7 @@ void HttpStreamFactoryImpl::Job::OnCertificateErrorCallback(
int result, const SSLInfo& ssl_info) {
DCHECK(!IsPreconnecting());
- MaybeCopyConnectionAttemptsFromClientSocketHandleToRequest();
+ MaybeCopyConnectionAttempts();
if (IsOrphaned())
stream_factory_->OnOrphanedJobComplete(this);
@@ -1512,12 +1512,17 @@ HttpStreamFactoryImpl::Job::GetSocketGroup() const {
return ClientSocketPoolManager::NORMAL_GROUP;
}
-void HttpStreamFactoryImpl::Job::
- MaybeCopyConnectionAttemptsFromClientSocketHandleToRequest() {
+void HttpStreamFactoryImpl::Job::MaybeCopyConnectionAttempts() {
Randy Smith (Not in Mondays) 2015/05/12 20:11:09 Is there any way the state machine would allow thi
Deprecated (see juliatuttle) 2015/05/13 18:22:29 It can be called twice if we do RestartWithAuth, b
if (IsOrphaned() || !connection_)
return;
- request_->AddConnectionAttempts(connection_->connection_attempts());
+ if (connection_->socket()) {
+ ConnectionAttempts socket_attempts;
+ connection_->socket()->GetConnectionAttempts(&socket_attempts);
+ request_->AddConnectionAttempts(socket_attempts);
+ } else {
+ request_->AddConnectionAttempts(connection_->connection_attempts());
+ }
}
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698