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

Side by Side Diff: net/http/http_network_transaction.cc

Issue 344026: Add LoadLog to ClientSocket::Connect(). (Closed)
Patch Set: Minor build fixups and fixed mac bug. Created 11 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « net/ftp/ftp_network_transaction.cc ('k') | net/socket/client_socket.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include "base/scoped_ptr.h" 7 #include "base/scoped_ptr.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/field_trial.h" 9 #include "base/field_trial.h"
10 #include "base/histogram.h" 10 #include "base/histogram.h"
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 ClientSocket* s = connection_.release_socket(); 620 ClientSocket* s = connection_.release_socket();
621 HostResolver::RequestInfo req_info(request_->url.HostNoBrackets(), 621 HostResolver::RequestInfo req_info(request_->url.HostNoBrackets(),
622 request_->url.EffectiveIntPort()); 622 request_->url.EffectiveIntPort());
623 req_info.set_referrer(request_->referrer); 623 req_info.set_referrer(request_->referrer);
624 624
625 if (proxy_info_.proxy_server().scheme() == ProxyServer::SCHEME_SOCKS5) 625 if (proxy_info_.proxy_server().scheme() == ProxyServer::SCHEME_SOCKS5)
626 s = new SOCKS5ClientSocket(s, req_info, session_->host_resolver()); 626 s = new SOCKS5ClientSocket(s, req_info, session_->host_resolver());
627 else 627 else
628 s = new SOCKSClientSocket(s, req_info, session_->host_resolver()); 628 s = new SOCKSClientSocket(s, req_info, session_->host_resolver());
629 connection_.set_socket(s); 629 connection_.set_socket(s);
630 return connection_.socket()->Connect(&io_callback_); 630 return connection_.socket()->Connect(&io_callback_, load_log_);
631 } 631 }
632 632
633 int HttpNetworkTransaction::DoSOCKSConnectComplete(int result) { 633 int HttpNetworkTransaction::DoSOCKSConnectComplete(int result) {
634 DCHECK_EQ(kSOCKSProxy, proxy_mode_); 634 DCHECK_EQ(kSOCKSProxy, proxy_mode_);
635 635
636 if (result == OK) { 636 if (result == OK) {
637 if (using_ssl_) { 637 if (using_ssl_) {
638 next_state_ = STATE_SSL_CONNECT; 638 next_state_ = STATE_SSL_CONNECT;
639 } else { 639 } else {
640 next_state_ = STATE_SEND_REQUEST; 640 next_state_ = STATE_SEND_REQUEST;
(...skipping 10 matching lines...) Expand all
651 if (request_->load_flags & LOAD_VERIFY_EV_CERT) 651 if (request_->load_flags & LOAD_VERIFY_EV_CERT)
652 ssl_config_.verify_ev_cert = true; 652 ssl_config_.verify_ev_cert = true;
653 653
654 ssl_connect_start_time_ = base::TimeTicks::Now(); 654 ssl_connect_start_time_ = base::TimeTicks::Now();
655 655
656 // Add a SSL socket on top of our existing transport socket. 656 // Add a SSL socket on top of our existing transport socket.
657 ClientSocket* s = connection_.release_socket(); 657 ClientSocket* s = connection_.release_socket();
658 s = session_->socket_factory()->CreateSSLClientSocket( 658 s = session_->socket_factory()->CreateSSLClientSocket(
659 s, request_->url.HostNoBrackets(), ssl_config_); 659 s, request_->url.HostNoBrackets(), ssl_config_);
660 connection_.set_socket(s); 660 connection_.set_socket(s);
661 return connection_.socket()->Connect(&io_callback_); 661 return connection_.socket()->Connect(&io_callback_, load_log_);
662 } 662 }
663 663
664 int HttpNetworkTransaction::DoSSLConnectComplete(int result) { 664 int HttpNetworkTransaction::DoSSLConnectComplete(int result) {
665 if (IsCertificateError(result)) 665 if (IsCertificateError(result))
666 result = HandleCertificateError(result); 666 result = HandleCertificateError(result);
667 667
668 if (result == OK) { 668 if (result == OK) {
669 DCHECK(ssl_connect_start_time_ != base::TimeTicks()); 669 DCHECK(ssl_connect_start_time_ != base::TimeTicks());
670 base::TimeDelta connect_duration = 670 base::TimeDelta connect_duration =
671 base::TimeTicks::Now() - ssl_connect_start_time_; 671 base::TimeTicks::Now() - ssl_connect_start_time_;
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1662 AuthChallengeInfo* auth_info = new AuthChallengeInfo; 1662 AuthChallengeInfo* auth_info = new AuthChallengeInfo;
1663 auth_info->is_proxy = target == HttpAuth::AUTH_PROXY; 1663 auth_info->is_proxy = target == HttpAuth::AUTH_PROXY;
1664 auth_info->host_and_port = ASCIIToWide(GetHostAndPort(auth_origin)); 1664 auth_info->host_and_port = ASCIIToWide(GetHostAndPort(auth_origin));
1665 auth_info->scheme = ASCIIToWide(auth_handler_[target]->scheme()); 1665 auth_info->scheme = ASCIIToWide(auth_handler_[target]->scheme());
1666 // TODO(eroman): decode realm according to RFC 2047. 1666 // TODO(eroman): decode realm according to RFC 2047.
1667 auth_info->realm = ASCIIToWide(auth_handler_[target]->realm()); 1667 auth_info->realm = ASCIIToWide(auth_handler_[target]->realm());
1668 http_stream_->GetResponseInfo()->auth_challenge = auth_info; 1668 http_stream_->GetResponseInfo()->auth_challenge = auth_info;
1669 } 1669 }
1670 1670
1671 } // namespace net 1671 } // namespace net
OLDNEW
« no previous file with comments | « net/ftp/ftp_network_transaction.cc ('k') | net/socket/client_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698