summaryrefslogtreecommitdiffstats
path: root/net/base/tcp_client_socket_win.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-29 00:22:39 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-29 00:22:39 +0000
commit8de57342e6e4c50337c553f49f39a59ff1d825d3 (patch)
treea06533a0b9670ce9f2899e10ba5dd3f08ba98b39 /net/base/tcp_client_socket_win.cc
parent9e411e78c9c719924341a7020fa207efd2761e8e (diff)
downloadchromium_src-8de57342e6e4c50337c553f49f39a59ff1d825d3.zip
chromium_src-8de57342e6e4c50337c553f49f39a59ff1d825d3.tar.gz
chromium_src-8de57342e6e4c50337c553f49f39a59ff1d825d3.tar.bz2
Add a histogram to measure how long are we waiting to close
sockets with pending IO. BUG=9258 Review URL: http://codereview.chromium.org/100129 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14807 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/tcp_client_socket_win.cc')
-rw-r--r--net/base/tcp_client_socket_win.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/net/base/tcp_client_socket_win.cc b/net/base/tcp_client_socket_win.cc
index 54eb49f..2066ec0 100644
--- a/net/base/tcp_client_socket_win.cc
+++ b/net/base/tcp_client_socket_win.cc
@@ -157,11 +157,19 @@ void TCPClientSocketWin::Disconnect() {
closesocket(socket_);
socket_ = INVALID_SOCKET;
- // Wait for pending IO to be aborted.
- if (waiting_read_)
- WaitForSingleObject(read_overlapped_.hEvent, INFINITE);
- if (waiting_write_)
- WaitForSingleObject(write_overlapped_.hEvent, INFINITE);
+ if (waiting_read_ || waiting_write_) {
+ base::TimeTicks start = base::TimeTicks::Now();
+
+ // Wait for pending IO to be aborted.
+ if (waiting_read_)
+ WaitForSingleObject(read_overlapped_.hEvent, INFINITE);
+ if (waiting_write_)
+ WaitForSingleObject(write_overlapped_.hEvent, INFINITE);
+
+ // We want to see if we block the message loop for too long.
+ UMA_HISTOGRAM_TIMES("AsyncIO.ClientSocketDisconnect",
+ base::TimeTicks::Now() - start);
+ }
WSACloseEvent(read_overlapped_.hEvent);
memset(&read_overlapped_, 0, sizeof(read_overlapped_));