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

Unified Diff: experimental/visual_studio_plugin/src/debug_conn/win/debug_socket_win.cc

Issue 10928195: First round of dead file removal (Closed) Base URL: https://github.com/samclegg/nativeclient-sdk.git@master
Patch Set: Created 8 years, 3 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
Index: experimental/visual_studio_plugin/src/debug_conn/win/debug_socket_win.cc
diff --git a/experimental/visual_studio_plugin/src/debug_conn/win/debug_socket_win.cc b/experimental/visual_studio_plugin/src/debug_conn/win/debug_socket_win.cc
deleted file mode 100644
index 05eeede6c9527d08575a05e93f357dfbe090ec00..0000000000000000000000000000000000000000
--- a/experimental/visual_studio_plugin/src/debug_conn/win/debug_socket_win.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2011 The Native Client Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can
- * be found in the LICENSE file.
- */
-#include <winsock2.h>
-
-#include "debug_conn/debug_socket_impl.h"
-#include "debug_conn/debug_util.h"
-
-#define CHECK_ERROR() DebugSocketLogError(__FILE__, __LINE__, 1)
-#define PROCESS_ERROR() DebugSocketLogError(__FILE__, __LINE__, 0)
-
-static int s_SocketsAvailible = 0;
-DSError DebugSocketInit()
-{
- WORD wVersionRequested;
- WSADATA wsaData;
- int err;
-
- // Make sure to request the use of sockets.
- // NOTE: It is safe to call Startup multiple times
- wVersionRequested = MAKEWORD(2, 2);
- err = WSAStartup(wVersionRequested, &wsaData);
- if (err != 0) {
- // We could not find a matching DLL
- debug_log_error("WSAStartup failed with error: %d\n", err);
- return DSE_ERROR;
- }
-
- if (HIBYTE(wsaData.wVersion) != 2)
- {
- // We couldn't get a matching version
- debug_log_error("Could not find a usable version of Winsock.dll\n");
- WSACleanup();
- return DSE_ERROR;
- }
-
- s_SocketsAvailible = 1;
- return DSE_OK;
-}
-
-DSError DebugSocketExit() {
- // Make sure to signal we are done with sockets
- // NOTE: It must be called as many times as Startup.
- if (s_SocketsAvailible)
- {
- s_SocketsAvailible = 0;
- WSACleanup();
- }
-
- return DSE_OK;
-}
-
-DSError DebugSocketCreate(DSHandle *h) {
- SOCKET s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
-
- if (-1 == s)
- return PROCESS_ERROR();
-
- *h = (DSHandle) s;
- return DSE_OK;
-}
-
-
-DSError DebugSocketClose(DSHandle handle) {
- SOCKET s = (SOCKET) handle;
-
- // Check this isn't already invalid
- if (-1 == s)
- return DSE_OK;
-
- if (shutdown(s, SD_BOTH))
- return CHECK_ERROR();
-
- // If not then close it
- if (closesocket(s) != 0)
- return CHECK_ERROR();
-
- return DSE_OK;
-}
-
-
-int DebugSocketGetError(int block_ok) {
- int err = GetLastError();
-
- if (block_ok && (WSAEWOULDBLOCK == err))
- return 0;
-
- return err;
-}
-

Powered by Google App Engine
This is Rietveld 408576698