| 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" |
| (...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 m_opened = false; | 903 m_opened = false; |
| 904 for (ScriptPromiseResolver* resolver : m_deviceRequests) | 904 for (ScriptPromiseResolver* resolver : m_deviceRequests) |
| 905 resolver->reject(DOMException::create(NotFoundError, kDeviceUnavailable)); | 905 resolver->reject(DOMException::create(NotFoundError, kDeviceUnavailable)); |
| 906 m_deviceRequests.clear(); | 906 m_deviceRequests.clear(); |
| 907 } | 907 } |
| 908 | 908 |
| 909 bool USBDevice::markRequestComplete(ScriptPromiseResolver* resolver) { | 909 bool USBDevice::markRequestComplete(ScriptPromiseResolver* resolver) { |
| 910 auto requestEntry = m_deviceRequests.find(resolver); | 910 auto requestEntry = m_deviceRequests.find(resolver); |
| 911 if (requestEntry == m_deviceRequests.end()) | 911 if (requestEntry == m_deviceRequests.end()) |
| 912 return false; | 912 return false; |
| 913 m_deviceRequests.remove(requestEntry); | 913 m_deviceRequests.erase(requestEntry); |
| 914 return true; | 914 return true; |
| 915 } | 915 } |
| 916 | 916 |
| 917 } // namespace blink | 917 } // namespace blink |
| OLD | NEW |