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

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

Issue 1963183003: WebUSB: Remove guid property from USBDevice. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update webexposed. Created 4 years, 7 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.h
diff --git a/third_party/WebKit/Source/modules/webusb/USB.h b/third_party/WebKit/Source/modules/webusb/USB.h
index b6ba9894b4f6451b557d58d40ecbc10725a4d1db..94a15fdf430b2f5f8795abc849157c3e2b36aa83 100644
--- a/third_party/WebKit/Source/modules/webusb/USB.h
+++ b/third_party/WebKit/Source/modules/webusb/USB.h
@@ -19,6 +19,7 @@ namespace blink {
class LocalFrame;
class ScopedScriptPromiseResolver;
class ScriptState;
+class USBDevice;
class USBDeviceRequestOptions;
class USB final
@@ -51,15 +52,17 @@ public:
// ContextLifecycleObserver overrides.
void contextDestroyed() override;
- // DeviceManagerClient implementation.
- void OnDeviceAdded(device::usb::blink::DeviceInfoPtr);
- void OnDeviceRemoved(device::usb::blink::DeviceInfoPtr);
+ USBDevice* getOrCreateDevice(device::usb::blink::DeviceInfoPtr);
device::usb::blink::DeviceManager* deviceManager() const { return m_deviceManager.get(); }
void onGetDevices(ScriptPromiseResolver*, mojo::WTFArray<device::usb::blink::DeviceInfoPtr>);
void onGetPermission(ScriptPromiseResolver*, device::usb::blink::DeviceInfoPtr);
+ // DeviceManagerClient implementation.
+ void OnDeviceAdded(device::usb::blink::DeviceInfoPtr);
+ void OnDeviceRemoved(device::usb::blink::DeviceInfoPtr);
+
void onDeviceManagerConnectionError();
void onChooserServiceConnectionError();
@@ -73,6 +76,7 @@ private:
device::usb::blink::ChooserServicePtr m_chooserService;
HeapHashSet<Member<ScriptPromiseResolver>> m_chooserServiceRequests;
mojo::Binding<device::usb::blink::DeviceManagerClient> m_clientBinding;
+ HeapHashMap<String, WeakMember<USBDevice>> m_deviceCache;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698