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

Unified Diff: third_party/WebKit/Source/modules/webusb/USB.cpp

Issue 1781533002: Track USBDevice open state in Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 9 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
Index: third_party/WebKit/Source/modules/webusb/USB.cpp
diff --git a/third_party/WebKit/Source/modules/webusb/USB.cpp b/third_party/WebKit/Source/modules/webusb/USB.cpp
index b96657e6b50838ed5250e387c45d0d8eaf849441..c35c88c26ad9ea79be0ff78cef6473005987e624 100644
--- a/third_party/WebKit/Source/modules/webusb/USB.cpp
+++ b/third_party/WebKit/Source/modules/webusb/USB.cpp
@@ -63,11 +63,11 @@ class DeviceArray {
public:
using WebType = OwnPtr<WebVector<WebUSBDevice*>>;
- static HeapVector<Member<USBDevice>> take(ScriptPromiseResolver*, PassOwnPtr<WebVector<WebUSBDevice*>> webDevices)
+ static HeapVector<Member<USBDevice>> take(ScriptPromiseResolver* resolver, PassOwnPtr<WebVector<WebUSBDevice*>> webDevices)
{
HeapVector<Member<USBDevice>> devices;
for (const auto webDevice : *webDevices)
- devices.append(USBDevice::create(adoptPtr(webDevice)));
+ devices.append(USBDevice::create(adoptPtr(webDevice), resolver->getExecutionContext()));
return devices;
}
};
@@ -145,12 +145,12 @@ void USB::willDetachFrameHost()
void USB::onDeviceConnected(WebPassOwnPtr<WebUSBDevice> device)
{
- dispatchEvent(USBConnectionEvent::create(EventTypeNames::connect, USBDevice::create(device.release())));
+ dispatchEvent(USBConnectionEvent::create(EventTypeNames::connect, USBDevice::create(device.release(), getExecutionContext())));
}
void USB::onDeviceDisconnected(WebPassOwnPtr<WebUSBDevice> device)
{
- dispatchEvent(USBConnectionEvent::create(EventTypeNames::disconnect, USBDevice::create(device.release())));
+ dispatchEvent(USBConnectionEvent::create(EventTypeNames::disconnect, USBDevice::create(device.release(), getExecutionContext())));
}
DEFINE_TRACE(USB)

Powered by Google App Engine
This is Rietveld 408576698