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

Side by Side Diff: media/cast/test/utility/net_utility.cc

Issue 2508593002: net: move udp directory into socket (Closed)
Patch Set: revert sys/socket.h change Created 4 years, 1 month 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 | « media/cast/net/udp_transport.h ('k') | media/cast/test/utility/tap_proxy.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/cast/test/utility/net_utility.h" 5 #include "media/cast/test/utility/net_utility.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "net/base/ip_address.h" 9 #include "net/base/ip_address.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
11 #include "net/log/net_log_source.h" 11 #include "net/log/net_log_source.h"
12 #include "net/udp/udp_server_socket.h" 12 #include "net/socket/udp_server_socket.h"
13 13
14 namespace media { 14 namespace media {
15 namespace cast { 15 namespace cast {
16 namespace test { 16 namespace test {
17 17
18 // TODO(hubbe): Move to /net/. 18 // TODO(hubbe): Move to /net/.
19 net::IPEndPoint GetFreeLocalPort() { 19 net::IPEndPoint GetFreeLocalPort() {
20 std::unique_ptr<net::UDPServerSocket> receive_socket( 20 std::unique_ptr<net::UDPServerSocket> receive_socket(
21 new net::UDPServerSocket(NULL, net::NetLogSource())); 21 new net::UDPServerSocket(NULL, net::NetLogSource()));
22 receive_socket->AllowAddressReuse(); 22 receive_socket->AllowAddressReuse();
23 CHECK_EQ(net::OK, receive_socket->Listen( 23 CHECK_EQ(net::OK, receive_socket->Listen(
24 net::IPEndPoint(net::IPAddress::IPv4Localhost(), 0))); 24 net::IPEndPoint(net::IPAddress::IPv4Localhost(), 0)));
25 net::IPEndPoint endpoint; 25 net::IPEndPoint endpoint;
26 CHECK_EQ(net::OK, receive_socket->GetLocalAddress(&endpoint)); 26 CHECK_EQ(net::OK, receive_socket->GetLocalAddress(&endpoint));
27 return endpoint; 27 return endpoint;
28 } 28 }
29 29
30 } // namespace test 30 } // namespace test
31 } // namespace cast 31 } // namespace cast
32 } // namespace media 32 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/net/udp_transport.h ('k') | media/cast/test/utility/tap_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698