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

Unified Diff: net/udp/udp_socket_perftest.cc

Issue 2250473007: Move UseNonBlockingIO from a windows-only method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: socket_host_udp_unittest.cc Created 4 years, 4 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/udp/udp_server_socket.cc ('k') | net/udp/udp_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/udp/udp_socket_perftest.cc
diff --git a/net/udp/udp_socket_perftest.cc b/net/udp/udp_socket_perftest.cc
index c0c1db27bff2ce64eef975ec0b559ec408ea0f9e..059d019c92fc0d06cd513db31e87de2f29db9b17 100644
--- a/net/udp/udp_socket_perftest.cc
+++ b/net/udp/udp_socket_perftest.cc
@@ -94,10 +94,8 @@ void UDPSocketPerfTest::WriteBenchmark(bool use_nonblocking_io) {
CreateUDPAddress("127.0.0.1", kPort, &bind_address);
std::unique_ptr<UDPServerSocket> server(
new UDPServerSocket(nullptr, NetLog::Source()));
-#if defined(OS_WIN)
if (use_nonblocking_io)
server->UseNonBlockingIO();
-#endif
int rv = server->Listen(bind_address);
ASSERT_THAT(rv, IsOk());
@@ -107,10 +105,8 @@ void UDPSocketPerfTest::WriteBenchmark(bool use_nonblocking_io) {
std::unique_ptr<UDPClientSocket> client(
new UDPClientSocket(DatagramSocket::DEFAULT_BIND, RandIntCallback(),
nullptr, NetLog::Source()));
-#if defined(OS_WIN)
if (use_nonblocking_io)
client->UseNonBlockingIO();
-#endif
rv = client->Connect(server_address);
EXPECT_THAT(rv, IsOk());
@@ -130,12 +126,10 @@ TEST_F(UDPSocketPerfTest, Write) {
WriteBenchmark(false);
}
-#if defined(OS_WIN)
TEST_F(UDPSocketPerfTest, WriteNonBlocking) {
base::PerfTimeLogger timer("UDP_socket_write_nonblocking");
WriteBenchmark(true);
}
-#endif
} // namespace
« no previous file with comments | « net/udp/udp_server_socket.cc ('k') | net/udp/udp_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698