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

Side by Side Diff: device/usb/device_impl.cc

Issue 1155163008: Build a basic Mojo service framework for device/usb (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DISALLOW Created 5 years, 6 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
« no previous file with comments | « device/usb/device_impl.h ('k') | device/usb/device_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "device/usb/device_impl.h"
6 #include "device/usb/type_converters.h"
7 #include "device/usb/usb_device.h"
8
9 namespace device {
10 namespace usb {
11
12 DeviceImpl::DeviceImpl(scoped_refptr<UsbDevice> device,
13 mojo::InterfaceRequest<Device> request)
14 : binding_(this, request.Pass()),
15 device_(device),
16 info_(DeviceInfo::From(*device)) {
17 // TODO(rockot/reillyg): Support more than just the current configuration.
18 // Also, converting configuration info should be done in the TypeConverter,
19 // but GetConfiguration() is non-const so we do it here for now.
20 const UsbConfigDescriptor* config = device->GetConfiguration();
21 info_->configurations = mojo::Array<ConfigurationInfoPtr>::New(0);
22 if (config)
23 info_->configurations.push_back(ConfigurationInfo::From(*config));
24 }
25
26 DeviceImpl::~DeviceImpl() {
27 }
28
29 void DeviceImpl::GetDeviceInfo(const GetDeviceInfoCallback& callback) {
30 callback.Run(info_.Clone());
31 }
32
33 } // namespace usb
34 } // namespace device
OLDNEW
« no previous file with comments | « device/usb/device_impl.h ('k') | device/usb/device_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698