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

Side by Side Diff: third_party/WebKit/LayoutTests/usb/resources/webusb-test.js

Issue 2821813002: Use Mojo enum types in the C++ USB interface (Closed)
Patch Set: Fix up //device/usb dependencies in //extensions/browser/api Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 'use strict'; 1 'use strict';
2 2
3 // This polyfil library implements the following WebIDL: 3 // This polyfil library implements the following WebIDL:
4 // 4 //
5 // partial interface USB { 5 // partial interface USB {
6 // [SameObject] readonly attribute USBTest test; 6 // [SameObject] readonly attribute USBTest test;
7 // } 7 // }
8 // 8 //
9 // interface USBTest { 9 // interface USBTest {
10 // attribute EventHandler ondeviceclose; 10 // attribute EventHandler ondeviceclose;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 switch (endpoint.direction) { 125 switch (endpoint.direction) {
126 case "in": 126 case "in":
127 endpointInfo.direction = mojo.device.UsbTransferDirection.INBOUND; 127 endpointInfo.direction = mojo.device.UsbTransferDirection.INBOUND;
128 break; 128 break;
129 case "out": 129 case "out":
130 endpointInfo.direction = mojo.device.UsbTransferDirection.OUTBOUND; 130 endpointInfo.direction = mojo.device.UsbTransferDirection.OUTBOUND;
131 break; 131 break;
132 } 132 }
133 switch (endpoint.type) { 133 switch (endpoint.type) {
134 case "bulk": 134 case "bulk":
135 endpointInfo.type = mojo.device.UsbEndpointType.BULK; 135 endpointInfo.type = mojo.device.UsbTransferType.BULK;
136 break; 136 break;
137 case "interrupt": 137 case "interrupt":
138 endpointInfo.type = mojo.device.UsbEndpointType.INTERRUPT; 138 endpointInfo.type = mojo.device.UsbTransferType.INTERRUPT;
139 break; 139 break;
140 case "isochronous": 140 case "isochronous":
141 endpointInfo.type = mojo.device.UsbEndpointType.ISOCHRONOUS; 141 endpointInfo.type = mojo.device.UsbTransferType.ISOCHRONOUS;
142 break; 142 break;
143 } 143 }
144 alternateInfo.endpoints.push(endpointInfo); 144 alternateInfo.endpoints.push(endpointInfo);
145 }); 145 });
146 interfaceInfo.alternates.push(alternateInfo); 146 interfaceInfo.alternates.push(alternateInfo);
147 }); 147 });
148 configInfo.interfaces.push(interfaceInfo); 148 configInfo.interfaces.push(interfaceInfo);
149 }); 149 });
150 deviceInfo.configurations.push(configInfo); 150 deviceInfo.configurations.push(configInfo);
151 }); 151 });
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 556
557 g_deviceManager.removeAllDevices(); 557 g_deviceManager.removeAllDevices();
558 g_chooserService.setChosenDevice(null); 558 g_chooserService.setChosenDevice(null);
559 g_closeListener = null; 559 g_closeListener = null;
560 } 560 }
561 } 561 }
562 562
563 navigator.usb.test = new USBTest(); 563 navigator.usb.test = new USBTest();
564 564
565 })(); 565 })();
OLDNEW
« no previous file with comments | « extensions/browser/api/usb/usb_apitest.cc ('k') | third_party/WebKit/Source/modules/webusb/USBEndpoint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698