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

Unified Diff: net/base/tcp_client_socket_win.cc

Issue 18788: Add a dummy function CrashBug6500 so that the return... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 11 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 8332)
+++ net/base/tcp_client_socket_win.cc (working copy)
@@ -199,6 +199,15 @@
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 @@
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);
« 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