| 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 #ifndef USB_h | 5 #ifndef USB_h |
| 6 #define USB_h | 6 #define USB_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
| 10 #include "core/dom/ContextLifecycleObserver.h" | 10 #include "core/dom/ContextLifecycleObserver.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 ScriptPromise getDevices(ScriptState*); | 39 ScriptPromise getDevices(ScriptState*); |
| 40 ScriptPromise requestDevice(ScriptState*, const USBDeviceRequestOptions&); | 40 ScriptPromise requestDevice(ScriptState*, const USBDeviceRequestOptions&); |
| 41 DEFINE_ATTRIBUTE_EVENT_LISTENER(connect); | 41 DEFINE_ATTRIBUTE_EVENT_LISTENER(connect); |
| 42 DEFINE_ATTRIBUTE_EVENT_LISTENER(disconnect); | 42 DEFINE_ATTRIBUTE_EVENT_LISTENER(disconnect); |
| 43 | 43 |
| 44 // EventTarget overrides. | 44 // EventTarget overrides. |
| 45 ExecutionContext* getExecutionContext() const override; | 45 ExecutionContext* getExecutionContext() const override; |
| 46 const AtomicString& interfaceName() const override; | 46 const AtomicString& interfaceName() const override; |
| 47 | 47 |
| 48 // ContextLifecycleObserver overrides. | 48 // ContextLifecycleObserver overrides. |
| 49 void contextDestroyed() override; | 49 void contextDestroyed(ExecutionContext*) override; |
| 50 | 50 |
| 51 USBDevice* getOrCreateDevice(device::usb::blink::DeviceInfoPtr); | 51 USBDevice* getOrCreateDevice(device::usb::blink::DeviceInfoPtr); |
| 52 | 52 |
| 53 device::usb::blink::DeviceManager* deviceManager() const { | 53 device::usb::blink::DeviceManager* deviceManager() const { |
| 54 return m_deviceManager.get(); | 54 return m_deviceManager.get(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void onGetDevices(ScriptPromiseResolver*, | 57 void onGetDevices(ScriptPromiseResolver*, |
| 58 Vector<device::usb::blink::DeviceInfoPtr>); | 58 Vector<device::usb::blink::DeviceInfoPtr>); |
| 59 void onGetPermission(ScriptPromiseResolver*, | 59 void onGetPermission(ScriptPromiseResolver*, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 75 HeapHashSet<Member<ScriptPromiseResolver>> m_deviceManagerRequests; | 75 HeapHashSet<Member<ScriptPromiseResolver>> m_deviceManagerRequests; |
| 76 device::usb::blink::ChooserServicePtr m_chooserService; | 76 device::usb::blink::ChooserServicePtr m_chooserService; |
| 77 HeapHashSet<Member<ScriptPromiseResolver>> m_chooserServiceRequests; | 77 HeapHashSet<Member<ScriptPromiseResolver>> m_chooserServiceRequests; |
| 78 mojo::Binding<device::usb::blink::DeviceManagerClient> m_clientBinding; | 78 mojo::Binding<device::usb::blink::DeviceManagerClient> m_clientBinding; |
| 79 HeapHashMap<String, WeakMember<USBDevice>> m_deviceCache; | 79 HeapHashMap<String, WeakMember<USBDevice>> m_deviceCache; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 } // namespace blink | 82 } // namespace blink |
| 83 | 83 |
| 84 #endif // USB_h | 84 #endif // USB_h |
| OLD | NEW |