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

Unified Diff: content/renderer/usb/web_usb_client_impl.h

Issue 1848603002: Remove single observer assumption in WebUSBClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use EAGERLY_FINALIZE() instead. 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: content/renderer/usb/web_usb_client_impl.h
diff --git a/content/renderer/usb/web_usb_client_impl.h b/content/renderer/usb/web_usb_client_impl.h
index b3b504b9a22c7af1ce55ddc7e6be2441d0b198e8..10fe314447ebaa5bb95a2a7102d5d9bec4a81696 100644
--- a/content/renderer/usb/web_usb_client_impl.h
+++ b/content/renderer/usb/web_usb_client_impl.h
@@ -25,7 +25,8 @@ class WebUSBClientImpl : public blink::WebUSBClient {
void requestDevice(
const blink::WebUSBDeviceRequestOptions& options,
blink::WebUSBClientRequestDeviceCallbacks* callbacks) override;
- void setObserver(Observer* observer) override;
+ void addObserver(Observer* observer) override;
+ void removeObserver(Observer* observer) override;
device::usb::DeviceManager* GetDeviceManager();
void OnDeviceChangeNotification(
@@ -34,7 +35,7 @@ class WebUSBClientImpl : public blink::WebUSBClient {
ServiceRegistry* const service_registry_;
device::usb::DeviceManagerPtr device_manager_;
device::usb::ChooserServicePtr chooser_service_;
- Observer* observer_ = nullptr;
+ std::set<Observer*> observers_;
DISALLOW_COPY_AND_ASSIGN(WebUSBClientImpl);
};
« no previous file with comments | « no previous file | content/renderer/usb/web_usb_client_impl.cc » ('j') | content/renderer/usb/web_usb_client_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698