Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(772)

Unified Diff: net/base/tcp_client_socket_win.cc

Issue 100129: Add a histogram to measure how long are we waiting to close... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/tcp_client_socket_win.cc
===================================================================
--- net/base/tcp_client_socket_win.cc (revision 14762)
+++ net/base/tcp_client_socket_win.cc (working copy)
@@ -157,12 +157,20 @@
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_));
WSACloseEvent(write_overlapped_.hEvent);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698