diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-03 00:49:17 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-03 00:49:17 +0000 |
commit | 06650c582f9cfcf3869c490f3dc1ca224d6c9963 (patch) | |
tree | b6585569ec02f0bec32aa65b6e36b3cbf8a8533f /net/socket/socks_client_socket_pool.cc | |
parent | cb364d78210e5d64f3c899bbfa87dadebac7d6f7 (diff) | |
download | chromium_src-06650c582f9cfcf3869c490f3dc1ca224d6c9963.zip chromium_src-06650c582f9cfcf3869c490f3dc1ca224d6c9963.tar.gz chromium_src-06650c582f9cfcf3869c490f3dc1ca224d6c9963.tar.bz2 |
Rework the logging for sockets/connectjobs.
In particular, make it work better when using backup jobs / late binding (the display was very confused before because of how these asynchronous events would nest).
Also changed the paradigm for how PassiveLogCollector preserves these async associations -- this fixes how it replays the events to net-internals. (Before we would collapse the event streams into the SOURCE_URL_REQUEST which lost some hiearchy.. now I keep the separate streams).
Some of the particular changes to the event streams:
* ConnectJobs now create their own source stream internally.
* Sockets are now bounded by +SOCKET_ALIVE / -SOCKET_ALIVE events (removed the one-off SOCKET_DONE event).
* The socket log streams contains +SOCKET_IN_USE / -SOCKET_IN_USE event blocks to show which URLRequest was controlling it at various points in time (this makes it much easier to understand which read/writes belonged to a particular network transaction when a socket gets re-used).
* ConnectJobs are bounded by +SOCKET_POOL_CONNECT_JOB / - SOCKET_POOL_CONNECT_JOB events.
* ConnectJobs log the net error they failed with.
* Removed the SOCKET_BACKUP_TIMER_EXTENDED event.
Review URL: http://codereview.chromium.org/2363003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48797 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/socks_client_socket_pool.cc')
-rw-r--r-- | net/socket/socks_client_socket_pool.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/net/socket/socks_client_socket_pool.cc b/net/socket/socks_client_socket_pool.cc index 452ce25..4c446ab 100644 --- a/net/socket/socks_client_socket_pool.cc +++ b/net/socket/socks_client_socket_pool.cc @@ -26,13 +26,15 @@ SOCKSConnectJob::SOCKSConnectJob( const scoped_refptr<TCPClientSocketPool>& tcp_pool, const scoped_refptr<HostResolver>& host_resolver, Delegate* delegate, - const BoundNetLog& net_log) - : ConnectJob(group_name, timeout_duration, delegate, net_log), + NetLog* net_log) + : ConnectJob(group_name, timeout_duration, delegate, + BoundNetLog::Make(net_log, NetLog::SOURCE_CONNECT_JOB)), socks_params_(socks_params), tcp_pool_(tcp_pool), resolver_(host_resolver), ALLOW_THIS_IN_INITIALIZER_LIST( - callback_(this, &SOCKSConnectJob::OnIOComplete)) {} + callback_(this, &SOCKSConnectJob::OnIOComplete)) { +} SOCKSConnectJob::~SOCKSConnectJob() { // We don't worry about cancelling the tcp socket since the destructor in @@ -144,10 +146,9 @@ int SOCKSConnectJob::DoSOCKSConnectComplete(int result) { ConnectJob* SOCKSClientSocketPool::SOCKSConnectJobFactory::NewConnectJob( const std::string& group_name, const PoolBase::Request& request, - ConnectJob::Delegate* delegate, - const BoundNetLog& net_log) const { + ConnectJob::Delegate* delegate) const { return new SOCKSConnectJob(group_name, request.params(), ConnectionTimeout(), - tcp_pool_, host_resolver_, delegate, net_log); + tcp_pool_, host_resolver_, delegate, net_log_); } base::TimeDelta @@ -162,11 +163,12 @@ SOCKSClientSocketPool::SOCKSClientSocketPool( const scoped_refptr<ClientSocketPoolHistograms>& histograms, const scoped_refptr<HostResolver>& host_resolver, const scoped_refptr<TCPClientSocketPool>& tcp_pool, - NetworkChangeNotifier* network_change_notifier) + NetworkChangeNotifier* network_change_notifier, + NetLog* net_log) : base_(max_sockets, max_sockets_per_group, histograms, base::TimeDelta::FromSeconds(kUnusedIdleSocketTimeout), base::TimeDelta::FromSeconds(kUsedIdleSocketTimeout), - new SOCKSConnectJobFactory(tcp_pool, host_resolver), + new SOCKSConnectJobFactory(tcp_pool, host_resolver, net_log), network_change_notifier) {} SOCKSClientSocketPool::~SOCKSClientSocketPool() {} |