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

Unified Diff: device/serial/serial_connection.cc

Issue 1544323002: Convert Pass()→std::move() in //device (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
« no previous file with comments | « device/serial/data_source_unittest.cc ('k') | device/serial/serial_connection_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/serial/serial_connection.cc
diff --git a/device/serial/serial_connection.cc b/device/serial/serial_connection.cc
index 6830cb39f3253074f6b29e099ea890fec8910030..249b892b244859f7e6b8493ed30028b55179fd0f 100644
--- a/device/serial/serial_connection.cc
+++ b/device/serial/serial_connection.cc
@@ -4,6 +4,8 @@
#include "device/serial/serial_connection.h"
+#include <utility>
+
#include "base/bind.h"
#include "device/serial/buffer.h"
#include "device/serial/data_sink_receiver.h"
@@ -18,14 +20,14 @@ SerialConnection::SerialConnection(
mojo::InterfaceRequest<serial::DataSource> source,
mojo::InterfacePtr<serial::DataSourceClient> source_client,
mojo::InterfaceRequest<serial::Connection> request)
- : io_handler_(io_handler), binding_(this, request.Pass()) {
+ : io_handler_(io_handler), binding_(this, std::move(request)) {
receiver_ = new DataSinkReceiver(
- sink.Pass(),
+ std::move(sink),
base::Bind(&SerialConnection::OnSendPipeReady, base::Unretained(this)),
base::Bind(&SerialConnection::OnSendCancelled, base::Unretained(this)),
base::Bind(base::DoNothing));
sender_ = new DataSourceSender(
- source.Pass(), source_client.Pass(),
+ std::move(source), std::move(source_client),
base::Bind(&SerialConnection::OnReceivePipeReady, base::Unretained(this)),
base::Bind(base::DoNothing));
}
@@ -68,11 +70,11 @@ void SerialConnection::OnSendCancelled(int32_t error) {
}
void SerialConnection::OnSendPipeReady(scoped_ptr<ReadOnlyBuffer> buffer) {
- io_handler_->Write(buffer.Pass());
+ io_handler_->Write(std::move(buffer));
}
void SerialConnection::OnReceivePipeReady(scoped_ptr<WritableBuffer> buffer) {
- io_handler_->Read(buffer.Pass());
+ io_handler_->Read(std::move(buffer));
}
} // namespace device
« no previous file with comments | « device/serial/data_source_unittest.cc ('k') | device/serial/serial_connection_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698