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 */ |