From 18e946f9ab6250614430fd09cccb849005ca7aeb Mon Sep 17 00:00:00 2001 From: dcheng Date: Thu, 21 Apr 2016 12:43:34 -0700 Subject: [PATCH] Convert //jingle from scoped_ptr to std::unique_ptr BUG=554298 R=sergeyu@chromium.org Review URL: https://codereview.chromium.org/1905773002 Cr-Commit-Position: refs/heads/master@{#388857} --- jingle/glue/chrome_async_socket.cc | 2 +- jingle/glue/chrome_async_socket.h | 7 +-- jingle/glue/chrome_async_socket_unittest.cc | 32 +++++++------- jingle/glue/fake_ssl_client_socket.cc | 2 +- jingle/glue/fake_ssl_client_socket.h | 7 +-- .../glue/fake_ssl_client_socket_unittest.cc | 9 ++-- jingle/glue/proxy_resolving_client_socket.h | 7 +-- .../proxy_resolving_client_socket_unittest.cc | 2 +- jingle/glue/resolving_client_socket_factory.h | 8 ++-- jingle/glue/thread_wrapper.cc | 7 +-- jingle/glue/thread_wrapper.h | 4 +- jingle/glue/utils.cc | 5 ++- jingle/glue/xmpp_client_socket_factory.cc | 17 +++---- jingle/glue/xmpp_client_socket_factory.h | 6 +-- .../base/weak_xmpp_client_unittest.cc | 5 ++- jingle/notifier/base/xmpp_connection.h | 5 ++- .../notifier/base/xmpp_connection_unittest.cc | 6 +-- jingle/notifier/communicator/login.h | 4 +- .../communicator/single_login_attempt.h | 5 ++- .../single_login_attempt_unittest.cc | 44 ++++++++++--------- .../listener/non_blocking_push_client.cc | 2 +- .../listener/non_blocking_push_client.h | 5 ++- .../non_blocking_push_client_unittest.cc | 10 ++--- jingle/notifier/listener/push_client.cc | 10 ++--- jingle/notifier/listener/push_client.h | 6 +-- .../notifier/listener/push_client_unittest.cc | 7 +-- .../push_notifications_send_update_task.cc | 7 ++- ...notifications_send_update_task_unittest.cc | 9 ++-- .../push_notifications_subscribe_task.cc | 7 ++- ...h_notifications_subscribe_task_unittest.cc | 9 ++-- jingle/notifier/listener/send_ping_task.cc | 4 +- .../listener/send_ping_task_unittest.cc | 6 ++- .../listener/xml_element_util_unittest.cc | 12 +++-- jingle/notifier/listener/xmpp_push_client.h | 4 +- .../listener/xmpp_push_client_unittest.cc | 5 ++- .../client/jni/chromoting_jni_instance.cc | 2 +- 36 files changed, 150 insertions(+), 139 deletions(-) diff --git a/jingle/glue/chrome_async_socket.cc b/jingle/glue/chrome_async_socket.cc index 38bca5881202c2..ca03a0fa722c5c 100644 --- a/jingle/glue/chrome_async_socket.cc +++ b/jingle/glue/chrome_async_socket.cc @@ -402,7 +402,7 @@ bool ChromeAsyncSocket::StartTls(const std::string& domain_name) { weak_ptr_factory_.InvalidateWeakPtrs(); DCHECK(transport_socket_.get()); - scoped_ptr socket_handle( + std::unique_ptr socket_handle( new net::ClientSocketHandle()); socket_handle->SetSocket(std::move(transport_socket_)); transport_socket_ = resolving_client_socket_factory_->CreateSSLClientSocket( diff --git a/jingle/glue/chrome_async_socket.h b/jingle/glue/chrome_async_socket.h index cad4295d65a995..a00069a8c2ac3f 100644 --- a/jingle/glue/chrome_async_socket.h +++ b/jingle/glue/chrome_async_socket.h @@ -13,13 +13,13 @@ #include +#include #include #include #include "base/compiler_specific.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "net/base/completion_callback.h" #include "net/base/net_errors.h" @@ -182,7 +182,8 @@ class ChromeAsyncSocket : public buzz::AsyncSocket { // Close functions. void DoClose(); - scoped_ptr resolving_client_socket_factory_; + std::unique_ptr + resolving_client_socket_factory_; // buzz::AsyncSocket state. buzz::AsyncSocket::State state_; @@ -190,7 +191,7 @@ class ChromeAsyncSocket : public buzz::AsyncSocket { net::Error net_error_; // NULL iff state() == STATE_CLOSED. - scoped_ptr transport_socket_; + std::unique_ptr transport_socket_; // State for the read loop. |read_start_| <= |read_end_| <= // |read_buf_->size()|. There's a read in flight (i.e., diff --git a/jingle/glue/chrome_async_socket_unittest.cc b/jingle/glue/chrome_async_socket_unittest.cc index 146ea8390219d0..b4f278170c9e18 100644 --- a/jingle/glue/chrome_async_socket_unittest.cc +++ b/jingle/glue/chrome_async_socket_unittest.cc @@ -5,13 +5,14 @@ #include "jingle/glue/chrome_async_socket.h" #include + #include +#include #include #include #include "base/logging.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/message_loop/message_pump_default.h" #include "jingle/glue/resolving_client_socket_factory.h" @@ -124,14 +125,14 @@ class MockXmppClientSocketFactory : public ResolvingClientSocketFactory { } // ResolvingClientSocketFactory implementation. - scoped_ptr CreateTransportClientSocket( + std::unique_ptr CreateTransportClientSocket( const net::HostPortPair& host_and_port) override { return mock_client_socket_factory_->CreateTransportClientSocket( address_list_, NULL, NULL, net::NetLog::Source()); } - scoped_ptr CreateSSLClientSocket( - scoped_ptr transport_socket, + std::unique_ptr CreateSSLClientSocket( + std::unique_ptr transport_socket, const net::HostPortPair& host_and_port) override { net::SSLClientSocketContext context; context.cert_verifier = cert_verifier_.get(); @@ -141,11 +142,11 @@ class MockXmppClientSocketFactory : public ResolvingClientSocketFactory { } private: - scoped_ptr mock_client_socket_factory_; + std::unique_ptr mock_client_socket_factory_; net::AddressList address_list_; net::SSLConfig ssl_config_; - scoped_ptr cert_verifier_; - scoped_ptr transport_security_state_; + std::unique_ptr cert_verifier_; + std::unique_ptr transport_security_state_; }; class ChromeAsyncSocketTest @@ -160,14 +161,14 @@ class ChromeAsyncSocketTest // __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__ // when called. // Explicitly create a MessagePumpDefault which can run in this enivronment. - scoped_ptr pump(new base::MessagePumpDefault()); + std::unique_ptr pump(new base::MessagePumpDefault()); message_loop_.reset(new base::MessageLoop(std::move(pump))); } ~ChromeAsyncSocketTest() override {} void SetUp() override { - scoped_ptr mock_client_socket_factory( + std::unique_ptr mock_client_socket_factory( new net::MockClientSocketFactory()); mock_client_socket_factory->AddSocketDataProvider( &async_socket_data_provider_); @@ -177,10 +178,9 @@ class ChromeAsyncSocketTest // Fake DNS resolution for |addr_| and pass it to the factory. const net::AddressList address_list = net::AddressList::CreateFromIPAddress( net::IPAddress::IPv4Localhost(), addr_.port()); - scoped_ptr mock_xmpp_client_socket_factory( - new MockXmppClientSocketFactory( - mock_client_socket_factory.release(), - address_list)); + std::unique_ptr + mock_xmpp_client_socket_factory(new MockXmppClientSocketFactory( + mock_client_socket_factory.release(), address_list)); chrome_async_socket_.reset( new ChromeAsyncSocket(mock_xmpp_client_socket_factory.release(), 14, 20)), @@ -414,7 +414,7 @@ class ChromeAsyncSocketTest std::string DrainRead(size_t buf_size) { std::string read; - scoped_ptr buf(new char[buf_size]); + std::unique_ptr buf(new char[buf_size]); size_t len_read; while (true) { bool success = @@ -432,12 +432,12 @@ class ChromeAsyncSocketTest } // ChromeAsyncSocket expects a message loop. - scoped_ptr message_loop_; + std::unique_ptr message_loop_; AsyncSocketDataProvider async_socket_data_provider_; net::SSLSocketDataProvider ssl_socket_data_provider_; - scoped_ptr chrome_async_socket_; + std::unique_ptr chrome_async_socket_; std::deque signal_socket_states_; const rtc::SocketAddress addr_; diff --git a/jingle/glue/fake_ssl_client_socket.cc b/jingle/glue/fake_ssl_client_socket.cc index 583b54e1eef169..7270b18c1ad6de 100644 --- a/jingle/glue/fake_ssl_client_socket.cc +++ b/jingle/glue/fake_ssl_client_socket.cc @@ -80,7 +80,7 @@ base::StringPiece FakeSSLClientSocket::GetSslServerHello() { } FakeSSLClientSocket::FakeSSLClientSocket( - scoped_ptr transport_socket) + std::unique_ptr transport_socket) : transport_socket_(std::move(transport_socket)), next_handshake_state_(STATE_NONE), handshake_completed_(false), diff --git a/jingle/glue/fake_ssl_client_socket.h b/jingle/glue/fake_ssl_client_socket.h index f4a2040d94dbd1..862c73279f8c57 100644 --- a/jingle/glue/fake_ssl_client_socket.h +++ b/jingle/glue/fake_ssl_client_socket.h @@ -19,10 +19,10 @@ #include #include +#include #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/string_piece.h" #include "net/base/completion_callback.h" #include "net/base/net_errors.h" @@ -37,7 +37,8 @@ namespace jingle_glue { class FakeSSLClientSocket : public net::StreamSocket { public: - explicit FakeSSLClientSocket(scoped_ptr transport_socket); + explicit FakeSSLClientSocket( + std::unique_ptr transport_socket); ~FakeSSLClientSocket() override; @@ -97,7 +98,7 @@ class FakeSSLClientSocket : public net::StreamSocket { void OnVerifyServerHelloDone(int status); net::Error ProcessVerifyServerHelloDone(size_t read); - scoped_ptr transport_socket_; + std::unique_ptr transport_socket_; // During the handshake process, holds a value from HandshakeState. // STATE_NONE otherwise. diff --git a/jingle/glue/fake_ssl_client_socket_unittest.cc b/jingle/glue/fake_ssl_client_socket_unittest.cc index 583e1967e02fb4..5a03478ad8c158 100644 --- a/jingle/glue/fake_ssl_client_socket_unittest.cc +++ b/jingle/glue/fake_ssl_client_socket_unittest.cc @@ -6,13 +6,14 @@ #include #include + #include +#include #include #include #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "net/base/io_buffer.h" #include "net/base/ip_address.h" @@ -99,7 +100,7 @@ class FakeSSLClientSocketTest : public testing::Test { ~FakeSSLClientSocketTest() override {} - scoped_ptr MakeClientSocket() { + std::unique_ptr MakeClientSocket() { return mock_client_socket_factory_.CreateTransportClientSocket( net::AddressList(), NULL, NULL, net::NetLog::Source()); } @@ -273,11 +274,11 @@ class FakeSSLClientSocketTest : public testing::Test { base::MessageLoop message_loop_; net::MockClientSocketFactory mock_client_socket_factory_; - scoped_ptr static_socket_data_provider_; + std::unique_ptr static_socket_data_provider_; }; TEST_F(FakeSSLClientSocketTest, PassThroughMethods) { - scoped_ptr mock_client_socket(new MockClientSocket()); + std::unique_ptr mock_client_socket(new MockClientSocket()); const int kReceiveBufferSize = 10; const int kSendBufferSize = 20; net::IPEndPoint ip_endpoint(net::IPAddress::IPv4AllZeros(), 80); diff --git a/jingle/glue/proxy_resolving_client_socket.h b/jingle/glue/proxy_resolving_client_socket.h index 554c2012c5c9fa..9777ef776ee49a 100644 --- a/jingle/glue/proxy_resolving_client_socket.h +++ b/jingle/glue/proxy_resolving_client_socket.h @@ -10,10 +10,11 @@ #include +#include + #include "base/compiler_specific.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "net/base/completion_callback.h" #include "net/base/host_port_pair.h" @@ -93,10 +94,10 @@ class ProxyResolvingClientSocket : public net::StreamSocket { net::CompletionCallback proxy_resolve_callback_; net::CompletionCallback connect_callback_; - scoped_ptr network_session_; + std::unique_ptr network_session_; // The transport socket. - scoped_ptr transport_; + std::unique_ptr transport_; const net::SSLConfig ssl_config_; net::ProxyService::PacRequest* pac_request_; diff --git a/jingle/glue/proxy_resolving_client_socket_unittest.cc b/jingle/glue/proxy_resolving_client_socket_unittest.cc index bdd030578938bf..b6d5014f74c0c9 100644 --- a/jingle/glue/proxy_resolving_client_socket_unittest.cc +++ b/jingle/glue/proxy_resolving_client_socket_unittest.cc @@ -38,7 +38,7 @@ class ProxyResolvingClientSocketTest : public testing::Test { ProxyResolvingClientSocketTest() : url_request_context_getter_(new net::TestURLRequestContextGetter( base::ThreadTaskRunnerHandle::Get(), - scoped_ptr( + std::unique_ptr( new MyTestURLRequestContext))) {} ~ProxyResolvingClientSocketTest() override {} diff --git a/jingle/glue/resolving_client_socket_factory.h b/jingle/glue/resolving_client_socket_factory.h index d1b9fc1f389f42..994c40832893c1 100644 --- a/jingle/glue/resolving_client_socket_factory.h +++ b/jingle/glue/resolving_client_socket_factory.h @@ -5,7 +5,7 @@ #ifndef JINGLE_GLUE_RESOLVING_CLIENT_SOCKET_FACTORY_H_ #define JINGLE_GLUE_RESOLVING_CLIENT_SOCKET_FACTORY_H_ -#include "base/memory/scoped_ptr.h" +#include namespace net { class ClientSocketHandle; @@ -24,11 +24,11 @@ class ResolvingClientSocketFactory { public: virtual ~ResolvingClientSocketFactory() { } // Method to create a transport socket using a HostPortPair. - virtual scoped_ptr CreateTransportClientSocket( + virtual std::unique_ptr CreateTransportClientSocket( const net::HostPortPair& host_and_port) = 0; - virtual scoped_ptr CreateSSLClientSocket( - scoped_ptr transport_socket, + virtual std::unique_ptr CreateSSLClientSocket( + std::unique_ptr transport_socket, const net::HostPortPair& host_and_port) = 0; }; diff --git a/jingle/glue/thread_wrapper.cc b/jingle/glue/thread_wrapper.cc index 5dcf996b9722f9..38db614af56d41 100644 --- a/jingle/glue/thread_wrapper.cc +++ b/jingle/glue/thread_wrapper.cc @@ -36,7 +36,7 @@ base::LazyInstance > void JingleThreadWrapper::EnsureForCurrentMessageLoop() { if (JingleThreadWrapper::current() == nullptr) { base::MessageLoop* message_loop = base::MessageLoop::current(); - scoped_ptr wrapper = + std::unique_ptr wrapper = JingleThreadWrapper::WrapTaskRunner(message_loop->task_runner()); message_loop->AddDestructionObserver(wrapper.release()); } @@ -44,12 +44,13 @@ void JingleThreadWrapper::EnsureForCurrentMessageLoop() { DCHECK_EQ(rtc::Thread::Current(), current()); } -scoped_ptr JingleThreadWrapper::WrapTaskRunner( +std::unique_ptr JingleThreadWrapper::WrapTaskRunner( scoped_refptr task_runner) { DCHECK(!JingleThreadWrapper::current()); DCHECK(task_runner->BelongsToCurrentThread()); - scoped_ptr result(new JingleThreadWrapper(task_runner)); + std::unique_ptr result( + new JingleThreadWrapper(task_runner)); g_jingle_thread_wrapper.Get().Set(result.get()); return result; } diff --git a/jingle/glue/thread_wrapper.h b/jingle/glue/thread_wrapper.h index f1f79f1be33ab3..6b215fbc4c5fba 100644 --- a/jingle/glue/thread_wrapper.h +++ b/jingle/glue/thread_wrapper.h @@ -9,10 +9,10 @@ #include #include +#include #include "base/compiler_specific.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/synchronization/lock.h" #include "base/synchronization/waitable_event.h" @@ -41,7 +41,7 @@ class JingleThreadWrapper : public base::MessageLoop::DestructionObserver, // Creates JingleThreadWrapper for |task_runner| that runs tasks on the // current thread. - static scoped_ptr WrapTaskRunner( + static std::unique_ptr WrapTaskRunner( scoped_refptr task_runner); // Returns thread wrapper for the current thread or nullptr if it doesn't diff --git a/jingle/glue/utils.cc b/jingle/glue/utils.cc index 5a71779693c394..923f02130527c2 100644 --- a/jingle/glue/utils.cc +++ b/jingle/glue/utils.cc @@ -6,10 +6,11 @@ #include +#include + #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "base/values.h" #include "net/base/ip_address.h" #include "net/base/ip_endpoint.h" @@ -69,7 +70,7 @@ std::string SerializeP2PCandidate(const cricket::Candidate& candidate) { bool DeserializeP2PCandidate(const std::string& candidate_str, cricket::Candidate* candidate) { - scoped_ptr value( + std::unique_ptr value( base::JSONReader::Read(candidate_str, base::JSON_ALLOW_TRAILING_COMMAS)); if (!value.get() || !value->IsType(base::Value::TYPE_DICTIONARY)) { return false; diff --git a/jingle/glue/xmpp_client_socket_factory.cc b/jingle/glue/xmpp_client_socket_factory.cc index 8255aa3433cf98..7277ab44b7f2b3 100644 --- a/jingle/glue/xmpp_client_socket_factory.cc +++ b/jingle/glue/xmpp_client_socket_factory.cc @@ -31,25 +31,22 @@ XmppClientSocketFactory::XmppClientSocketFactory( XmppClientSocketFactory::~XmppClientSocketFactory() {} -scoped_ptr +std::unique_ptr XmppClientSocketFactory::CreateTransportClientSocket( const net::HostPortPair& host_and_port) { // TODO(akalin): Use socket pools. - scoped_ptr transport_socket( - new ProxyResolvingClientSocket( - NULL, - request_context_getter_, - ssl_config_, - host_and_port)); + std::unique_ptr transport_socket( + new ProxyResolvingClientSocket(NULL, request_context_getter_, ssl_config_, + host_and_port)); return (use_fake_ssl_client_socket_ - ? scoped_ptr( + ? std::unique_ptr( new FakeSSLClientSocket(std::move(transport_socket))) : std::move(transport_socket)); } -scoped_ptr +std::unique_ptr XmppClientSocketFactory::CreateSSLClientSocket( - scoped_ptr transport_socket, + std::unique_ptr transport_socket, const net::HostPortPair& host_and_port) { net::SSLClientSocketContext context; context.cert_verifier = diff --git a/jingle/glue/xmpp_client_socket_factory.h b/jingle/glue/xmpp_client_socket_factory.h index 986ede0cfa200e..9615ab4d6ea77f 100644 --- a/jingle/glue/xmpp_client_socket_factory.h +++ b/jingle/glue/xmpp_client_socket_factory.h @@ -36,11 +36,11 @@ class XmppClientSocketFactory : public ResolvingClientSocketFactory { ~XmppClientSocketFactory() override; // ResolvingClientSocketFactory implementation. - scoped_ptr CreateTransportClientSocket( + std::unique_ptr CreateTransportClientSocket( const net::HostPortPair& host_and_port) override; - scoped_ptr CreateSSLClientSocket( - scoped_ptr transport_socket, + std::unique_ptr CreateSSLClientSocket( + std::unique_ptr transport_socket, const net::HostPortPair& host_and_port) override; private: diff --git a/jingle/notifier/base/weak_xmpp_client_unittest.cc b/jingle/notifier/base/weak_xmpp_client_unittest.cc index 9630502f2be598..d55df72806734e 100644 --- a/jingle/notifier/base/weak_xmpp_client_unittest.cc +++ b/jingle/notifier/base/weak_xmpp_client_unittest.cc @@ -4,8 +4,9 @@ #include "jingle/notifier/base/weak_xmpp_client.h" +#include + #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" #include "jingle/glue/task_pump.h" @@ -62,7 +63,7 @@ class WeakXmppClientTest : public testing::Test { // Needed by TaskPump. base::MessageLoop message_loop_; - scoped_ptr task_pump_; + std::unique_ptr task_pump_; MockXmppDelegate mock_xmpp_delegate_; }; diff --git a/jingle/notifier/base/xmpp_connection.h b/jingle/notifier/base/xmpp_connection.h index 3abe18f6cbe70e..e41d91414dd538 100644 --- a/jingle/notifier/base/xmpp_connection.h +++ b/jingle/notifier/base/xmpp_connection.h @@ -7,10 +7,11 @@ #ifndef JINGLE_NOTIFIER_BASE_XMPP_CONNECTION_H_ #define JINGLE_NOTIFIER_BASE_XMPP_CONNECTION_H_ +#include + #include "base/gtest_prod_util.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/threading/non_thread_safe.h" #include "net/url_request/url_request_context_getter.h" @@ -93,7 +94,7 @@ class XmppConnection void ClearClient(); - scoped_ptr task_pump_; + std::unique_ptr task_pump_; base::WeakPtr weak_xmpp_client_; bool on_connect_called_; Delegate* delegate_; diff --git a/jingle/notifier/base/xmpp_connection_unittest.cc b/jingle/notifier/base/xmpp_connection_unittest.cc index 0e8266f04200dc..60645bbbaac254 100644 --- a/jingle/notifier/base/xmpp_connection_unittest.cc +++ b/jingle/notifier/base/xmpp_connection_unittest.cc @@ -76,7 +76,7 @@ class XmppConnectionTest : public testing::Test { protected: XmppConnectionTest() : mock_pre_xmpp_auth_(new MockPreXmppAuth()) { - scoped_ptr pump(new base::MessagePumpDefault()); + std::unique_ptr pump(new base::MessagePumpDefault()); message_loop_.reset(new base::MessageLoop(std::move(pump))); url_request_context_getter_ = new net::TestURLRequestContextGetter( @@ -91,9 +91,9 @@ class XmppConnectionTest : public testing::Test { } // Needed by XmppConnection. - scoped_ptr message_loop_; + std::unique_ptr message_loop_; MockXmppConnectionDelegate mock_xmpp_connection_delegate_; - scoped_ptr mock_pre_xmpp_auth_; + std::unique_ptr mock_pre_xmpp_auth_; scoped_refptr url_request_context_getter_; }; diff --git a/jingle/notifier/communicator/login.h b/jingle/notifier/communicator/login.h index 8f4f8d1ed7ee60..98e775435d19b6 100644 --- a/jingle/notifier/communicator/login.h +++ b/jingle/notifier/communicator/login.h @@ -5,12 +5,12 @@ #ifndef JINGLE_NOTIFIER_COMMUNICATOR_LOGIN_H_ #define JINGLE_NOTIFIER_COMMUNICATOR_LOGIN_H_ +#include #include #include "base/compiler_specific.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "base/timer/timer.h" @@ -118,7 +118,7 @@ class Login : public net::NetworkChangeNotifier::IPAddressObserver, Delegate* const delegate_; LoginSettings login_settings_; - scoped_ptr single_attempt_; + std::unique_ptr single_attempt_; // reconnection state. base::TimeDelta reconnect_interval_; diff --git a/jingle/notifier/communicator/single_login_attempt.h b/jingle/notifier/communicator/single_login_attempt.h index 47e79bf274037a..b31280b5803de2 100644 --- a/jingle/notifier/communicator/single_login_attempt.h +++ b/jingle/notifier/communicator/single_login_attempt.h @@ -5,9 +5,10 @@ #ifndef JINGLE_NOTIFIER_COMMUNICATOR_SINGLE_LOGIN_ATTEMPT_H_ #define JINGLE_NOTIFIER_COMMUNICATOR_SINGLE_LOGIN_ATTEMPT_H_ +#include + #include "base/compiler_specific.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "jingle/notifier/base/xmpp_connection.h" #include "jingle/notifier/communicator/connection_settings.h" #include "jingle/notifier/communicator/login_settings.h" @@ -73,7 +74,7 @@ class SingleLoginAttempt : public XmppConnection::Delegate { Delegate* const delegate_; const ConnectionSettingsList settings_list_; ConnectionSettingsList::const_iterator current_settings_; - scoped_ptr xmpp_connection_; + std::unique_ptr xmpp_connection_; DISALLOW_COPY_AND_ASSIGN(SingleLoginAttempt); }; diff --git a/jingle/notifier/communicator/single_login_attempt_unittest.cc b/jingle/notifier/communicator/single_login_attempt_unittest.cc index f14238a6dc7509..fb673a7b6347b9 100644 --- a/jingle/notifier/communicator/single_login_attempt_unittest.cc +++ b/jingle/notifier/communicator/single_login_attempt_unittest.cc @@ -5,9 +5,9 @@ #include "jingle/notifier/communicator/single_login_attempt.h" #include +#include #include "base/compiler_specific.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/thread_task_runner_handle.h" #include "jingle/notifier/base/const_communicator.h" @@ -71,7 +71,7 @@ class MyTestURLRequestContext : public net::TestURLRequestContext { public: MyTestURLRequestContext() : TestURLRequestContext(true) { context_storage_.set_host_resolver( - scoped_ptr(new net::HangingHostResolver())); + std::unique_ptr(new net::HangingHostResolver())); Init(); } ~MyTestURLRequestContext() override {} @@ -81,17 +81,16 @@ class SingleLoginAttemptTest : public ::testing::Test { protected: SingleLoginAttemptTest() : login_settings_( - buzz::XmppClientSettings(), - new net::TestURLRequestContextGetter( - base::ThreadTaskRunnerHandle::Get(), - scoped_ptr( - new MyTestURLRequestContext())), - ServerList( - 1, - ServerInformation( - net::HostPortPair("example.com", 100), SUPPORTS_SSLTCP)), - false /* try_ssltcp_first */, - "auth_mechanism"), + buzz::XmppClientSettings(), + new net::TestURLRequestContextGetter( + base::ThreadTaskRunnerHandle::Get(), + std::unique_ptr( + new MyTestURLRequestContext())), + ServerList(1, + ServerInformation(net::HostPortPair("example.com", 100), + SUPPORTS_SSLTCP)), + false /* try_ssltcp_first */, + "auth_mechanism"), attempt_(new SingleLoginAttempt(login_settings_, &fake_delegate_)) {} void TearDown() override { message_loop_.RunUntilIdle(); } @@ -110,7 +109,7 @@ class SingleLoginAttemptTest : public ::testing::Test { const LoginSettings login_settings_; protected: - scoped_ptr attempt_; + std::unique_ptr attempt_; FakeDelegate fake_delegate_; FakeBaseTask fake_base_task_; }; @@ -163,7 +162,7 @@ TEST_F(SingleLoginAttemptTest, Redirect) { net::HostPortPair("example.com", 1000), SUPPORTS_SSLTCP); - scoped_ptr redirect_error( + std::unique_ptr redirect_error( MakeRedirectError(redirect_server.server.ToString())); FireRedirect(redirect_error.get()); @@ -178,7 +177,7 @@ TEST_F(SingleLoginAttemptTest, RedirectHostOnly) { net::HostPortPair("example.com", kDefaultXmppPort), SUPPORTS_SSLTCP); - scoped_ptr redirect_error( + std::unique_ptr redirect_error( MakeRedirectError(redirect_server.server.host())); FireRedirect(redirect_error.get()); @@ -193,7 +192,7 @@ TEST_F(SingleLoginAttemptTest, RedirectZeroPort) { net::HostPortPair("example.com", kDefaultXmppPort), SUPPORTS_SSLTCP); - scoped_ptr redirect_error( + std::unique_ptr redirect_error( MakeRedirectError(redirect_server.server.host() + ":0")); FireRedirect(redirect_error.get()); @@ -208,7 +207,7 @@ TEST_F(SingleLoginAttemptTest, RedirectInvalidPort) { net::HostPortPair("example.com", kDefaultXmppPort), SUPPORTS_SSLTCP); - scoped_ptr redirect_error( + std::unique_ptr redirect_error( MakeRedirectError(redirect_server.server.host() + ":invalidport")); FireRedirect(redirect_error.get()); @@ -219,7 +218,8 @@ TEST_F(SingleLoginAttemptTest, RedirectInvalidPort) { // Fire an empty redirect and make sure the delegate does not get a // redirect. TEST_F(SingleLoginAttemptTest, RedirectEmpty) { - scoped_ptr redirect_error(MakeRedirectError(std::string())); + std::unique_ptr redirect_error( + MakeRedirectError(std::string())); FireRedirect(redirect_error.get()); EXPECT_EQ(IDLE, fake_delegate_.state()); } @@ -227,7 +227,8 @@ TEST_F(SingleLoginAttemptTest, RedirectEmpty) { // Fire a redirect with a missing text element and make sure the // delegate does not get a redirect. TEST_F(SingleLoginAttemptTest, RedirectMissingText) { - scoped_ptr redirect_error(MakeRedirectError(std::string())); + std::unique_ptr redirect_error( + MakeRedirectError(std::string())); redirect_error->RemoveChildAfter(redirect_error->FirstChild()); FireRedirect(redirect_error.get()); EXPECT_EQ(IDLE, fake_delegate_.state()); @@ -236,7 +237,8 @@ TEST_F(SingleLoginAttemptTest, RedirectMissingText) { // Fire a redirect with a missing see-other-host element and make sure // the delegate does not get a redirect. TEST_F(SingleLoginAttemptTest, RedirectMissingSeeOtherHost) { - scoped_ptr redirect_error(MakeRedirectError(std::string())); + std::unique_ptr redirect_error( + MakeRedirectError(std::string())); redirect_error->RemoveChildAfter(NULL); FireRedirect(redirect_error.get()); EXPECT_EQ(IDLE, fake_delegate_.state()); diff --git a/jingle/notifier/listener/non_blocking_push_client.cc b/jingle/notifier/listener/non_blocking_push_client.cc index ede7f6535f0221..3a9324e477bed9 100644 --- a/jingle/notifier/listener/non_blocking_push_client.cc +++ b/jingle/notifier/listener/non_blocking_push_client.cc @@ -56,7 +56,7 @@ class NonBlockingPushClient::Core const scoped_refptr delegate_task_runner_; const base::WeakPtr parent_push_client_; - scoped_ptr delegate_push_client_; + std::unique_ptr delegate_push_client_; DISALLOW_COPY_AND_ASSIGN(Core); }; diff --git a/jingle/notifier/listener/non_blocking_push_client.h b/jingle/notifier/listener/non_blocking_push_client.h index 5f5115ee9f46f3..555572a95a5fc7 100644 --- a/jingle/notifier/listener/non_blocking_push_client.h +++ b/jingle/notifier/listener/non_blocking_push_client.h @@ -5,11 +5,12 @@ #ifndef JINGLE_NOTIFIER_LISTENER_NON_BLOCKING_PUSH_CLIENT_H_ #define JINGLE_NOTIFIER_LISTENER_NON_BLOCKING_PUSH_CLIENT_H_ +#include + #include "base/callback_forward.h" #include "base/compiler_specific.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/threading/thread_checker.h" @@ -30,7 +31,7 @@ class NonBlockingPushClient : public PushClient { public: // The type for a function that creates a (blocking) PushClient. // Will be called on the delegate task runner. - typedef base::Callback()> + typedef base::Callback()> CreateBlockingPushClientCallback; // Runs the given callback on the given task runner, and delegates diff --git a/jingle/notifier/listener/non_blocking_push_client_unittest.cc b/jingle/notifier/listener/non_blocking_push_client_unittest.cc index 7c0dbb9261b616..a908cab766e2f0 100644 --- a/jingle/notifier/listener/non_blocking_push_client_unittest.cc +++ b/jingle/notifier/listener/non_blocking_push_client_unittest.cc @@ -5,9 +5,9 @@ #include "jingle/notifier/listener/non_blocking_push_client.h" #include +#include #include "base/compiler_specific.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/thread_task_runner_handle.h" #include "jingle/notifier/base/fake_base_task.h" @@ -48,18 +48,18 @@ class NonBlockingPushClientTest : public testing::Test { message_loop_.RunUntilIdle(); } - scoped_ptr CreateFakePushClient() { + std::unique_ptr CreateFakePushClient() { if (fake_push_client_) { ADD_FAILURE(); - return scoped_ptr(); + return std::unique_ptr(); } fake_push_client_ = new FakePushClient(); - return scoped_ptr(fake_push_client_); + return std::unique_ptr(fake_push_client_); } base::MessageLoop message_loop_; FakePushClientObserver fake_observer_; - scoped_ptr push_client_; + std::unique_ptr push_client_; // Owned by |push_client_|. FakePushClient* fake_push_client_; }; diff --git a/jingle/notifier/listener/push_client.cc b/jingle/notifier/listener/push_client.cc index f18ed52d30be31..b76d6d668efd4c 100644 --- a/jingle/notifier/listener/push_client.cc +++ b/jingle/notifier/listener/push_client.cc @@ -17,21 +17,21 @@ PushClient::~PushClient() {} namespace { -scoped_ptr CreateXmppPushClient( +std::unique_ptr CreateXmppPushClient( const NotifierOptions& notifier_options) { - return scoped_ptr(new XmppPushClient(notifier_options)); + return std::unique_ptr(new XmppPushClient(notifier_options)); } } // namespace -scoped_ptr PushClient::CreateDefault( +std::unique_ptr PushClient::CreateDefault( const NotifierOptions& notifier_options) { - return scoped_ptr(new NonBlockingPushClient( + return std::unique_ptr(new NonBlockingPushClient( notifier_options.request_context_getter->GetNetworkTaskRunner(), base::Bind(&CreateXmppPushClient, notifier_options))); } -scoped_ptr PushClient::CreateDefaultOnIOThread( +std::unique_ptr PushClient::CreateDefaultOnIOThread( const NotifierOptions& notifier_options) { CHECK(notifier_options.request_context_getter->GetNetworkTaskRunner()-> BelongsToCurrentThread()); diff --git a/jingle/notifier/listener/push_client.h b/jingle/notifier/listener/push_client.h index fd673373e201ee..1b831b7c2e267f 100644 --- a/jingle/notifier/listener/push_client.h +++ b/jingle/notifier/listener/push_client.h @@ -5,9 +5,9 @@ #ifndef JINGLE_NOTIFIER_LISTENER_PUSH_CLIENT_H_ #define JINGLE_NOTIFIER_LISTENER_PUSH_CLIENT_H_ +#include #include -#include "base/memory/scoped_ptr.h" #include "jingle/notifier/listener/notification_defines.h" namespace notifier { @@ -24,13 +24,13 @@ class PushClient { // Creates a default non-blocking PushClient implementation from the // given options. - static scoped_ptr CreateDefault( + static std::unique_ptr CreateDefault( const NotifierOptions& notifier_options); // Creates a default blocking PushClient implementation from the // given options. Must be called from the IO thread (according to // |notifier_options|). - static scoped_ptr CreateDefaultOnIOThread( + static std::unique_ptr CreateDefaultOnIOThread( const NotifierOptions& notifier_options); // Manage the list of observers for incoming notifications. diff --git a/jingle/notifier/listener/push_client_unittest.cc b/jingle/notifier/listener/push_client_unittest.cc index 1bf4e653293871..a2302f669806d4 100644 --- a/jingle/notifier/listener/push_client_unittest.cc +++ b/jingle/notifier/listener/push_client_unittest.cc @@ -4,10 +4,11 @@ #include "jingle/notifier/listener/push_client.h" +#include + #include "base/bind_helpers.h" #include "base/compiler_specific.h" #include "base/location.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/threading/thread.h" #include "jingle/notifier/base/notifier_options.h" @@ -35,7 +36,7 @@ class PushClientTest : public testing::Test { // Make sure calling CreateDefault on the IO thread doesn't blow up. TEST_F(PushClientTest, CreateDefaultOnIOThread) { - const scoped_ptr push_client( + const std::unique_ptr push_client( PushClient::CreateDefault(notifier_options_)); } @@ -53,7 +54,7 @@ TEST_F(PushClientTest, CreateDefaultOffIOThread) { // Make sure calling CreateDefaultOnIOThread on the IO thread doesn't // blow up. TEST_F(PushClientTest, CreateDefaultOnIOThreadOnIOThread) { - const scoped_ptr push_client( + const std::unique_ptr push_client( PushClient::CreateDefaultOnIOThread(notifier_options_)); } diff --git a/jingle/notifier/listener/push_notifications_send_update_task.cc b/jingle/notifier/listener/push_notifications_send_update_task.cc index ea0375bda56c09..68d632ac34cc4e 100644 --- a/jingle/notifier/listener/push_notifications_send_update_task.cc +++ b/jingle/notifier/listener/push_notifications_send_update_task.cc @@ -6,11 +6,11 @@ #include +#include #include #include "base/base64.h" #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "jingle/notifier/listener/notification_constants.h" #include "jingle/notifier/listener/xml_element_util.h" #include "third_party/webrtc/libjingle/xmllite/qname.h" @@ -28,9 +28,8 @@ PushNotificationsSendUpdateTask::PushNotificationsSendUpdateTask( PushNotificationsSendUpdateTask::~PushNotificationsSendUpdateTask() {} int PushNotificationsSendUpdateTask::ProcessStart() { - scoped_ptr stanza( - MakeUpdateMessage(notification_, - GetClient()->jid().BareJid())); + std::unique_ptr stanza( + MakeUpdateMessage(notification_, GetClient()->jid().BareJid())); DVLOG(1) << "Sending notification " << notification_.ToString() << " as stanza " << XmlElementToString(*stanza); if (SendStanza(stanza.get()) != buzz::XMPP_RETURN_OK) { diff --git a/jingle/notifier/listener/push_notifications_send_update_task_unittest.cc b/jingle/notifier/listener/push_notifications_send_update_task_unittest.cc index cfbd9f68b184f3..edd80a2ebe59ff 100644 --- a/jingle/notifier/listener/push_notifications_send_update_task_unittest.cc +++ b/jingle/notifier/listener/push_notifications_send_update_task_unittest.cc @@ -4,9 +4,10 @@ #include "jingle/notifier/listener/push_notifications_send_update_task.h" +#include + #include "base/base64.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/stringprintf.h" #include "jingle/notifier/listener/xml_element_util.h" #include "testing/gtest/include/gtest/gtest.h" @@ -39,9 +40,9 @@ TEST_F(PushNotificationsSendUpdateTaskTest, MakeUpdateMessage) { std::string base64_data; base::Base64Encode(notification.data, &base64_data); - scoped_ptr message( - PushNotificationsSendUpdateTask::MakeUpdateMessage( - notification, to_jid_bare_)); + std::unique_ptr message( + PushNotificationsSendUpdateTask::MakeUpdateMessage(notification, + to_jid_bare_)); std::string expected_xml_string = base::StringPrintf( diff --git a/jingle/notifier/listener/push_notifications_subscribe_task.cc b/jingle/notifier/listener/push_notifications_subscribe_task.cc index 753fc346ce5b13..ec7ec06219483d 100644 --- a/jingle/notifier/listener/push_notifications_subscribe_task.cc +++ b/jingle/notifier/listener/push_notifications_subscribe_task.cc @@ -4,10 +4,10 @@ #include "jingle/notifier/listener/push_notifications_subscribe_task.h" +#include #include #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "jingle/notifier/listener/notification_constants.h" #include "jingle/notifier/listener/xml_element_util.h" #include "third_party/webrtc/libjingle/xmllite/qname.h" @@ -40,9 +40,8 @@ bool PushNotificationsSubscribeTask::HandleStanza( int PushNotificationsSubscribeTask::ProcessStart() { DVLOG(1) << "Push notifications: Subscription task started."; - scoped_ptr iq_stanza( - MakeSubscriptionMessage(subscriptions_, GetClient()->jid(), - task_id())); + std::unique_ptr iq_stanza( + MakeSubscriptionMessage(subscriptions_, GetClient()->jid(), task_id())); DVLOG(1) << "Push notifications: Subscription stanza: " << XmlElementToString(*iq_stanza.get()); diff --git a/jingle/notifier/listener/push_notifications_subscribe_task_unittest.cc b/jingle/notifier/listener/push_notifications_subscribe_task_unittest.cc index d42db1131c0a6e..11530b17b85ae9 100644 --- a/jingle/notifier/listener/push_notifications_subscribe_task_unittest.cc +++ b/jingle/notifier/listener/push_notifications_subscribe_task_unittest.cc @@ -4,8 +4,9 @@ #include "jingle/notifier/listener/push_notifications_subscribe_task.h" +#include + #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "base/strings/stringprintf.h" #include "jingle/notifier/listener/xml_element_util.h" #include "testing/gtest/include/gtest/gtest.h" @@ -42,9 +43,9 @@ TEST_F(PushNotificationsSubscribeTaskTest, MakeSubscriptionMessage) { subscription.channel = "test_channel2"; subscription.from = "from.test2.com"; subscriptions.push_back(subscription); - scoped_ptr message( - PushNotificationsSubscribeTask::MakeSubscriptionMessage( - subscriptions, jid_, task_id_)); + std::unique_ptr message( + PushNotificationsSubscribeTask::MakeSubscriptionMessage(subscriptions, + jid_, task_id_)); std::string expected_xml_string = base::StringPrintf( " #include #include "base/logging.h" -#include "base/memory/scoped_ptr.h" #include "jingle/notifier/listener/xml_element_util.h" #include "third_party/webrtc/libjingle/xmllite/qname.h" #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" @@ -30,7 +30,7 @@ SendPingTask::~SendPingTask() { int SendPingTask::ProcessStart() { ping_task_id_ = task_id(); - scoped_ptr stanza(MakePingStanza(ping_task_id_)); + std::unique_ptr stanza(MakePingStanza(ping_task_id_)); DVLOG(1) << "Sending ping stanza " << XmlElementToString(*stanza); if (SendStanza(stanza.get()) != buzz::XMPP_RETURN_OK) { DLOG(WARNING) << "Could not send stanza " << XmlElementToString(*stanza); diff --git a/jingle/notifier/listener/send_ping_task_unittest.cc b/jingle/notifier/listener/send_ping_task_unittest.cc index 0b82b2b5efdf74..4f7f61d4d21306 100644 --- a/jingle/notifier/listener/send_ping_task_unittest.cc +++ b/jingle/notifier/listener/send_ping_task_unittest.cc @@ -4,9 +4,10 @@ #include "jingle/notifier/listener/send_ping_task.h" +#include + #include "base/base64.h" #include "base/macros.h" -#include "base/memory/scoped_ptr.h" #include "jingle/notifier/listener/xml_element_util.h" #include "testing/gtest/include/gtest/gtest.h" #include "webrtc/libjingle/xmpp/jid.h" @@ -28,7 +29,8 @@ class SendPingTaskTest : public testing::Test { TEST_F(SendPingTaskTest, MakePingStanza) { std::string task_id = "42"; - scoped_ptr message(SendPingTask::MakePingStanza(task_id)); + std::unique_ptr message( + SendPingTask::MakePingStanza(task_id)); std::string expected_xml_string(" #include #include -#include "base/memory/scoped_ptr.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/webrtc/libjingle/xmllite/qname.h" #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" @@ -31,24 +31,22 @@ TEST_F(XmlElementUtilTest, XmlElementToString) { } TEST_F(XmlElementUtilTest, MakeBoolXmlElement) { - scoped_ptr foo_false( - MakeBoolXmlElement("foo", false)); + std::unique_ptr foo_false(MakeBoolXmlElement("foo", false)); EXPECT_EQ("", XmlElementToString(*foo_false)); - scoped_ptr bar_true( - MakeBoolXmlElement("bar", true)); + std::unique_ptr bar_true(MakeBoolXmlElement("bar", true)); EXPECT_EQ("", XmlElementToString(*bar_true)); } TEST_F(XmlElementUtilTest, MakeIntXmlElement) { - scoped_ptr int_xml_element( + std::unique_ptr int_xml_element( MakeIntXmlElement("foo", 35)); EXPECT_EQ("", XmlElementToString(*int_xml_element)); } TEST_F(XmlElementUtilTest, MakeStringXmlElement) { - scoped_ptr string_xml_element( + std::unique_ptr string_xml_element( MakeStringXmlElement("foo", "bar")); EXPECT_EQ("", XmlElementToString(*string_xml_element)); diff --git a/jingle/notifier/listener/xmpp_push_client.h b/jingle/notifier/listener/xmpp_push_client.h index 71fe870c5be776..5cd826f5aa9f6b 100644 --- a/jingle/notifier/listener/xmpp_push_client.h +++ b/jingle/notifier/listener/xmpp_push_client.h @@ -5,13 +5,13 @@ #ifndef JINGLE_NOTIFIER_LISTENER_XMPP_PUSH_CLIENT_H_ #define JINGLE_NOTIFIER_LISTENER_XMPP_PUSH_CLIENT_H_ +#include #include #include #include "base/compiler_specific.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/threading/thread_checker.h" @@ -77,7 +77,7 @@ class XmppPushClient : SubscriptionList subscriptions_; buzz::XmppClientSettings xmpp_settings_; - scoped_ptr login_; + std::unique_ptr login_; // The XMPP connection. base::WeakPtr base_task_; diff --git a/jingle/notifier/listener/xmpp_push_client_unittest.cc b/jingle/notifier/listener/xmpp_push_client_unittest.cc index f282ca80b01dcf..f219356606e772 100644 --- a/jingle/notifier/listener/xmpp_push_client_unittest.cc +++ b/jingle/notifier/listener/xmpp_push_client_unittest.cc @@ -4,8 +4,9 @@ #include "jingle/notifier/listener/xmpp_push_client.h" +#include + #include "base/compiler_specific.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "jingle/notifier/base/fake_base_task.h" #include "jingle/notifier/base/notifier_options.h" @@ -56,7 +57,7 @@ class XmppPushClientTest : public testing::Test { base::MessageLoopForIO message_loop_; NotifierOptions notifier_options_; StrictMock mock_observer_; - scoped_ptr xmpp_push_client_; + std::unique_ptr xmpp_push_client_; FakeBaseTask fake_base_task_; }; diff --git a/remoting/client/jni/chromoting_jni_instance.cc b/remoting/client/jni/chromoting_jni_instance.cc index b16c92f21d5894..5ca09b9e8507d8 100644 --- a/remoting/client/jni/chromoting_jni_instance.cc +++ b/remoting/client/jni/chromoting_jni_instance.cc @@ -398,7 +398,7 @@ void ChromotingJniInstance::ConnectToHostOnNetworkThread() { client_.reset( new ChromotingClient(client_context_.get(), this, video_renderer_.get(), - make_scoped_ptr(new AudioPlayerAndroid()))); + base::WrapUnique(new AudioPlayerAndroid()))); signaling_.reset( new XmppSignalStrategy(net::ClientSocketFactory::GetDefaultFactory(),