diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-23 16:44:02 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-23 16:44:02 +0000 |
commit | a2006ecefa10d259d0a85ac4146b913eb0f9d02f (patch) | |
tree | 67fc5e5f6339f2fa5e53735a30324e47de22005a /net/socket/socks5_client_socket.cc | |
parent | f044ce8e4aeef63eb7686345f407bf5640045c18 (diff) | |
download | chromium_src-a2006ecefa10d259d0a85ac4146b913eb0f9d02f.zip chromium_src-a2006ecefa10d259d0a85ac4146b913eb0f9d02f.tar.gz chromium_src-a2006ecefa10d259d0a85ac4146b913eb0f9d02f.tar.bz2 |
Add net log entries that summarize transmit and receive byte counts.
Tx/Rx summaries are integrated into the net log at the last point that bytes were transmitted or received.
Hopefully this will help resolve http://crbug.com/37729 by showing if we've received bytes over the network when we hit the "Waiting for cache" bug.
This change also modernizes the use of NetLog:
- ClientSocket now has a net_log() accessor
- ClientSocket::Connect no longer takes a NetLog, instead the TCPClientSocket constructor takes one, others use their transport socket's NetLog
- TCPClientSocket creates a new source id with source type SOCKET
Also updates PassiveLogCollector infrastructure:
- The LiveRequestsObserver lets a RequestTracker update a RequestInfo just before it is displayed. This allows ConnectJobs to be associated with URLRequests while connecting and then reassociated if they are late-bound to a different request.
BUG=37729
TEST=tx/rx lines show up in chrome://net-internals/
Review URL: http://codereview.chromium.org/1696005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45449 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/socks5_client_socket.cc')
-rw-r--r-- | net/socket/socks5_client_socket.cc | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/net/socket/socks5_client_socket.cc b/net/socket/socks5_client_socket.cc index eef3403..c960b80 100644 --- a/net/socket/socks5_client_socket.cc +++ b/net/socket/socks5_client_socket.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -59,7 +59,8 @@ SOCKS5ClientSocket::SOCKS5ClientSocket( bytes_sent_(0), bytes_received_(0), read_header_size(kReadHeaderSize), - host_request_info_(req_info) { + host_request_info_(req_info), + net_log_(transport_socket->socket()->NetLog()) { } SOCKS5ClientSocket::SOCKS5ClientSocket( @@ -74,7 +75,8 @@ SOCKS5ClientSocket::SOCKS5ClientSocket( bytes_sent_(0), bytes_received_(0), read_header_size(kReadHeaderSize), - host_request_info_(req_info) { + host_request_info_(req_info), + net_log_(transport_socket->NetLog()) { transport_->set_socket(transport_socket); } @@ -82,8 +84,7 @@ SOCKS5ClientSocket::~SOCKS5ClientSocket() { Disconnect(); } -int SOCKS5ClientSocket::Connect(CompletionCallback* callback, - const BoundNetLog& net_log) { +int SOCKS5ClientSocket::Connect(CompletionCallback* callback) { DCHECK(transport_.get()); DCHECK(transport_->socket()); DCHECK(transport_->socket()->IsConnected()); @@ -94,8 +95,7 @@ int SOCKS5ClientSocket::Connect(CompletionCallback* callback, if (completed_handshake_) return OK; - net_log_ = net_log; - net_log.BeginEvent(NetLog::TYPE_SOCKS5_CONNECT); + net_log_.BeginEvent(NetLog::TYPE_SOCKS5_CONNECT); next_state_ = STATE_GREET_WRITE; buffer_.clear(); @@ -104,8 +104,7 @@ int SOCKS5ClientSocket::Connect(CompletionCallback* callback, if (rv == ERR_IO_PENDING) { user_callback_ = callback; } else { - net_log.EndEvent(NetLog::TYPE_SOCKS5_CONNECT); - net_log_ = BoundNetLog(); + net_log_.EndEvent(NetLog::TYPE_SOCKS5_CONNECT); } return rv; } @@ -118,7 +117,6 @@ void SOCKS5ClientSocket::Disconnect() { // These are the states initialized by Connect(). next_state_ = STATE_NONE; user_callback_ = NULL; - net_log_ = BoundNetLog(); } bool SOCKS5ClientSocket::IsConnected() const { @@ -175,7 +173,6 @@ void SOCKS5ClientSocket::OnIOComplete(int result) { int rv = DoLoop(result); if (rv != ERR_IO_PENDING) { net_log_.EndEvent(NetLog::TYPE_SOCKS5_CONNECT); - net_log_ = BoundNetLog(); DoCallback(rv); } } |