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

Unified Diff: remoting/protocol/fake_authenticator.cc

Issue 1534193004: Use std::move() instead of scoped_ptr<>::Pass(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: remoting/protocol/fake_authenticator.cc
diff --git a/remoting/protocol/fake_authenticator.cc b/remoting/protocol/fake_authenticator.cc
index 1bd44c6c3dbb4f451ab76bfa72eef24e3b57f6ce..5cb2f21dd59bad821b33da6b80e56f0eb67e0c6d 100644
--- a/remoting/protocol/fake_authenticator.cc
+++ b/remoting/protocol/fake_authenticator.cc
@@ -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);
Jamie 2015/12/22 12:23:36 I don't think you need move here (https://www.chro
Sergey Ulanov 2015/12/22 18:07:35 This return statement requires upcast from FakeAut
}
} // namespace protocol

Powered by Google App Engine
This is Rietveld 408576698