diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-27 02:58:33 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-27 02:58:33 +0000 |
commit | b0ee1dbdf8a0e531ae3c62f6c03f1f8536c74d23 (patch) | |
tree | 7bfa4405317e4baa3a9c3cec7e9b4a774f9674b7 /net | |
parent | c8394698b25716b1b0296176b4407c0acf7bdaa3 (diff) | |
download | chromium_src-b0ee1dbdf8a0e531ae3c62f6c03f1f8536c74d23.zip chromium_src-b0ee1dbdf8a0e531ae3c62f6c03f1f8536c74d23.tar.gz chromium_src-b0ee1dbdf8a0e531ae3c62f6c03f1f8536c74d23.tar.bz2 |
Add a dummy function CrashBug6500 so that the return
value and error code of the WaitForSingleObject call
are captured as function arguments in the crash dumps.
R=eroman
BUG=6500
Review URL: http://codereview.chromium.org/18788
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8701 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/tcp_client_socket_win.cc | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/net/base/tcp_client_socket_win.cc b/net/base/tcp_client_socket_win.cc index 8b15f38..4b42fd2 100644 --- a/net/base/tcp_client_socket_win.cc +++ b/net/base/tcp_client_socket_win.cc @@ -199,6 +199,15 @@ int TCPClientSocket::Read(char* buf, return MapWinsockError(err); } +// TODO(wtc): This temporary function is intended to determine the return +// value and error code of the WaitForSingleObject call in +// TCPClientSocket::Write if it doesn't return the expected WAIT_OBJECT_0. +// See http://crbug.com/6500. +static void CrashBug6500(DWORD wait_rv, DWORD wait_error) { + // wait_error is meaningful only if wait_rv is WAIT_FAILED. + CHECK(false) << wait_rv << wait_error; +} + int TCPClientSocket::Write(const char* buf, int buf_len, CompletionCallback* callback) { @@ -215,25 +224,10 @@ int TCPClientSocket::Write(const char* buf, DWORD num; int rv = WSASend(socket_, &buffer_, 1, &num, 0, &overlapped_, NULL); if (rv == 0) { - // TODO(wtc): These temporary CHECKs are intended to determine the return - // value and error code of the WaitForSingleObject call if it doesn't - // return the expected WAIT_OBJECT_0. See http://crbug.com/6500. DWORD wait_rv = WaitForSingleObject(overlapped_.hEvent, 0); if (wait_rv != WAIT_OBJECT_0) { - if (wait_rv == WAIT_ABANDONED) { - CHECK(false); - } else if (wait_rv == WAIT_TIMEOUT) { - CHECK(false); - } else if (wait_rv == WAIT_FAILED) { - DWORD wait_error = GetLastError(); - if (wait_error == ERROR_INVALID_HANDLE) { - CHECK(false); - } else { - CHECK(false); - } - } else { - CHECK(false); - } + DWORD wait_error = GetLastError(); + CrashBug6500(wait_rv, wait_error); } BOOL ok = WSAResetEvent(overlapped_.hEvent); CHECK(ok); |