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

Side by Side Diff: device/serial/serial_device_enumerator_linux.cc

Issue 2607063002: Remove mojo::Array. (Closed)
Patch Set: rebase Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/serial/serial_device_enumerator_linux.h" 5 #include "device/serial/serial_device_enumerator_linux.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 20 matching lines...) Expand all
31 return std::unique_ptr<SerialDeviceEnumerator>( 31 return std::unique_ptr<SerialDeviceEnumerator>(
32 new SerialDeviceEnumeratorLinux()); 32 new SerialDeviceEnumeratorLinux());
33 } 33 }
34 34
35 SerialDeviceEnumeratorLinux::SerialDeviceEnumeratorLinux() { 35 SerialDeviceEnumeratorLinux::SerialDeviceEnumeratorLinux() {
36 udev_.reset(udev_new()); 36 udev_.reset(udev_new());
37 } 37 }
38 38
39 SerialDeviceEnumeratorLinux::~SerialDeviceEnumeratorLinux() {} 39 SerialDeviceEnumeratorLinux::~SerialDeviceEnumeratorLinux() {}
40 40
41 mojo::Array<serial::DeviceInfoPtr> SerialDeviceEnumeratorLinux::GetDevices() { 41 std::vector<serial::DeviceInfoPtr> SerialDeviceEnumeratorLinux::GetDevices() {
42 mojo::Array<serial::DeviceInfoPtr> devices; 42 std::vector<serial::DeviceInfoPtr> devices;
43 ScopedUdevEnumeratePtr enumerate(udev_enumerate_new(udev_.get())); 43 ScopedUdevEnumeratePtr enumerate(udev_enumerate_new(udev_.get()));
44 if (!enumerate) { 44 if (!enumerate) {
45 LOG(ERROR) << "Serial device enumeration failed."; 45 LOG(ERROR) << "Serial device enumeration failed.";
46 return devices; 46 return devices;
47 } 47 }
48 if (udev_enumerate_add_match_subsystem(enumerate.get(), kSerialSubsystem)) { 48 if (udev_enumerate_add_match_subsystem(enumerate.get(), kSerialSubsystem)) {
49 LOG(ERROR) << "Serial device enumeration failed."; 49 LOG(ERROR) << "Serial device enumeration failed.";
50 return devices; 50 return devices;
51 } 51 }
52 if (udev_enumerate_scan_devices(enumerate.get())) { 52 if (udev_enumerate_scan_devices(enumerate.get())) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 if (product_name) 89 if (product_name)
90 info->display_name.emplace(product_name); 90 info->display_name.emplace(product_name);
91 devices.push_back(std::move(info)); 91 devices.push_back(std::move(info));
92 } 92 }
93 } 93 }
94 return devices; 94 return devices;
95 } 95 }
96 96
97 } // namespace device 97 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698