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

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

Issue 1905763002: Convert //media/cast from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 "base/memory/scoped_ptr.h" 7 #include <memory>
8
8 #include "net/base/ip_address.h" 9 #include "net/base/ip_address.h"
9 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
10 #include "net/udp/udp_server_socket.h" 11 #include "net/udp/udp_server_socket.h"
11 12
12 namespace media { 13 namespace media {
13 namespace cast { 14 namespace cast {
14 namespace test { 15 namespace test {
15 16
16 // TODO(hubbe): Move to /net/. 17 // TODO(hubbe): Move to /net/.
17 net::IPEndPoint GetFreeLocalPort() { 18 net::IPEndPoint GetFreeLocalPort() {
18 scoped_ptr<net::UDPServerSocket> receive_socket( 19 std::unique_ptr<net::UDPServerSocket> receive_socket(
19 new net::UDPServerSocket(NULL, net::NetLog::Source())); 20 new net::UDPServerSocket(NULL, net::NetLog::Source()));
20 receive_socket->AllowAddressReuse(); 21 receive_socket->AllowAddressReuse();
21 CHECK_EQ(net::OK, receive_socket->Listen( 22 CHECK_EQ(net::OK, receive_socket->Listen(
22 net::IPEndPoint(net::IPAddress::IPv4Localhost(), 0))); 23 net::IPEndPoint(net::IPAddress::IPv4Localhost(), 0)));
23 net::IPEndPoint endpoint; 24 net::IPEndPoint endpoint;
24 CHECK_EQ(net::OK, receive_socket->GetLocalAddress(&endpoint)); 25 CHECK_EQ(net::OK, receive_socket->GetLocalAddress(&endpoint));
25 return endpoint; 26 return endpoint;
26 } 27 }
27 28
28 } // namespace test 29 } // namespace test
29 } // namespace cast 30 } // namespace cast
30 } // namespace media 31 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/test/utility/in_process_receiver.cc ('k') | media/cast/test/utility/standalone_cast_environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698