diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 07:03:53 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 07:03:53 +0000 |
commit | 9e743cddfd631038fe6f1cdde050e18d61319ec6 (patch) | |
tree | 7ef974e43b23f570433fe819bcd07966165c517f /net/socket/socks_client_socket.cc | |
parent | 2e7aff66fe443c29b2fc14a776dca5512b0b4729 (diff) | |
download | chromium_src-9e743cddfd631038fe6f1cdde050e18d61319ec6.zip chromium_src-9e743cddfd631038fe6f1cdde050e18d61319ec6.tar.gz chromium_src-9e743cddfd631038fe6f1cdde050e18d61319ec6.tar.bz2 |
Generalize the net module's LoadLog facility from a passive container, to an event stream (NetLog).
This makes it possible to associate a single NetLog with a URLRequestContext, and then attach observers to that log to watch the stream of events.
This changelist attempts to do the most direct translation, so there will be subsequent iterations to clean up.
The user-visible behavior should remain unchanged.
BUG=37421
Review URL: http://codereview.chromium.org/848006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41689 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/socks_client_socket.cc')
-rw-r--r-- | net/socket/socks_client_socket.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/net/socket/socks_client_socket.cc b/net/socket/socks_client_socket.cc index a9135d2..c92189c 100644 --- a/net/socket/socks_client_socket.cc +++ b/net/socket/socks_client_socket.cc @@ -8,7 +8,7 @@ #include "base/compiler_specific.h" #include "base/trace_event.h" #include "net/base/io_buffer.h" -#include "net/base/load_log.h" +#include "net/base/net_log.h" #include "net/base/net_util.h" #include "net/base/sys_addrinfo.h" @@ -80,7 +80,7 @@ SOCKSClientSocket::~SOCKSClientSocket() { } int SOCKSClientSocket::Connect(CompletionCallback* callback, - LoadLog* load_log) { + const BoundNetLog& net_log) { DCHECK(transport_.get()); DCHECK(transport_->IsConnected()); DCHECK_EQ(STATE_NONE, next_state_); @@ -91,16 +91,16 @@ int SOCKSClientSocket::Connect(CompletionCallback* callback, return OK; next_state_ = STATE_RESOLVE_HOST; - load_log_ = load_log; + net_log_ = net_log; - LoadLog::BeginEvent(load_log, LoadLog::TYPE_SOCKS_CONNECT); + net_log.BeginEvent(NetLog::TYPE_SOCKS_CONNECT); int rv = DoLoop(OK); if (rv == ERR_IO_PENDING) { user_callback_ = callback; } else { - LoadLog::EndEvent(load_log, LoadLog::TYPE_SOCKS_CONNECT); - load_log_ = NULL; + net_log.EndEvent(NetLog::TYPE_SOCKS_CONNECT); + net_log_ = BoundNetLog(); } return rv; } @@ -114,7 +114,7 @@ void SOCKSClientSocket::Disconnect() { // These are the states initialized by Connect(). next_state_ = STATE_NONE; user_callback_ = NULL; - load_log_ = NULL; + net_log_ = BoundNetLog(); } bool SOCKSClientSocket::IsConnected() const { @@ -171,8 +171,8 @@ void SOCKSClientSocket::OnIOComplete(int result) { DCHECK_NE(STATE_NONE, next_state_); int rv = DoLoop(result); if (rv != ERR_IO_PENDING) { - LoadLog::EndEvent(load_log_, LoadLog::TYPE_SOCKS_CONNECT); - load_log_ = NULL; + net_log_.EndEvent(NetLog::TYPE_SOCKS_CONNECT); + net_log_ = BoundNetLog(); DoCallback(rv); } } @@ -219,7 +219,7 @@ int SOCKSClientSocket::DoResolveHost() { next_state_ = STATE_RESOLVE_HOST_COMPLETE; return host_resolver_.Resolve( - host_request_info_, &addresses_, &io_callback_, load_log_); + host_request_info_, &addresses_, &io_callback_, net_log_); } int SOCKSClientSocket::DoResolveHostComplete(int result) { @@ -356,7 +356,7 @@ int SOCKSClientSocket::DoHandshakeReadComplete(int result) { return ERR_CONNECTION_CLOSED; if (bytes_received_ + result > kReadHeaderSize) { - // TODO(eroman): Describe failure in LoadLog. + // TODO(eroman): Describe failure in NetLog. return ERR_SOCKS_CONNECTION_FAILED; } |