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

Side by Side Diff: net/udp/udp_socket_perftest.cc

Issue 1084533002: Rename NetLogLogger and CapturingNetLog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename NetLogLogger and CapturingNetLog(removed compiler error for chromeOS) Created 5 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 unified diff | Download patch
« no previous file with comments | « net/spdy/spdy_stream_unittest.cc ('k') | net/udp/udp_socket_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/memory/weak_ptr.h" 7 #include "base/memory/weak_ptr.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/test/perf_time_logger.h" 10 #include "base/test/perf_time_logger.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 } 85 }
86 86
87 void UDPSocketPerfTest::WriteBenchmark(bool use_nonblocking_io) { 87 void UDPSocketPerfTest::WriteBenchmark(bool use_nonblocking_io) {
88 base::MessageLoopForIO message_loop; 88 base::MessageLoopForIO message_loop;
89 const uint16 kPort = 9999; 89 const uint16 kPort = 9999;
90 90
91 // Setup the server to listen. 91 // Setup the server to listen.
92 net::IPEndPoint bind_address; 92 net::IPEndPoint bind_address;
93 CreateUDPAddress("127.0.0.1", kPort, &bind_address); 93 CreateUDPAddress("127.0.0.1", kPort, &bind_address);
94 net::CapturingNetLog server_log; 94 net::TestNetLog server_log;
95 scoped_ptr<net::UDPServerSocket> server( 95 scoped_ptr<net::UDPServerSocket> server(
96 new net::UDPServerSocket(&server_log, net::NetLog::Source())); 96 new net::UDPServerSocket(&server_log, net::NetLog::Source()));
97 #if defined(OS_WIN) 97 #if defined(OS_WIN)
98 if (use_nonblocking_io) 98 if (use_nonblocking_io)
99 server->UseNonBlockingIO(); 99 server->UseNonBlockingIO();
100 #endif 100 #endif
101 int rv = server->Listen(bind_address); 101 int rv = server->Listen(bind_address);
102 ASSERT_EQ(net::OK, rv); 102 ASSERT_EQ(net::OK, rv);
103 103
104 // Setup the client. 104 // Setup the client.
105 net::IPEndPoint server_address; 105 net::IPEndPoint server_address;
106 CreateUDPAddress("127.0.0.1", kPort, &server_address); 106 CreateUDPAddress("127.0.0.1", kPort, &server_address);
107 net::CapturingNetLog client_log; 107 net::TestNetLog client_log;
108 scoped_ptr<net::UDPClientSocket> client(new net::UDPClientSocket( 108 scoped_ptr<net::UDPClientSocket> client(new net::UDPClientSocket(
109 net::DatagramSocket::DEFAULT_BIND, net::RandIntCallback(), &client_log, 109 net::DatagramSocket::DEFAULT_BIND, net::RandIntCallback(), &client_log,
110 net::NetLog::Source())); 110 net::NetLog::Source()));
111 #if defined(OS_WIN) 111 #if defined(OS_WIN)
112 if (use_nonblocking_io) 112 if (use_nonblocking_io)
113 client->UseNonBlockingIO(); 113 client->UseNonBlockingIO();
114 #endif 114 #endif
115 rv = client->Connect(server_address); 115 rv = client->Connect(server_address);
116 EXPECT_EQ(net::OK, rv); 116 EXPECT_EQ(net::OK, rv);
117 117
(...skipping 14 matching lines...) Expand all
132 } 132 }
133 133
134 #if defined(OS_WIN) 134 #if defined(OS_WIN)
135 TEST_F(UDPSocketPerfTest, WriteNonBlocking) { 135 TEST_F(UDPSocketPerfTest, WriteNonBlocking) {
136 base::PerfTimeLogger timer("UDP_socket_write_nonblocking"); 136 base::PerfTimeLogger timer("UDP_socket_write_nonblocking");
137 WriteBenchmark(true); 137 WriteBenchmark(true);
138 } 138 }
139 #endif 139 #endif
140 140
141 } // namespace 141 } // namespace
OLDNEW
« no previous file with comments | « net/spdy/spdy_stream_unittest.cc ('k') | net/udp/udp_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698