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

Unified Diff: device/serial/serial_device_enumerator_mac.cc

Issue 1579863003: Convert Pass()→std::move() for Mac build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months 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: device/serial/serial_device_enumerator_mac.cc
diff --git a/device/serial/serial_device_enumerator_mac.cc b/device/serial/serial_device_enumerator_mac.cc
index 3a81f1d175b6da230c05d840ca9f332ac3138dd3..7854c99d07b9bba27e74d281b540d16d556fc097 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
« no previous file with comments | « device/bluetooth/bluetooth_socket_mac.mm ('k') | media/capture/video/mac/video_capture_device_decklink_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698