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 2d8dc11ffb40e215b45c9ad5402dd7c5098c2de4..a1e8831ee8919eb004a37f63d93d4f5faa6e1fc3 100644 |
--- a/remoting/host/native_messaging/pipe_messaging_channel.cc |
+++ b/remoting/host/native_messaging/pipe_messaging_channel.cc |
@@ -4,6 +4,8 @@ |
#include "remoting/host/native_messaging/pipe_messaging_channel.h" |
+#include <utility> |
+ |
#include "base/bind.h" |
#include "base/callback.h" |
#include "base/callback_helpers.h" |
@@ -43,19 +45,16 @@ 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(); |
} |
-PipeMessagingChannel::~PipeMessagingChannel() { |
-} |
+PipeMessagingChannel::~PipeMessagingChannel() {} |
void PipeMessagingChannel::Start(EventHandler* event_handler) { |
DCHECK(CalledOnValidThread()); |
@@ -73,11 +72,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_; |