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

Unified Diff: remoting/host/native_messaging/pipe_messaging_channel.cc

Issue 1549493004: Use std::move() instead of .Pass() in remoting/host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_not_pass
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/host/native_messaging/pipe_messaging_channel.cc
diff --git a/remoting/host/native_messaging/pipe_messaging_channel.cc b/remoting/host/native_messaging/pipe_messaging_channel.cc
index becd71014efabca618ff6561deac1b9af1a6167d..633998e58b43c7af6505565b99beb93b592d1d88 100644
--- a/remoting/host/native_messaging/pipe_messaging_channel.cc
+++ b/remoting/host/native_messaging/pipe_messaging_channel.cc
@@ -43,12 +43,10 @@ base::File DuplicatePlatformFile(base::File file) {
namespace remoting {
-PipeMessagingChannel::PipeMessagingChannel(
- base::File input,
- base::File output)
- : native_messaging_reader_(DuplicatePlatformFile(input.Pass())),
- native_messaging_writer_(new NativeMessagingWriter(
- DuplicatePlatformFile(output.Pass()))),
+PipeMessagingChannel::PipeMessagingChannel(base::File input, base::File output)
+ : native_messaging_reader_(DuplicatePlatformFile(std::move(input))),
+ native_messaging_writer_(
+ new NativeMessagingWriter(DuplicatePlatformFile(std::move(output)))),
event_handler_(nullptr),
weak_factory_(this) {
weak_ptr_ = weak_factory_.GetWeakPtr();
@@ -73,11 +71,10 @@ void PipeMessagingChannel::ProcessMessage(scoped_ptr<base::Value> message) {
DCHECK(CalledOnValidThread());
if (event_handler_)
- event_handler_->OnMessage(message.Pass());
+ event_handler_->OnMessage(std::move(message));
}
-void PipeMessagingChannel::SendMessage(
- scoped_ptr<base::Value> message) {
+void PipeMessagingChannel::SendMessage(scoped_ptr<base::Value> message) {
DCHECK(CalledOnValidThread());
bool success = message && native_messaging_writer_;

Powered by Google App Engine
This is Rietveld 408576698