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

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: include <utility> 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 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_;
« no previous file with comments | « remoting/host/native_messaging/native_messaging_writer_unittest.cc ('k') | remoting/host/oauth_token_getter_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698