Commit aa6fa234 authored by sergeyu's avatar sergeyu Committed by Commit bot

Use std::move() instead of scoped_ptr<>::Pass() in remoting/protocol

Now there is a presubmit check that doesn't allow Pass() anymore.
See https://www.chromium.org/rvalue-references for information
about std::move in chromium.

Review URL: https://codereview.chromium.org/1534193004

Cr-Commit-Position: refs/heads/master@{#366687}
parent 090adf5b
......@@ -116,12 +116,12 @@ void AuthenticatorTestBase::RunChannelAuth(bool expected_fail) {
client_fake_socket_->PairWith(host_fake_socket_.get());
client_auth_->SecureAndAuthenticate(
client_fake_socket_.Pass(),
std::move(client_fake_socket_),
base::Bind(&AuthenticatorTestBase::OnClientConnected,
base::Unretained(this)));
host_auth_->SecureAndAuthenticate(
host_fake_socket_.Pass(),
std::move(host_fake_socket_),
base::Bind(&AuthenticatorTestBase::OnHostConnected,
base::Unretained(this)));
......@@ -160,14 +160,14 @@ void AuthenticatorTestBase::OnHostConnected(
int error,
scoped_ptr<P2PStreamSocket> socket) {
host_callback_.OnDone(error);
host_socket_ = socket.Pass();
host_socket_ = std::move(socket);
}
void AuthenticatorTestBase::OnClientConnected(
int error,
scoped_ptr<P2PStreamSocket> socket) {
client_callback_.OnDone(error);
client_socket_ = socket.Pass();
client_socket_ = std::move(socket);
}
} // namespace protocol
......
......@@ -127,11 +127,11 @@ void CaptureScheduler::ProcessVideoAck(scoped_ptr<VideoAck> video_ack) {
void CaptureScheduler::SetTickClockForTest(
scoped_ptr<base::TickClock> tick_clock) {
tick_clock_ = tick_clock.Pass();
tick_clock_ = std::move(tick_clock);
}
void CaptureScheduler::SetTimerForTest(scoped_ptr<base::Timer> timer) {
capture_timer_ = timer.Pass();
capture_timer_ = std::move(timer);
}
void CaptureScheduler::SetNumOfProcessorsForTest(int num_of_processors) {
......
......@@ -61,7 +61,7 @@ class CaptureSchedulerTest : public testing::Test {
scoped_ptr<VideoAck> ack(new VideoAck());
ack->set_frame_id(packet.frame_id());
scheduler_->ProcessVideoAck(ack.Pass());
scheduler_->ProcessVideoAck(std::move(ack));
EXPECT_TRUE(capture_timer_->IsRunning());
EXPECT_EQ(std::max(base::TimeDelta(),
......
......@@ -39,7 +39,7 @@ void ChannelDispatcherBase::OnChannelReady(
}
channel_factory_ = nullptr;
channel_ = socket.Pass();
channel_ = std::move(socket);
writer_.Init(
base::Bind(&P2PStreamSocket::Write, base::Unretained(channel_.get())),
base::Bind(&ChannelDispatcherBase::OnReadWriteFailed,
......
......@@ -30,7 +30,7 @@ class PendingPacket {
public:
PendingPacket(scoped_ptr<MultiplexPacket> packet,
const base::Closure& done_task)
: packet(packet.Pass()),
: packet(std::move(packet)),
done_task(done_task),
pos(0U) {
}
......@@ -158,7 +158,7 @@ scoped_ptr<P2PStreamSocket> ChannelMultiplexer::MuxChannel::CreateSocket() {
DCHECK(!socket_); // Can't create more than one socket per channel.
scoped_ptr<MuxSocket> result(new MuxSocket(this));
socket_ = result.get();
return result.Pass();
return std::move(result);
}
void ChannelMultiplexer::MuxChannel::OnIncomingPacket(
......@@ -166,7 +166,7 @@ void ChannelMultiplexer::MuxChannel::OnIncomingPacket(
const base::Closure& done_task) {
DCHECK_EQ(packet->channel_id(), receive_id_);
if (packet->data().size() > 0) {
pending_packets_.push_back(new PendingPacket(packet.Pass(), done_task));
pending_packets_.push_back(new PendingPacket(std::move(packet), done_task));
if (socket_) {
// Notify the socket that we have more data.
socket_->OnPacketReceived();
......@@ -192,7 +192,7 @@ void ChannelMultiplexer::MuxChannel::DoWrite(
packet->set_channel_name(name_);
id_sent_ = true;
}
multiplexer_->DoWrite(packet.Pass(), done_task);
multiplexer_->DoWrite(std::move(packet), done_task);
}
int ChannelMultiplexer::MuxChannel::DoRead(
......@@ -258,7 +258,7 @@ int ChannelMultiplexer::MuxSocket::Write(
packet->mutable_data()->assign(buffer->data(), size);
write_pending_ = true;
channel_->DoWrite(packet.Pass(), base::Bind(
channel_->DoWrite(std::move(packet), base::Bind(
&ChannelMultiplexer::MuxSocket::OnWriteComplete, AsWeakPtr()));
// OnWriteComplete() might be called above synchronously.
......@@ -363,7 +363,7 @@ void ChannelMultiplexer::CancelChannelCreation(const std::string& name) {
void ChannelMultiplexer::OnBaseChannelReady(
scoped_ptr<P2PStreamSocket> socket) {
base_channel_factory_ = nullptr;
base_channel_ = socket.Pass();
base_channel_ = std::move(socket);
if (base_channel_.get()) {
// Initialize reader and writer.
......@@ -396,7 +396,7 @@ void ChannelMultiplexer::DoCreatePendingChannels() {
scoped_ptr<P2PStreamSocket> socket;
if (base_channel_.get())
socket = GetOrCreateChannel(c.name)->CreateSocket();
c.callback.Run(socket.Pass());
c.callback.Run(std::move(socket));
}
ChannelMultiplexer::MuxChannel* ChannelMultiplexer::GetOrCreateChannel(
......@@ -459,7 +459,7 @@ void ChannelMultiplexer::OnIncomingPacket(scoped_ptr<MultiplexPacket> packet,
channels_by_receive_id_[receive_id] = channel;
}
channel->OnIncomingPacket(packet.Pass(), done_task);
channel->OnIncomingPacket(std::move(packet), done_task);
}
void ChannelMultiplexer::DoWrite(scoped_ptr<MultiplexPacket> packet,
......
......@@ -104,7 +104,7 @@ class ChannelMultiplexerTest : public testing::Test {
scoped_ptr<P2PStreamSocket>* storage,
int* counter,
scoped_ptr<P2PStreamSocket> socket) {
*storage = socket.Pass();
*storage = std::move(socket);
--(*counter);
EXPECT_GE(*counter, 0);
if (*counter == 0)
......
......@@ -137,7 +137,7 @@ scoped_ptr<ChromiumPortAllocator> ChromiumPortAllocator::Create(
scoped_ptr<rtc::PacketSocketFactory> socket_factory(
new ChromiumPacketSocketFactory());
return make_scoped_ptr(new ChromiumPortAllocator(
url_context, network_manager.Pass(), socket_factory.Pass()));
url_context, std::move(network_manager), std::move(socket_factory)));
}
ChromiumPortAllocator::ChromiumPortAllocator(
......@@ -148,8 +148,8 @@ ChromiumPortAllocator::ChromiumPortAllocator(
socket_factory.get(),
std::string()),
url_context_(url_context),
network_manager_(network_manager.Pass()),
socket_factory_(socket_factory.Pass()) {}
network_manager_(std::move(network_manager)),
socket_factory_(std::move(socket_factory)) {}
ChromiumPortAllocator::~ChromiumPortAllocator() {}
......
......@@ -43,7 +43,8 @@ void ClientVideoDispatcher::ProcessVideoPacket(
int frame_id = video_packet->frame_id();
if (!video_packet->has_frame_id()) {
video_stub_->ProcessVideoPacket(video_packet.Pass(), done_runner.Release());
video_stub_->ProcessVideoPacket(std::move(video_packet),
done_runner.Release());
return;
}
......@@ -51,7 +52,7 @@ void ClientVideoDispatcher::ProcessVideoPacket(
pending_frames_.insert(pending_frames_.end(), PendingFrame(frame_id));
video_stub_->ProcessVideoPacket(
video_packet.Pass(),
std::move(video_packet),
base::Bind(&ClientVideoDispatcher::OnPacketDone,
weak_factory_.GetWeakPtr(), pending_frame));
}
......
......@@ -108,7 +108,7 @@ class ConnectionTest : public testing::Test,
OnConnectionState(ConnectionToHost::CONNECTED, OK));
}
client_connection_->Connect(owned_client_session_.Pass(),
client_connection_->Connect(std::move(owned_client_session_),
&client_event_handler_);
client_session_->SimulateConnection(host_session_);
base::RunLoop().RunUntilIdle();
......@@ -150,7 +150,7 @@ TEST_P(ConnectionTest, RejectConnection) {
EXPECT_CALL(client_event_handler_,
OnConnectionState(ConnectionToHost::CLOSED, OK));
client_connection_->Connect(owned_client_session_.Pass(),
client_connection_->Connect(std::move(owned_client_session_),
&client_event_handler_);
client_session_->event_handler()->OnSessionStateChange(Session::CLOSED);
}
......
......@@ -115,8 +115,8 @@ bool ParseChannelConfig(const XmlElement* element, bool codec_required,
ContentDescription::ContentDescription(
scoped_ptr<CandidateSessionConfig> config,
scoped_ptr<buzz::XmlElement> authenticator_message)
: candidate_config_(config.Pass()),
authenticator_message_(authenticator_message.Pass()) {
: candidate_config_(std::move(config)),
authenticator_message_(std::move(authenticator_message)) {
}
ContentDescription::~ContentDescription() { }
......@@ -235,8 +235,8 @@ scoped_ptr<ContentDescription> ContentDescription::ParseXml(
if (child)
authenticator_message.reset(new XmlElement(*child));
return make_scoped_ptr(
new ContentDescription(config.Pass(), authenticator_message.Pass()));
return make_scoped_ptr(new ContentDescription(
std::move(config), std::move(authenticator_message)));
}
} // namespace protocol
......
......@@ -19,7 +19,7 @@ TEST(ContentDescriptionTest, FormatAndParse) {
scoped_ptr<CandidateSessionConfig> config =
CandidateSessionConfig::CreateDefault();
ContentDescription description(
config.Pass(), Authenticator::CreateEmptyAuthenticatorMessage());
std::move(config), Authenticator::CreateEmptyAuthenticatorMessage());
scoped_ptr<buzz::XmlElement> xml(description.ToXml());
LOG(ERROR) << xml->Str();
scoped_ptr<ContentDescription> parsed(
......
......@@ -33,7 +33,7 @@ FakeChannelAuthenticator::~FakeChannelAuthenticator() {
void FakeChannelAuthenticator::SecureAndAuthenticate(
scoped_ptr<P2PStreamSocket> socket,
const DoneCallback& done_callback) {
socket_ = socket.Pass();
socket_ = std::move(socket);
if (async_) {
done_callback_ = done_callback;
......@@ -87,7 +87,7 @@ void FakeChannelAuthenticator::OnAuthBytesRead(int result) {
void FakeChannelAuthenticator::CallDoneCallback() {
if (result_ != net::OK)
socket_.reset();
base::ResetAndReturn(&done_callback_).Run(result_, socket_.Pass());
base::ResetAndReturn(&done_callback_).Run(result_, std::move(socket_));
}
FakeAuthenticator::FakeAuthenticator(Type type,
......@@ -185,7 +185,7 @@ scoped_ptr<buzz::XmlElement> FakeAuthenticator::GetNextMessage() {
}
++messages_;
return result.Pass();
return result;
}
const std::string& FakeAuthenticator::GetAuthKey() const {
......@@ -215,12 +215,10 @@ scoped_ptr<Authenticator> FakeHostAuthenticatorFactory::CreateAuthenticator(
const std::string& local_jid,
const std::string& remote_jid,
const buzz::XmlElement* first_message) {
FakeAuthenticator* authenticator = new FakeAuthenticator(
FakeAuthenticator::HOST, round_trips_, action_, async_);
scoped_ptr<FakeAuthenticator> authenticator(new FakeAuthenticator(
FakeAuthenticator::HOST, round_trips_, action_, async_));
authenticator->set_messages_till_started(messages_till_started_);
scoped_ptr<Authenticator> result(authenticator);
return result.Pass();
return std::move(authenticator);
}
} // namespace protocol
......
......@@ -30,7 +30,7 @@ base::WeakPtr<FakeVideoStream> FakeVideoStream::GetWeakPtr() {
}
FakeConnectionToClient::FakeConnectionToClient(scoped_ptr<Session> session)
: session_(session.Pass()) {}
: session_(std::move(session)) {}
FakeConnectionToClient::~FakeConnectionToClient() {}
......@@ -42,7 +42,7 @@ scoped_ptr<VideoStream> FakeConnectionToClient::StartVideoStream(
scoped_ptr<webrtc::DesktopCapturer> desktop_capturer) {
scoped_ptr<FakeVideoStream> result(new FakeVideoStream());
last_video_stream_ = result->GetWeakPtr();
return result.Pass();
return std::move(result);
}
AudioStub* FakeConnectionToClient::audio_stub() {
......
......@@ -175,7 +175,7 @@ void FakeDatagramChannelFactory::CreateChannel(
weak_factory_.GetWeakPtr(), base::Passed(&channel),
name, callback));
} else {
NotifyChannelCreated(channel.Pass(), name, callback);
NotifyChannelCreated(std::move(channel), name, callback);
}
}
......@@ -184,7 +184,7 @@ void FakeDatagramChannelFactory::NotifyChannelCreated(
const std::string& name,
const ChannelCreatedCallback& callback) {
if (channels_.find(name) != channels_.end())
callback.Run(owned_socket.Pass());
callback.Run(std::move(owned_socket));
}
void FakeDatagramChannelFactory::CancelChannelCreation(
......
......@@ -118,7 +118,7 @@ scoped_ptr<webrtc::DesktopFrame> DefaultFrameGenerator::GenerateFrame(
box_pos_x_, box_pos_y_, kBoxWidth, kBoxHeight));
}
return frame.Pass();
return frame;
}
} // namespace
......
......@@ -186,7 +186,7 @@ void FakeStreamChannelFactory::CreateChannel(
&FakeStreamChannelFactory::NotifyChannelCreated,
weak_factory_.GetWeakPtr(), base::Passed(&channel), name, callback));
} else {
NotifyChannelCreated(channel.Pass(), name, callback);
NotifyChannelCreated(std::move(channel), name, callback);
}
}
......@@ -195,7 +195,7 @@ void FakeStreamChannelFactory::NotifyChannelCreated(
const std::string& name,
const ChannelCreatedCallback& callback) {
if (channels_.find(name) != channels_.end())
callback.Run(owned_channel.Pass());
callback.Run(std::move(owned_channel));
}
void FakeStreamChannelFactory::CancelChannelCreation(const std::string& name) {
......
......@@ -32,7 +32,7 @@ void HostVideoDispatcher::ProcessVideoPacket(scoped_ptr<VideoPacket> packet,
void HostVideoDispatcher::OnVideoAck(scoped_ptr<VideoAck> ack,
const base::Closure& done) {
if (video_feedback_stub_)
video_feedback_stub_->ProcessVideoAck(ack.Pass());
video_feedback_stub_->ProcessVideoAck(std::move(ack));
done.Run();
}
......
......@@ -29,9 +29,9 @@ scoped_ptr<VideoEncoder> CreateVideoEncoder(
const protocol::ChannelConfig& video_config = config.video_config();
if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) {
return VideoEncoderVpx::CreateForVP8().Pass();
return VideoEncoderVpx::CreateForVP8();
} else if (video_config.codec == protocol::ChannelConfig::CODEC_VP9) {
return VideoEncoderVpx::CreateForVP9().Pass();
return VideoEncoderVpx::CreateForVP9();
} else if (video_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) {
return make_scoped_ptr(new VideoEncoderVerbatim());
}
......@@ -46,7 +46,7 @@ IceConnectionToClient::IceConnectionToClient(
scoped_ptr<protocol::Session> session,
scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner)
: event_handler_(nullptr),
session_(session.Pass()),
session_(std::move(session)),
video_encode_task_runner_(video_encode_task_runner),
control_dispatcher_(new HostControlDispatcher()),
event_dispatcher_(new HostEventDispatcher()),
......@@ -92,10 +92,10 @@ scoped_ptr<VideoStream> IceConnectionToClient::StartVideoStream(
DCHECK(video_encoder);
scoped_ptr<VideoFramePump> pump(
new VideoFramePump(video_encode_task_runner_, desktop_capturer.Pass(),
video_encoder.Pass(), video_dispatcher_.get()));
new VideoFramePump(video_encode_task_runner_, std::move(desktop_capturer),
std::move(video_encoder), video_dispatcher_.get()));
video_dispatcher_->set_video_feedback_stub(pump->video_feedback_stub());
return pump.Pass();
return std::move(pump);
}
AudioStub* IceConnectionToClient::audio_stub() {
......
......@@ -33,7 +33,7 @@ void IceConnectionToHost::Connect(scoped_ptr<Session> session,
DCHECK(clipboard_stub_);
DCHECK(monitored_video_stub_);
session_ = session.Pass();
session_ = std::move(session);
session_->SetEventHandler(this);
event_callback_ = event_callback;
......
......@@ -91,7 +91,7 @@ void IceTransportChannel::OnPortAllocatorCreated(
scoped_ptr<cricket::PortAllocator> port_allocator){
DCHECK(!channel_.get());
port_allocator_ = port_allocator.Pass();
port_allocator_ = std::move(port_allocator);
// Create P2PTransportChannel, attach signal handlers and connect it.
// TODO(sergeyu): Specify correct component ID for the channel.
......@@ -144,7 +144,7 @@ void IceTransportChannel::NotifyConnected() {
new TransportChannelSocketAdapter(channel_.get()));
socket->SetOnDestroyedCallback(base::Bind(
&IceTransportChannel::OnChannelDestroyed, base::Unretained(this)));
base::ResetAndReturn(&callback_).Run(socket.Pass());
base::ResetAndReturn(&callback_).Run(std::move(socket));
}
void IceTransportChannel::SetRemoteCredentials(const std::string& ufrag,
......
......@@ -76,7 +76,7 @@ class TestTransportEventHandler : public Transport::EventHandler {
// Transport::EventHandler interface.
void OnOutgoingTransportInfo(scoped_ptr<buzz::XmlElement> message) override {
transport_info_callback_.Run(message.Pass());
transport_info_callback_.Run(std::move(message));
}
void OnTransportRouteChange(const std::string& channel_name,
const TransportRoute& route) override {}
......@@ -185,12 +185,12 @@ class IceTransportTest : public testing::Test {
}
void OnClientChannelCreated(scoped_ptr<P2PStreamSocket> socket) {
client_socket_ = socket.Pass();
client_socket_ = std::move(socket);
client_channel_callback_.OnDone(client_socket_.get());
}
void OnHostChannelCreated(scoped_ptr<P2PStreamSocket> socket) {
host_socket_ = socket.Pass();
host_socket_ = std::move(socket);
host_channel_callback_.OnDone(host_socket_.get());
}
......
......@@ -306,7 +306,7 @@ scoped_ptr<buzz::XmlElement> JingleMessage::ToXml() const {
if (action == SESSION_INFO) {
if (info.get())
jingle_tag->AddElement(new XmlElement(*info.get()));
return root.Pass();
return root;
}
if (action == SESSION_INITIATE)
......@@ -339,7 +339,7 @@ scoped_ptr<buzz::XmlElement> JingleMessage::ToXml() const {
content_tag->AddElement(new XmlElement(*transport_info));
}
return root.Pass();
return root;
}
JingleMessageReply::JingleMessageReply()
......@@ -372,7 +372,7 @@ scoped_ptr<buzz::XmlElement> JingleMessageReply::ToXml(
if (type == REPLY_RESULT) {
iq->SetAttr(QName(kEmptyNamespace, "type"), "result");
return iq.Pass();
return iq;
}
DCHECK_EQ(type, REPLY_ERROR);
......@@ -440,7 +440,7 @@ scoped_ptr<buzz::XmlElement> JingleMessageReply::ToXml(
error->AddElement(text_elem);
}
return iq.Pass();
return iq;
}
IceTransportInfo::IceTransportInfo() {}
......@@ -485,7 +485,7 @@ scoped_ptr<buzz::XmlElement> IceTransportInfo::ToXml() const {
for (const NamedCandidate& candidate : candidates) {
result->AddElement(FormatIceCandidate(candidate));
}
return result.Pass();
return result;
}
} // namespace protocol
......
......@@ -96,7 +96,7 @@ void JingleSession::StartConnection(const std::string& peer_jid,
DCHECK_EQ(authenticator->state(), Authenticator::MESSAGE_READY);
peer_jid_ = peer_jid;
authenticator_ = authenticator.Pass();
authenticator_ = std::move(authenticator);
// Generate random session ID. There are usually not more than 1
// concurrent session per host, so a random 64-bit integer provides
......@@ -128,7 +128,7 @@ void JingleSession::InitializeIncomingConnection(
DCHECK_EQ(authenticator->state(), Authenticator::WAITING_MESSAGE);
peer_jid_ = initiate_message.from;
authenticator_ = authenticator.Pass();
authenticator_ = std::move(authenticator);
session_id_ = initiate_message.sid;
SetState(ACCEPTING);
......@@ -182,7 +182,7 @@ void JingleSession::ContinueAcceptIncomingConnection() {
auth_message = authenticator_->GetNextMessage();
message.description.reset(new ContentDescription(
CandidateSessionConfig::CreateFrom(*config_), auth_message.Pass()));
CandidateSessionConfig::CreateFrom(*config_), std::move(auth_message)));
SendMessage(message);
// Update state.
......@@ -326,7 +326,7 @@ void JingleSession::OnOutgoingTransportInfo(
DCHECK(CalledOnValidThread());
JingleMessage message(peer_jid_, JingleMessage::TRANSPORT_INFO, session_id_);
message.transport_info = transport_info.Pass();
message.transport_info = std::move(transport_info);
scoped_ptr<IqRequest> request = session_manager_->iq_sender()->SendIq(
message.ToXml(), base::Bind(&JingleSession::OnTransportInfoResponse,
......
......@@ -23,7 +23,7 @@ namespace protocol {
JingleSessionManager::JingleSessionManager(
scoped_ptr<TransportFactory> transport_factory,
SignalStrategy* signal_strategy)
: transport_factory_(transport_factory.Pass()),
: transport_factory_(std::move(transport_factory)),
signal_strategy_(signal_strategy),
protocol_config_(CandidateSessionConfig::CreateDefault()),
iq_sender_(new IqSender(signal_strategy_)) {
......@@ -43,22 +43,22 @@ void JingleSessionManager::AcceptIncoming(
void JingleSessionManager::set_protocol_config(
scoped_ptr<CandidateSessionConfig> config) {
protocol_config_ = config.Pass();
protocol_config_ = std::move(config);
}
scoped_ptr<Session> JingleSessionManager::Connect(
const std::string& host_jid,
scoped_ptr<Authenticator> authenticator) {
scoped_ptr<JingleSession> session(new JingleSession(this));
session->StartConnection(host_jid, authenticator.Pass());
session->StartConnection(host_jid, std::move(authenticator));
sessions_[session->session_id_] = session.get();
return session.Pass();
return std::move(session);
}
void JingleSessionManager::set_authenticator_factory(
scoped_ptr<AuthenticatorFactory> authenticator_factory) {
DCHECK(CalledOnValidThread());
authenticator_factory_ = authenticator_factory.Pass();
authenticator_factory_ = std::move(authenticator_factory);
}
void JingleSessionManager::OnSignalStrategyStateChange(
......@@ -88,7 +88,7 @@ bool JingleSessionManager::OnSignalStrategyIncomingStanza(
message.description->authenticator_message());
JingleSession* session = new JingleSession(this);
session->InitializeIncomingConnection(message, authenticator.Pass());
session->InitializeIncomingConnection(message, std::move(authenticator));
sessions_[session->session_id_] = session;
// Destroy the session if it was rejected due to incompatible protocol.
......
......@@ -115,7 +115,7 @@ class JingleSessionTest : public testing::Test {
scoped_ptr<AuthenticatorFactory> factory(
new FakeHostAuthenticatorFactory(auth_round_trips,
messages_till_start, auth_action, true));
host_server_->set_authenticator_factory(factory.Pass());
host_server_->set_authenticator_factory(std::move(factory));
client_server_.reset(new JingleSessionManager(
make_scoped_ptr(new IceTransportFactory(new TransportContext(
......@@ -195,7 +195,8 @@ class JingleSessionTest : public testing::Test {
scoped_ptr<Authenticator> authenticator(new FakeAuthenticator(
FakeAuthenticator::CLIENT, auth_round_trips, auth_action, true));
client_session_ = client_server_->Connect(kHostJid, authenticator.Pass());
client_session_ =
client_server_->Connect(kHostJid, std::move(authenticator));
client_session_->SetEventHandler(&client_session_event_handler_);
base::RunLoop().RunUntilIdle();
......@@ -252,7 +253,7 @@ TEST_F(JingleSessionTest, RejectConnection) {
scoped_ptr<Authenticator> authenticator(new FakeAuthenticator(
FakeAuthenticator::CLIENT, 1, FakeAuthenticator::ACCEPT, true));
client_session_ = client_server_->Connect(kHostJid, authenticator.Pass());
client_session_ = client_server_->Connect(kHostJid, std::move(authenticator));
client_session_->SetEventHandler(&client_session_event_handler_);
base::RunLoop().RunUntilIdle();
......@@ -309,8 +310,8 @@ TEST_F(JingleSessionTest, TestIncompatibleProtocol) {
CandidateSessionConfig::CreateDefault();
// Disable all video codecs so the host will reject connection.
config->mutable_video_configs()->clear();
client_server_->set_protocol_config(config.Pass());
client_session_ = client_server_->Connect(kHostJid, authenticator.Pass());
client_server_->set_protocol_config(std::move(config));
client_session_ = client_server_->Connect(kHostJid, std::move(authenticator));
client_session_->SetEventHandler(&client_session_event_handler_);
base::RunLoop().RunUntilIdle();
......@@ -335,8 +336,8 @@ TEST_F(JingleSessionTest, TestLegacyIceConnection) {
scoped_ptr<CandidateSessionConfig> config =
CandidateSessionConfig::CreateDefault();
config->set_ice_supported(false);
client_server_->set_protocol_config(config.Pass());
client_session_ = client_server_->Connect(kHostJid, authenticator.Pass());
client_server_->set_protocol_config(std::move(config));
client_session_ = client_server_->Connect(kHostJid, std::move(authenticator));
client_session_->SetEventHandler(&client_session_event_handler_);
base::RunLoop().RunUntilIdle();
......@@ -364,7 +365,7 @@ TEST_F(JingleSessionTest, DeleteSessionOnIncomingConnection) {
scoped_ptr<Authenticator> authenticator(new FakeAuthenticator(
FakeAuthenticator::CLIENT, 3, FakeAuthenticator::ACCEPT, true));
client_session_ = client_server_->Connect(kHostJid, authenticator.Pass());
client_session_ = client_server_->Connect(kHostJid, std::move(authenticator));
base::RunLoop().RunUntilIdle();
}
......@@ -391,7 +392,7 @@ TEST_F(JingleSessionTest, DeleteSessionOnAuth) {
scoped_ptr<Authenticator> authenticator(new FakeAuthenticator(
FakeAuthenticator::CLIENT, 3, FakeAuthenticator::ACCEPT, true));
client_session_ = client_server_->Connect(kHostJid, authenticator.Pass());
client_session_ = client_server_->Connect(kHostJid, std::move(authenticator));
base::RunLoop().RunUntilIdle();
}
......
......@@ -81,7 +81,7 @@ Me2MeHostAuthenticatorFactory::CreateWithSharedSecret(
result->key_pair_ = key_pair;
result->shared_secret_hash_ = shared_secret_hash;
result->pairing_registry_ = pairing_registry;
return result.Pass();
return std::move(result);
}
......@@ -100,8 +100,8 @@ Me2MeHostAuthenticatorFactory::CreateWithThirdPartyAuth(
result->host_owner_ = host_owner;
result->local_cert_ = local_cert;
result->key_pair_ = key_pair;