summaryrefslogtreecommitdiffstats
path: root/device/usb/mojo/device_impl.cc
diff options
context:
space:
mode:
authorreillyg <reillyg@chromium.org>2016-03-15 12:47:06 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-15 19:48:11 +0000
commitcc9b0c5fa36368bb012b4b4d572ada52ceb1146b (patch)
tree5cd24491c7188fb4702d69a9e08053ad3c53eb16 /device/usb/mojo/device_impl.cc
parent8b58c0d445772371cba4da0000f78917a12c79bc (diff)
downloadchromium_src-cc9b0c5fa36368bb012b4b4d572ada52ceb1146b.zip
chromium_src-cc9b0c5fa36368bb012b4b4d572ada52ceb1146b.tar.gz
chromium_src-cc9b0c5fa36368bb012b4b4d572ada52ceb1146b.tar.bz2
Track USB device configuration state in Blink.
Blink now tracks the currently selected device configuration and can thus provide it as an IDL attribute without a getConfiguration() method which has been removed. This continues the trend of being able to handle errors in Blink before calling methods on the Mojo interface. BUG=593164 R=juncai@chromium.org TBR=dgozman@chromium.org Review URL: https://codereview.chromium.org/1784733002 Cr-Commit-Position: refs/heads/master@{#381288}
Diffstat (limited to 'device/usb/mojo/device_impl.cc')
-rw-r--r--device/usb/mojo/device_impl.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/device/usb/mojo/device_impl.cc b/device/usb/mojo/device_impl.cc
index 9472571..a2dd316 100644
--- a/device/usb/mojo/device_impl.cc
+++ b/device/usb/mojo/device_impl.cc
@@ -190,12 +190,9 @@ void DeviceImpl::OnOpen(const OpenCallback& callback,
}
void DeviceImpl::GetDeviceInfo(const GetDeviceInfoCallback& callback) {
- callback.Run(device_info_->Clone());
-}
-
-void DeviceImpl::GetConfiguration(const GetConfigurationCallback& callback) {
const UsbConfigDescriptor* config = device_->GetActiveConfiguration();
- callback.Run(config ? config->configuration_value : 0);
+ device_info_->active_configuration = config ? config->configuration_value : 0;
+ callback.Run(device_info_->Clone());
}
void DeviceImpl::Open(const OpenCallback& callback) {