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

Unified Diff: net/socket/tcp_client_socket.cc

Issue 23454010: POSIX only: Move client socket functionality from TCPClientSocket into TCPSocket. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « net/socket/tcp_client_socket.h ('k') | net/socket/tcp_client_socket_libevent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/tcp_client_socket.cc
diff --git a/net/socket/tcp_client_socket.cc b/net/socket/tcp_client_socket.cc
index af1c555caa0bd3ac175cb5d816f114b21ea5bae5..22aea47778b75c9060b8e65be924ec9c35a62b4e 100644
--- a/net/socket/tcp_client_socket.cc
+++ b/net/socket/tcp_client_socket.cc
@@ -5,8 +5,6 @@
#include "net/socket/tcp_client_socket.h"
#include "base/callback_helpers.h"
-#include "base/file_util.h"
-#include "base/files/file_path.h"
#include "base/logging.h"
#include "net/base/io_buffer.h"
#include "net/base/ip_endpoint.h"
@@ -15,55 +13,6 @@
namespace net {
-namespace {
-
-#if defined(OS_LINUX)
-
-// Checks to see if the system supports TCP FastOpen. Notably, it requires
-// kernel support. Additionally, this checks system configuration to ensure that
-// it's enabled.
-bool SystemSupportsTCPFastOpen() {
- static const base::FilePath::CharType kTCPFastOpenProcFilePath[] =
- "/proc/sys/net/ipv4/tcp_fastopen";
- std::string system_enabled_tcp_fastopen;
- if (!base::ReadFileToString(
- base::FilePath(kTCPFastOpenProcFilePath),
- &system_enabled_tcp_fastopen)) {
- return false;
- }
-
- // As per http://lxr.linux.no/linux+v3.7.7/include/net/tcp.h#L225
- // TFO_CLIENT_ENABLE is the LSB
- if (system_enabled_tcp_fastopen.empty() ||
- (system_enabled_tcp_fastopen[0] & 0x1) == 0) {
- return false;
- }
-
- return true;
-}
-
-#else
-
-bool SystemSupportsTCPFastOpen() {
- return false;
-}
-
-#endif
-
-}
-
-static bool g_tcp_fastopen_enabled = false;
-
-void SetTCPFastOpenEnabled(bool value) {
- g_tcp_fastopen_enabled = value && SystemSupportsTCPFastOpen();
-}
-
-bool IsTCPFastOpenEnabled() {
- return g_tcp_fastopen_enabled;
-}
-
-#if defined(OS_WIN)
-
TCPClientSocket::TCPClientSocket(const AddressList& addresses,
net::NetLog* net_log,
const net::NetLog::Source& source)
@@ -368,6 +317,4 @@ int TCPClientSocket::OpenSocket(AddressFamily family) {
return OK;
}
-#endif
-
} // namespace net
« no previous file with comments | « net/socket/tcp_client_socket.h ('k') | net/socket/tcp_client_socket_libevent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698