diff options
author | dcheng <dcheng@chromium.org> | 2015-12-18 09:48:00 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-18 17:48:52 +0000 |
commit | e59eca16010c109a5e3e4922189c8b264d34caa9 (patch) | |
tree | 838815399c6364a99a465938df9978aeaf75c766 /extensions/renderer/api | |
parent | 5100baf1eac806abbdaaf8002887aacf652f34e5 (diff) | |
download | chromium_src-e59eca16010c109a5e3e4922189c8b264d34caa9.zip chromium_src-e59eca16010c109a5e3e4922189c8b264d34caa9.tar.gz chromium_src-e59eca16010c109a5e3e4922189c8b264d34caa9.tar.bz2 |
Convert Pass()→std::move() in //extensions
BUG=557422
Review URL: https://codereview.chromium.org/1537893002
Cr-Commit-Position: refs/heads/master@{#366120}
Diffstat (limited to 'extensions/renderer/api')
-rw-r--r-- | extensions/renderer/api/serial/data_receiver_unittest.cc | 5 | ||||
-rw-r--r-- | extensions/renderer/api/serial/data_sender_unittest.cc | 5 | ||||
-rw-r--r-- | extensions/renderer/api/serial/serial_api_unittest.cc | 8 |
3 files changed, 11 insertions, 7 deletions
diff --git a/extensions/renderer/api/serial/data_receiver_unittest.cc b/extensions/renderer/api/serial/data_receiver_unittest.cc index 623fcbf..c650866 100644 --- a/extensions/renderer/api/serial/data_receiver_unittest.cc +++ b/extensions/renderer/api/serial/data_receiver_unittest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include <queue> +#include <utility> #include "device/serial/data_source_sender.h" #include "device/serial/data_stream.mojom.h" @@ -35,7 +36,7 @@ class DataReceiverFactory : public gin::Wrappable<DataReceiverFactory> { mojo::InterfacePtr<device::serial::DataSourceClient> client; mojo::InterfaceRequest<device::serial::DataSourceClient> client_request = mojo::GetProxy(&client); - callback_.Run(mojo::GetProxy(&sink), client.Pass()); + callback_.Run(mojo::GetProxy(&sink), std::move(client)); gin::Dictionary result = gin::Dictionary::CreateEmpty(isolate_); result.Set("source", sink.PassInterface().PassHandle().release()); @@ -89,7 +90,7 @@ class DataReceiverTest : public ApiTestBase { mojo::InterfaceRequest<device::serial::DataSource> request, mojo::InterfacePtr<device::serial::DataSourceClient> client) { sender_ = new device::DataSourceSender( - request.Pass(), client.Pass(), + std::move(request), std::move(client), base::Bind(&DataReceiverTest::ReadyToSend, base::Unretained(this)), base::Bind(base::DoNothing)); } diff --git a/extensions/renderer/api/serial/data_sender_unittest.cc b/extensions/renderer/api/serial/data_sender_unittest.cc index 461f012..dfda6cd 100644 --- a/extensions/renderer/api/serial/data_sender_unittest.cc +++ b/extensions/renderer/api/serial/data_sender_unittest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include <queue> +#include <utility> #include "device/serial/data_sink_receiver.h" #include "device/serial/data_stream.mojom.h" @@ -39,7 +40,7 @@ class DataSenderTest : public ApiTestBase { void CreateDataSink( mojo::InterfaceRequest<device::serial::DataSink> request) { receiver_ = new device::DataSinkReceiver( - request.Pass(), + std::move(request), base::Bind(&DataSenderTest::ReadyToReceive, base::Unretained(this)), base::Bind(&DataSenderTest::OnCancel, base::Unretained(this)), base::Bind(base::DoNothing)); @@ -48,7 +49,7 @@ class DataSenderTest : public ApiTestBase { void ReadyToReceive(scoped_ptr<device::ReadOnlyBuffer> buffer) { std::string data(buffer->GetData(), buffer->GetSize()); if (expected_data_.empty()) { - buffer_ = buffer.Pass(); + buffer_ = std::move(buffer); return; } diff --git a/extensions/renderer/api/serial/serial_api_unittest.cc b/extensions/renderer/api/serial/serial_api_unittest.cc index f90fe76..216ac5c 100644 --- a/extensions/renderer/api/serial/serial_api_unittest.cc +++ b/extensions/renderer/api/serial/serial_api_unittest.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <utility> + #include "base/thread_task_runner_handle.h" #include "device/serial/serial_device_enumerator.h" #include "device/serial/serial_service_impl.h" @@ -38,7 +40,7 @@ class FakeSerialDeviceEnumerator : public device::SerialDeviceEnumerator { result[2] = device::serial::DeviceInfo::New(); result[2]->path = ""; result[2]->display_name = ""; - return result.Pass(); + return result; } }; @@ -166,7 +168,7 @@ class GetControlSignalsTestIoHandler : public TestIoHandlerBase { signals->ri = num_calls() & 4; signals->dsr = num_calls() & 8; record_call(); - return signals.Pass(); + return signals; } private: @@ -442,7 +444,7 @@ class SerialApiTest : public ApiTestBase { base::ThreadTaskRunnerHandle::Get()), scoped_ptr<device::SerialDeviceEnumerator>( new FakeSerialDeviceEnumerator), - request.Pass()); + std::move(request)); } DISALLOW_COPY_AND_ASSIGN(SerialApiTest); |