diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-02 23:25:19 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-02 23:25:19 +0000 |
commit | 5a05c47ae2a497d4efbbb9166fa5ff7aebfd4ecf (patch) | |
tree | 4f39f1f44be3eb179f8368bca0bc18512e398a40 /net/socket/ssl_client_socket_win.cc | |
parent | f852667f469ea8fd31b8a1dd0f0130382efe591f (diff) | |
download | chromium_src-5a05c47ae2a497d4efbbb9166fa5ff7aebfd4ecf.zip chromium_src-5a05c47ae2a497d4efbbb9166fa5ff7aebfd4ecf.tar.gz chromium_src-5a05c47ae2a497d4efbbb9166fa5ff7aebfd4ecf.tar.bz2 |
Add LoadLog to ClientSocket::Connect().
TODO: Use LoadLog in FLIP code.
Review URL: http://codereview.chromium.org/344026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30765 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/ssl_client_socket_win.cc')
-rw-r--r-- | net/socket/ssl_client_socket_win.cc | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/net/socket/ssl_client_socket_win.cc b/net/socket/ssl_client_socket_win.cc index 03b8bfe..7212095 100644 --- a/net/socket/ssl_client_socket_win.cc +++ b/net/socket/ssl_client_socket_win.cc @@ -14,6 +14,7 @@ #include "net/base/cert_verifier.h" #include "net/base/connection_type_histograms.h" #include "net/base/io_buffer.h" +#include "net/base/load_log.h" #include "net/base/net_errors.h" #include "net/base/ssl_cert_request_info.h" #include "net/base/ssl_info.h" @@ -426,11 +427,33 @@ void SSLClientSocketWin::GetSSLCertRequestInfo( DCHECK(ok); } -int SSLClientSocketWin::Connect(CompletionCallback* callback) { +int SSLClientSocketWin::Connect(CompletionCallback* callback, + LoadLog* load_log) { DCHECK(transport_.get()); DCHECK(next_state_ == STATE_NONE); DCHECK(!user_connect_callback_); + LoadLog::BeginEvent(load_log, LoadLog::TYPE_SSL_CONNECT); + + int rv = InitializeSSLContext(); + if (rv != OK) { + LoadLog::EndEvent(load_log, LoadLog::TYPE_SSL_CONNECT); + return rv; + } + + writing_first_token_ = true; + next_state_ = STATE_HANDSHAKE_WRITE; + rv = DoLoop(OK); + if (rv == ERR_IO_PENDING) { + user_connect_callback_ = callback; + load_log_ = load_log; + } else { + LoadLog::EndEvent(load_log, LoadLog::TYPE_SSL_CONNECT); + } + return rv; +} + +int SSLClientSocketWin::InitializeSSLContext() { int ssl_version_mask = 0; if (ssl_config_.ssl2_enabled) ssl_version_mask |= SSL2; @@ -487,14 +510,10 @@ int SSLClientSocketWin::Connect(CompletionCallback* callback) { return MapSecurityError(status); } - writing_first_token_ = true; - next_state_ = STATE_HANDSHAKE_WRITE; - int rv = DoLoop(OK); - if (rv == ERR_IO_PENDING) - user_connect_callback_ = callback; - return rv; + return OK; } + void SSLClientSocketWin::Disconnect() { // TODO(wtc): Send SSL close_notify alert. next_state_ = STATE_NONE; @@ -618,6 +637,9 @@ void SSLClientSocketWin::OnHandshakeIOComplete(int result) { // The SSL handshake has some round trips. Any error, other than waiting // for IO, means that we've failed and need to notify the caller. if (rv != ERR_IO_PENDING) { + LoadLog::EndEvent(load_log_, LoadLog::TYPE_SSL_CONNECT); + load_log_ = NULL; + // If there is no connect callback available to call, it had better be // because we are renegotiating (which occurs because we are in the middle // of a Read when the renegotiation process starts). We need to inform the |