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

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

Issue 1284033002: WebUSB bindings part 5 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | Source/modules/webusb/USBError.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webusb/USB.cpp
diff --git a/Source/modules/webusb/USB.cpp b/Source/modules/webusb/USB.cpp
index ffee6d20612d9857444fc58e9b85964c63828fc8..859334df20658a6454354c370459f49528004e2a 100644
--- a/Source/modules/webusb/USB.cpp
+++ b/Source/modules/webusb/USB.cpp
@@ -55,9 +55,9 @@ void convertDeviceEnumerationOptions(const USBDeviceEnumerationOptions& options,
class DeviceArray {
WTF_MAKE_NONCOPYABLE(DeviceArray);
public:
- using WebType = WebVector<WebUSBDevice*>;
+ using WebType = OwnPtr<WebVector<WebUSBDevice*>>;
- static HeapVector<Member<USBDevice>> take(ScriptPromiseResolver*, PassOwnPtr<WebType> webDevices)
+ static HeapVector<Member<USBDevice>> take(ScriptPromiseResolver*, PassOwnPtr<WebVector<WebUSBDevice*>> webDevices)
{
HeapVector<Member<USBDevice>> devices;
for (const auto webDevice : *webDevices)
@@ -87,12 +87,7 @@ ScriptPromise USB::getDevices(ScriptState* scriptState, const USBDeviceEnumerati
WebUSBDeviceEnumerationOptions webOptions;
convertDeviceEnumerationOptions(options, &webOptions);
-
- // TODO(rockot): Re-enable this after CPA changes land.
- // That's https://codereview.chromium.org/1240763002/ and dependent patches.
- // client->getDevices(webOptions, new CallbackPromiseAdapter<DeviceArray, USBError>(resolver));
- ASSERT_NOT_REACHED();
-
+ client->getDevices(webOptions, new CallbackPromiseAdapter<DeviceArray, USBError>(resolver));
return promise;
}
« no previous file with comments | « no previous file | Source/modules/webusb/USBError.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698