Index: device/serial/serial_connection_factory.cc |
diff --git a/device/serial/serial_connection_factory.cc b/device/serial/serial_connection_factory.cc |
index 49b9bc81991887fcb056f40f6d82f1c926e4df95..d167a7878336b21b7dc5a69d775aaed827127916 100644 |
--- a/device/serial/serial_connection_factory.cc |
+++ b/device/serial/serial_connection_factory.cc |
@@ -4,6 +4,8 @@ |
#include "device/serial/serial_connection_factory.h" |
+#include <utility> |
+ |
#include "base/bind.h" |
#include "base/location.h" |
#include "base/macros.h" |
@@ -74,9 +76,9 @@ void SerialConnectionFactory::CreateConnection( |
mojo::InterfaceRequest<serial::DataSink> sink, |
mojo::InterfaceRequest<serial::DataSource> source, |
mojo::InterfacePtr<serial::DataSourceClient> source_client) { |
- scoped_refptr<ConnectTask> task( |
- new ConnectTask(this, path, options.Pass(), connection_request.Pass(), |
- sink.Pass(), source.Pass(), source_client.Pass())); |
+ scoped_refptr<ConnectTask> task(new ConnectTask( |
+ this, path, std::move(options), std::move(connection_request), |
+ std::move(sink), std::move(source), std::move(source_client))); |
task->Run(); |
} |
@@ -93,10 +95,10 @@ SerialConnectionFactory::ConnectTask::ConnectTask( |
mojo::InterfacePtr<serial::DataSourceClient> source_client) |
: factory_(factory), |
path_(path), |
- options_(options.Pass()), |
- connection_request_(connection_request.Pass()), |
- sink_(sink.Pass()), |
- source_(source.Pass()), |
+ options_(std::move(options)), |
+ connection_request_(std::move(connection_request)), |
+ sink_(std::move(sink)), |
+ source_(std::move(source)), |
source_client_(source_client.PassInterface()) { |
if (!options_) { |
options_ = serial::ConnectionOptions::New(); |
@@ -126,9 +128,9 @@ void SerialConnectionFactory::ConnectTask::OnConnected(bool success) { |
return; |
} |
- new SerialConnection(io_handler_, sink_.Pass(), source_.Pass(), |
- mojo::MakeProxy(source_client_.Pass()), |
- connection_request_.Pass()); |
+ new SerialConnection(io_handler_, std::move(sink_), std::move(source_), |
+ mojo::MakeProxy(std::move(source_client_)), |
+ std::move(connection_request_)); |
} |
} // namespace device |