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

Unified Diff: third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js

Issue 2556353004: Mojo JS bindings: code generator maps interface ptr and request to InterfacePtr and InterfaceReques… (Closed)
Patch Set: . Created 4 years 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/LayoutTests/usb/resources/usb-helpers.js
diff --git a/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js b/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js
index b0687fb9cb381c39c3a414bd93aedbe725a124f5..455601e96c951e9cab2aa41ee419ac2bf7f49748 100644
--- a/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js
+++ b/third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js
@@ -374,18 +374,19 @@ function usbMocks(mojo) {
return Promise.resolve({ results: devices });
}
- getDevice(guid, stub) {
- let device = this.mockDevices_.get(guid);
- if (device === undefined) {
- bindings.StubBindings(stub).close();
+ getDevice(guid, request) {
+ let deviceData = this.mockDevices_.get(guid);
+ if (deviceData === undefined) {
+ request.close();
} else {
- var mock = new MockDevice(device.info);
+ var stub = connection.bindHandleToStub(request.handle, device.Device);
+ var mock = new MockDevice(deviceData.info);
bindings.StubBindings(stub).delegate = mock;
bindings.StubBindings(stub).connectionErrorHandler = () => {
if (this.deviceCloseHandler_)
- this.deviceCloseHandler_(device.info);
+ this.deviceCloseHandler_(deviceData.info);
};
- device.stubs.push(stub);
+ deviceData.stubs.push(stub);
}
}

Powered by Google App Engine
This is Rietveld 408576698