| 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/USB.h" | 5 #include "modules/webusb/USB.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 "core/dom/DOMException.h" | 9 #include "core/dom/DOMException.h" |
| 10 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } | 143 } |
| 144 | 144 |
| 145 ExecutionContext* USB::getExecutionContext() const { | 145 ExecutionContext* USB::getExecutionContext() const { |
| 146 return ContextLifecycleObserver::getExecutionContext(); | 146 return ContextLifecycleObserver::getExecutionContext(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 const AtomicString& USB::interfaceName() const { | 149 const AtomicString& USB::interfaceName() const { |
| 150 return EventTargetNames::USB; | 150 return EventTargetNames::USB; |
| 151 } | 151 } |
| 152 | 152 |
| 153 void USB::contextDestroyed() { | 153 void USB::contextDestroyed(ExecutionContext*) { |
| 154 m_deviceManager.reset(); | 154 m_deviceManager.reset(); |
| 155 m_deviceManagerRequests.clear(); | 155 m_deviceManagerRequests.clear(); |
| 156 m_chooserService.reset(); | 156 m_chooserService.reset(); |
| 157 m_chooserServiceRequests.clear(); | 157 m_chooserServiceRequests.clear(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 USBDevice* USB::getOrCreateDevice(usb::DeviceInfoPtr deviceInfo) { | 160 USBDevice* USB::getOrCreateDevice(usb::DeviceInfoPtr deviceInfo) { |
| 161 USBDevice* device = m_deviceCache.get(deviceInfo->guid); | 161 USBDevice* device = m_deviceCache.get(deviceInfo->guid); |
| 162 if (!device) { | 162 if (!device) { |
| 163 String guid = deviceInfo->guid; | 163 String guid = deviceInfo->guid; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 DEFINE_TRACE(USB) { | 248 DEFINE_TRACE(USB) { |
| 249 visitor->trace(m_deviceManagerRequests); | 249 visitor->trace(m_deviceManagerRequests); |
| 250 visitor->trace(m_chooserServiceRequests); | 250 visitor->trace(m_chooserServiceRequests); |
| 251 visitor->trace(m_deviceCache); | 251 visitor->trace(m_deviceCache); |
| 252 EventTargetWithInlineData::trace(visitor); | 252 EventTargetWithInlineData::trace(visitor); |
| 253 ContextLifecycleObserver::trace(visitor); | 253 ContextLifecycleObserver::trace(visitor); |
| 254 } | 254 } |
| 255 | 255 |
| 256 } // namespace blink | 256 } // namespace blink |
| OLD | NEW |