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

Unified Diff: third_party/grpc/src/core/iomgr/iomgr_windows.c

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « third_party/grpc/src/core/iomgr/iomgr_posix.c ('k') | third_party/grpc/src/core/iomgr/pollset.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/grpc/src/core/iomgr/iomgr_windows.c
diff --git a/third_party/WebKit/Source/web/WebMIDIPermissionRequest.cpp b/third_party/grpc/src/core/iomgr/iomgr_windows.c
similarity index 61%
copy from third_party/WebKit/Source/web/WebMIDIPermissionRequest.cpp
copy to third_party/grpc/src/core/iomgr/iomgr_windows.c
index be2b7ff83abe862c03729c2e79c83197d60acd15..14775516bb1d6c1be0c248fc4c8331e77201de76 100644
--- a/third_party/WebKit/Source/web/WebMIDIPermissionRequest.cpp
+++ b/third_party/grpc/src/core/iomgr/iomgr_windows.c
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -26,44 +28,46 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
*/
-#include "public/web/modules/webmidi/WebMIDIPermissionRequest.h"
+#include <grpc/support/port_platform.h>
-#include "modules/webmidi/MIDIAccessInitializer.h"
-#include "platform/weborigin/SecurityOrigin.h"
-#include "public/platform/WebSecurityOrigin.h"
+#ifdef GPR_WINSOCK_SOCKET
-namespace blink {
+#include "src/core/iomgr/sockaddr_win32.h"
-WebMIDIPermissionRequest::WebMIDIPermissionRequest(MIDIAccessInitializer* initializer)
- : m_private(initializer)
-{
-}
+#include <grpc/support/log.h>
-void WebMIDIPermissionRequest::reset()
-{
- m_private.reset();
-}
+#include "src/core/iomgr/socket_windows.h"
+#include "src/core/iomgr/iocp_windows.h"
+#include "src/core/iomgr/iomgr.h"
+
+/* Windows' io manager is going to be fully designed using IO completion
+ ports. All of what we're doing here is basically make sure that
+ Windows sockets are initialized in and out. */
-void WebMIDIPermissionRequest::assign(const WebMIDIPermissionRequest& other)
-{
- m_private = other.m_private;
+static void winsock_init(void) {
+ WSADATA wsaData;
+ int status = WSAStartup(MAKEWORD(2, 0), &wsaData);
+ GPR_ASSERT(status == 0);
}
-bool WebMIDIPermissionRequest::equals(const WebMIDIPermissionRequest& n) const
-{
- return m_private.get() == n.m_private.get();
+static void winsock_shutdown(void) {
+ int status = WSACleanup();
+ GPR_ASSERT(status == 0);
}
-WebSecurityOrigin WebMIDIPermissionRequest::getSecurityOrigin() const
-{
- return WebSecurityOrigin(m_private->getSecurityOrigin());
+void grpc_iomgr_platform_init(void) {
+ winsock_init();
+ grpc_iocp_init();
}
-void WebMIDIPermissionRequest::setIsAllowed(bool allowed)
-{
- m_private->resolvePermission(allowed);
+void grpc_iomgr_platform_flush(void) { grpc_iocp_flush(); }
+
+void grpc_iomgr_platform_shutdown(void) {
+ grpc_iocp_shutdown();
+ winsock_shutdown();
}
-} // namespace blink
+#endif /* GRPC_WINSOCK_SOCKET */
« no previous file with comments | « third_party/grpc/src/core/iomgr/iomgr_posix.c ('k') | third_party/grpc/src/core/iomgr/pollset.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698