diff options
author | dcheng <dcheng@chromium.org> | 2016-01-13 02:58:14 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-13 10:59:37 +0000 |
commit | f26eed3771b06cb2bf02e5d02e6f19a20f97a00b (patch) | |
tree | 045e2c9c2d63c31431709043ede7b226cfd43821 /device | |
parent | c1f77e79555cf4cbb4d41f45cc26b70cbcaf4b32 (diff) | |
download | chromium_src-f26eed3771b06cb2bf02e5d02e6f19a20f97a00b.zip chromium_src-f26eed3771b06cb2bf02e5d02e6f19a20f97a00b.tar.gz chromium_src-f26eed3771b06cb2bf02e5d02e6f19a20f97a00b.tar.bz2 |
Convert Pass()→std::move() for Mac build.
BUG=557422
R=avi@chromium.org
TBR=jam@chromium.org
Review URL: https://codereview.chromium.org/1579863003
Cr-Commit-Position: refs/heads/master@{#369135}
Diffstat (limited to 'device')
-rw-r--r-- | device/bluetooth/bluetooth_l2cap_channel_mac.mm | 2 | ||||
-rw-r--r-- | device/bluetooth/bluetooth_rfcomm_channel_mac.mm | 2 | ||||
-rw-r--r-- | device/bluetooth/bluetooth_socket_mac.mm | 7 | ||||
-rw-r--r-- | device/serial/serial_device_enumerator_mac.cc | 17 |
4 files changed, 15 insertions, 13 deletions
diff --git a/device/bluetooth/bluetooth_l2cap_channel_mac.mm b/device/bluetooth/bluetooth_l2cap_channel_mac.mm index 218721c..b136d27 100644 --- a/device/bluetooth/bluetooth_l2cap_channel_mac.mm +++ b/device/bluetooth/bluetooth_l2cap_channel_mac.mm @@ -99,7 +99,7 @@ scoped_ptr<BluetoothL2capChannelMac> BluetoothL2capChannelMac::OpenAsync( else channel.reset(); - return channel.Pass(); + return channel; } void BluetoothL2capChannelMac::SetSocket(BluetoothSocketMac* socket) { diff --git a/device/bluetooth/bluetooth_rfcomm_channel_mac.mm b/device/bluetooth/bluetooth_rfcomm_channel_mac.mm index 2b27a1c..53f2240 100644 --- a/device/bluetooth/bluetooth_rfcomm_channel_mac.mm +++ b/device/bluetooth/bluetooth_rfcomm_channel_mac.mm @@ -94,7 +94,7 @@ scoped_ptr<BluetoothRfcommChannelMac> BluetoothRfcommChannelMac::OpenAsync( channel.reset(); } - return channel.Pass(); + return channel; } void BluetoothRfcommChannelMac::SetSocket(BluetoothSocketMac* socket) { diff --git a/device/bluetooth/bluetooth_socket_mac.mm b/device/bluetooth/bluetooth_socket_mac.mm index 0157d10..c82e5d2 100644 --- a/device/bluetooth/bluetooth_socket_mac.mm +++ b/device/bluetooth/bluetooth_socket_mac.mm @@ -10,6 +10,7 @@ #include <limits> #include <sstream> #include <string> +#include <utility> #include "base/bind.h" #include "base/callback.h" @@ -648,7 +649,7 @@ void BluetoothSocketMac::OnChannelOpenComplete( DVLOG(1) << device_address << " " << uuid_.canonical_value() << ": channel open complete."; - scoped_ptr<ConnectCallbacks> temp = connect_callbacks_.Pass(); + scoped_ptr<ConnectCallbacks> temp = std::move(connect_callbacks_); if (status != kIOReturnSuccess) { ReleaseChannel(); std::stringstream error; @@ -724,7 +725,7 @@ void BluetoothSocketMac::OnChannelDataReceived(void* data, size_t length) { // If there is a pending read callback, call it now. if (receive_callbacks_) { - scoped_ptr<ReceiveCallbacks> temp = receive_callbacks_.Pass(); + scoped_ptr<ReceiveCallbacks> temp = std::move(receive_callbacks_); temp->success_callback.Run(buffer->size(), buffer); return; } @@ -834,7 +835,7 @@ void BluetoothSocketMac::OnChannelClosed() { DCHECK(thread_checker_.CalledOnValidThread()); if (receive_callbacks_) { - scoped_ptr<ReceiveCallbacks> temp = receive_callbacks_.Pass(); + scoped_ptr<ReceiveCallbacks> temp = std::move(receive_callbacks_); temp->error_callback.Run(BluetoothSocket::kDisconnected, kSocketNotConnected); } diff --git a/device/serial/serial_device_enumerator_mac.cc b/device/serial/serial_device_enumerator_mac.cc index 3a81f1d..7854c99 100644 --- a/device/serial/serial_device_enumerator_mac.cc +++ b/device/serial/serial_device_enumerator_mac.cc @@ -9,6 +9,7 @@ #include <stdint.h> #include <algorithm> +#include <utility> #include "base/files/file_enumerator.h" #include "base/files/file_path.h" @@ -106,13 +107,13 @@ mojo::Array<serial::DeviceInfoPtr> GetDevicesNew() { CFMutableDictionaryRef matchingDict = IOServiceMatching(kIOSerialBSDServiceValue); if (!matchingDict) - return devices.Pass(); + return devices; io_iterator_t it; kern_return_t kr = IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDict, &it); if (kr != KERN_SUCCESS) - return devices.Pass(); + return devices; base::mac::ScopedIOObject<io_iterator_t> scoped_it(it); base::mac::ScopedIOObject<io_service_t> scoped_device; @@ -148,18 +149,18 @@ mojo::Array<serial::DeviceInfoPtr> GetDevicesNew() { &dialinDevice)) { serial::DeviceInfoPtr dialin_info = callout_info.Clone(); dialin_info->path = dialinDevice; - devices.push_back(dialin_info.Pass()); + devices.push_back(std::move(dialin_info)); } mojo::String calloutDevice; if (GetStringProperty(scoped_device.get(), CFSTR(kIOCalloutDeviceKey), &calloutDevice)) { callout_info->path = calloutDevice; - devices.push_back(callout_info.Pass()); + devices.push_back(std::move(callout_info)); } } - return devices.Pass(); + return devices; } // Returns an array of devices as retrieved through the old method of @@ -192,12 +193,12 @@ mojo::Array<serial::DeviceInfoPtr> GetDevicesOld() { if (base::MatchPattern(next_device, *i)) { serial::DeviceInfoPtr info(serial::DeviceInfo::New()); info->path = next_device; - devices.push_back(info.Pass()); + devices.push_back(std::move(info)); break; } } } while (true); - return devices.Pass(); + return devices; } } // namespace @@ -236,7 +237,7 @@ mojo::Array<serial::DeviceInfoPtr> SerialDeviceEnumeratorMac::GetDevices() { mojo::Array<serial::DeviceInfoPtr> devices; deviceMap.DecomposeMapTo(&paths, &devices); - return devices.Pass(); + return devices; } } // namespace device |