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

Unified Diff: content/renderer/usb/type_converters.h

Issue 1293253002: Connect WebUSB client interface to the devices app (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix memory leak in WeakBindingSet Created 5 years, 4 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
« no previous file with comments | « content/renderer/usb/OWNERS ('k') | content/renderer/usb/type_converters.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/usb/type_converters.h
diff --git a/content/renderer/usb/type_converters.h b/content/renderer/usb/type_converters.h
new file mode 100644
index 0000000000000000000000000000000000000000..cb8890d97090dc45eb874ee439aa7742d98ec40d
--- /dev/null
+++ b/content/renderer/usb/type_converters.h
@@ -0,0 +1,105 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "third_party/mojo/src/mojo/public/cpp/bindings/type_converter.h"
+
+#include "device/devices_app/usb/public/interfaces/device.mojom.h"
+#include "device/devices_app/usb/public/interfaces/device_manager.mojom.h"
+#include "third_party/WebKit/public/platform/modules/webusb/WebUSBDevice.h"
+#include "third_party/WebKit/public/platform/modules/webusb/WebUSBDeviceFilter.h"
+#include "third_party/WebKit/public/platform/modules/webusb/WebUSBDeviceInfo.h"
+#include "third_party/WebKit/public/platform/modules/webusb/WebUSBDeviceRequestOptions.h"
+
+namespace mojo {
+
+template <>
+struct TypeConverter<blink::WebUSBDevice::TransferDirection,
+ device::usb::TransferDirection> {
+ static blink::WebUSBDevice::TransferDirection Convert(
+ const device::usb::TransferDirection& direction);
+};
+
+template <>
+struct TypeConverter<device::usb::TransferDirection,
+ blink::WebUSBDevice::TransferDirection> {
+ static device::usb::TransferDirection Convert(
+ const blink::WebUSBDevice::TransferDirection& direction);
+};
+
+template <>
+struct TypeConverter<device::usb::ControlTransferType,
+ blink::WebUSBDevice::RequestType> {
+ static device::usb::ControlTransferType Convert(
+ const blink::WebUSBDevice::RequestType& direction);
+};
+
+template <>
+struct TypeConverter<device::usb::ControlTransferRecipient,
+ blink::WebUSBDevice::RequestRecipient> {
+ static device::usb::ControlTransferRecipient Convert(
+ const blink::WebUSBDevice::RequestRecipient& direction);
+};
+
+template <>
+struct TypeConverter<device::usb::ControlTransferParamsPtr,
+ blink::WebUSBDevice::ControlTransferParameters> {
+ static device::usb::ControlTransferParamsPtr Convert(
+ const blink::WebUSBDevice::ControlTransferParameters& parameters);
+};
+
+template <>
+struct TypeConverter<blink::WebUSBDeviceInfo::Endpoint::Type,
+ device::usb::EndpointType> {
+ static blink::WebUSBDeviceInfo::Endpoint::Type Convert(
+ const device::usb::EndpointType& endpoint_type);
+};
+
+template <>
+struct TypeConverter<blink::WebUSBDeviceInfo::Endpoint,
+ device::usb::EndpointInfoPtr> {
+ static blink::WebUSBDeviceInfo::Endpoint Convert(
+ const device::usb::EndpointInfoPtr& info);
+};
+
+template <>
+struct TypeConverter<blink::WebUSBDeviceInfo::AlternateInterface,
+ device::usb::AlternateInterfaceInfoPtr> {
+ static blink::WebUSBDeviceInfo::AlternateInterface Convert(
+ const device::usb::AlternateInterfaceInfoPtr& info);
+};
+
+template <>
+struct TypeConverter<blink::WebUSBDeviceInfo::Interface,
+ device::usb::InterfaceInfoPtr> {
+ static blink::WebUSBDeviceInfo::Interface Convert(
+ const device::usb::InterfaceInfoPtr& info);
+};
+
+template <>
+struct TypeConverter<blink::WebUSBDeviceInfo::Configuration,
+ device::usb::ConfigurationInfoPtr> {
+ static blink::WebUSBDeviceInfo::Configuration Convert(
+ const device::usb::ConfigurationInfoPtr& info);
+};
+
+template <>
+struct TypeConverter<blink::WebUSBDeviceInfo, device::usb::DeviceInfoPtr> {
+ static blink::WebUSBDeviceInfo Convert(
+ const device::usb::DeviceInfoPtr& info);
+};
+
+template <>
+struct TypeConverter<device::usb::DeviceFilterPtr, blink::WebUSBDeviceFilter> {
+ static device::usb::DeviceFilterPtr Convert(
+ const blink::WebUSBDeviceFilter& web_filter);
+};
+
+template <>
+struct TypeConverter<device::usb::EnumerationOptionsPtr,
+ blink::WebUSBDeviceRequestOptions> {
+ static device::usb::EnumerationOptionsPtr Convert(
+ const blink::WebUSBDeviceRequestOptions& web_options);
+};
+
+} // namespace mojo
« no previous file with comments | « content/renderer/usb/OWNERS ('k') | content/renderer/usb/type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698