OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 "modules/webusb/USBDevice.h" | 5 #include "modules/webusb/USBDevice.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptPromise.h" | 7 #include "bindings/core/v8/ScriptPromise.h" |
8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
9 #include "bindings/core/v8/ToV8.h" | 9 #include "bindings/core/v8/ToV8.h" |
10 #include "core/dom/DOMArrayBuffer.h" | 10 #include "core/dom/DOMArrayBuffer.h" |
11 #include "core/dom/DOMArrayBufferView.h" | 11 #include "core/dom/DOMArrayBufferView.h" |
12 #include "core/dom/DOMException.h" | 12 #include "core/dom/DOMException.h" |
13 #include "core/dom/ExceptionCode.h" | 13 #include "core/dom/ExceptionCode.h" |
14 #include "modules/webusb/USBConfiguration.h" | 14 #include "modules/webusb/USBConfiguration.h" |
15 #include "modules/webusb/USBControlTransferParameters.h" | 15 #include "modules/webusb/USBControlTransferParameters.h" |
16 #include "modules/webusb/USBInTransferResult.h" | 16 #include "modules/webusb/USBInTransferResult.h" |
17 #include "modules/webusb/USBIsochronousInTransferResult.h" | 17 #include "modules/webusb/USBIsochronousInTransferResult.h" |
18 #include "modules/webusb/USBIsochronousOutTransferResult.h" | 18 #include "modules/webusb/USBIsochronousOutTransferResult.h" |
19 #include "modules/webusb/USBOutTransferResult.h" | 19 #include "modules/webusb/USBOutTransferResult.h" |
20 #include "platform/mojo/MojoHelper.h" | 20 #include "platform/mojo/MojoHelper.h" |
21 #include "wtf/Assertions.h" | 21 #include "wtf/Assertions.h" |
22 | 22 |
23 namespace usb = device::usb::wtf; | 23 namespace usb = device::usb::blink; |
24 | 24 |
25 namespace blink { | 25 namespace blink { |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 const char kDeviceStateChangeInProgress[] = "An operation that changes the devic
e state is in progress."; | 29 const char kDeviceStateChangeInProgress[] = "An operation that changes the devic
e state is in progress."; |
30 const char kDeviceUnavailable[] = "Device unavailable."; | 30 const char kDeviceUnavailable[] = "Device unavailable."; |
31 const char kInterfaceNotFound[] = "The interface number provided is not supporte
d by the device in its current configuration."; | 31 const char kInterfaceNotFound[] = "The interface number provided is not supporte
d by the device in its current configuration."; |
32 const char kInterfaceStateChangeInProgress[] = "An operation that changes interf
ace state is in progress."; | 32 const char kInterfaceStateChangeInProgress[] = "An operation that changes interf
ace state is in progress."; |
33 const char kOpenRequired[] = "The device must be opened first."; | 33 const char kOpenRequired[] = "The device must be opened first."; |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 m_device.reset(); | 795 m_device.reset(); |
796 m_opened = false; | 796 m_opened = false; |
797 for (ScriptPromiseResolver* resolver : m_deviceRequests) { | 797 for (ScriptPromiseResolver* resolver : m_deviceRequests) { |
798 if (isActive(resolver)) | 798 if (isActive(resolver)) |
799 resolver->reject(DOMException::create(NotFoundError, kDeviceUnavaila
ble)); | 799 resolver->reject(DOMException::create(NotFoundError, kDeviceUnavaila
ble)); |
800 } | 800 } |
801 m_deviceRequests.clear(); | 801 m_deviceRequests.clear(); |
802 } | 802 } |
803 | 803 |
804 } // namespace blink | 804 } // namespace blink |
OLD | NEW |