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

Unified Diff: net/base/winsock_util.h

Issue 6658027: UDP sockets implementation for windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: typo Created 9 years, 9 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 | net/base/winsock_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/winsock_util.h
diff --git a/net/base/winsock_util.h b/net/base/winsock_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..c26e63fd21fbd21d1eb00d0c9547501bc2255a85
--- /dev/null
+++ b/net/base/winsock_util.h
@@ -0,0 +1,31 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_BASE_WINSOCK_UTIL_H_
+#define NET_BASE_WINSOCK_UTIL_H_
+#pragma once
+
+#include <winsock2.h>
+
+namespace net {
+
+// Assert that the (manual-reset) event object is not signaled.
+void AssertEventNotSignaled(WSAEVENT hEvent);
+
+// If the (manual-reset) event object is signaled, resets it and returns true.
+// Otherwise, does nothing and returns false. Called after a Winsock function
+// succeeds synchronously
+//
+// Our testing shows that except in rare cases (when running inside QEMU),
+// the event object is already signaled at this point, so we call this method
+// to avoid a context switch in common cases. This is just a performance
+// optimization. The code still works if this function simply returns false.
+bool ResetEventIfSignaled(WSAEVENT hEvent);
+
+// Map winsock error to Chromium error.
+int MapWinsockError(int os_error);
+
+} // namespace net
+
+#endif // NET_BASE_WINSOCK_UTIL_H_
« no previous file with comments | « no previous file | net/base/winsock_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698