| OLD | NEW |
| 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_service_impl.h" | 5 #include "device/serial/serial_service_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 |
| 9 #include <memory> |
| 8 #include <utility> | 10 #include <utility> |
| 9 | 11 |
| 10 #include "base/bind.h" | 12 #include "base/bind.h" |
| 11 #include "base/location.h" | 13 #include "base/location.h" |
| 12 #include "device/serial/serial_io_handler.h" | 14 #include "device/serial/serial_io_handler.h" |
| 13 | 15 |
| 14 namespace device { | 16 namespace device { |
| 15 | 17 |
| 16 SerialServiceImpl::SerialServiceImpl( | 18 SerialServiceImpl::SerialServiceImpl( |
| 17 scoped_refptr<SerialConnectionFactory> connection_factory, | 19 scoped_refptr<SerialConnectionFactory> connection_factory, |
| 18 mojo::InterfaceRequest<serial::SerialService> request) | 20 mojo::InterfaceRequest<serial::SerialService> request) |
| 19 : connection_factory_(connection_factory), | 21 : connection_factory_(connection_factory), |
| 20 binding_(this, std::move(request)) {} | 22 binding_(this, std::move(request)) {} |
| 21 | 23 |
| 22 SerialServiceImpl::SerialServiceImpl( | 24 SerialServiceImpl::SerialServiceImpl( |
| 23 scoped_refptr<SerialConnectionFactory> connection_factory, | 25 scoped_refptr<SerialConnectionFactory> connection_factory, |
| 24 scoped_ptr<SerialDeviceEnumerator> device_enumerator, | 26 std::unique_ptr<SerialDeviceEnumerator> device_enumerator, |
| 25 mojo::InterfaceRequest<serial::SerialService> request) | 27 mojo::InterfaceRequest<serial::SerialService> request) |
| 26 : device_enumerator_(std::move(device_enumerator)), | 28 : device_enumerator_(std::move(device_enumerator)), |
| 27 connection_factory_(connection_factory), | 29 connection_factory_(connection_factory), |
| 28 binding_(this, std::move(request)) {} | 30 binding_(this, std::move(request)) {} |
| 29 | 31 |
| 30 SerialServiceImpl::~SerialServiceImpl() { | 32 SerialServiceImpl::~SerialServiceImpl() { |
| 31 } | 33 } |
| 32 | 34 |
| 33 // static | 35 // static |
| 34 void SerialServiceImpl::Create( | 36 void SerialServiceImpl::Create( |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 mojo::Array<serial::DeviceInfoPtr> devices( | 85 mojo::Array<serial::DeviceInfoPtr> devices( |
| 84 GetDeviceEnumerator()->GetDevices()); | 86 GetDeviceEnumerator()->GetDevices()); |
| 85 for (size_t i = 0; i < devices.size(); i++) { | 87 for (size_t i = 0; i < devices.size(); i++) { |
| 86 if (path == devices[i]->path) | 88 if (path == devices[i]->path) |
| 87 return true; | 89 return true; |
| 88 } | 90 } |
| 89 return false; | 91 return false; |
| 90 } | 92 } |
| 91 | 93 |
| 92 } // namespace device | 94 } // namespace device |
| OLD | NEW |