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

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

Issue 2333923004: Extracting NetLog inner classes into their own classes. (Closed)
Patch Set: Some nit fixes and better, impl-agnostic naming of net_log_parameters_callback_typedef.h -> net/log… Created 4 years, 2 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
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/udp/udp_server_socket.h" 12 #include "net/udp/udp_server_socket.h"
12 13
13 namespace media { 14 namespace media {
14 namespace cast { 15 namespace cast {
15 namespace test { 16 namespace test {
16 17
17 // TODO(hubbe): Move to /net/. 18 // TODO(hubbe): Move to /net/.
18 net::IPEndPoint GetFreeLocalPort() { 19 net::IPEndPoint GetFreeLocalPort() {
19 std::unique_ptr<net::UDPServerSocket> receive_socket( 20 std::unique_ptr<net::UDPServerSocket> receive_socket(
20 new net::UDPServerSocket(NULL, net::NetLog::Source())); 21 new net::UDPServerSocket(NULL, net::NetLogSource()));
21 receive_socket->AllowAddressReuse(); 22 receive_socket->AllowAddressReuse();
22 CHECK_EQ(net::OK, receive_socket->Listen( 23 CHECK_EQ(net::OK, receive_socket->Listen(
23 net::IPEndPoint(net::IPAddress::IPv4Localhost(), 0))); 24 net::IPEndPoint(net::IPAddress::IPv4Localhost(), 0)));
24 net::IPEndPoint endpoint; 25 net::IPEndPoint endpoint;
25 CHECK_EQ(net::OK, receive_socket->GetLocalAddress(&endpoint)); 26 CHECK_EQ(net::OK, receive_socket->GetLocalAddress(&endpoint));
26 return endpoint; 27 return endpoint;
27 } 28 }
28 29
29 } // namespace test 30 } // namespace test
30 } // namespace cast 31 } // namespace cast
31 } // namespace media 32 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698