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

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

Issue 1850023002: Consume Mojo services directly in Blink's WebUSB implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 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 8d406a6ec624d1db12fe6ddfcd069eaa26958e4a..ae2c9c93647225d4da51a400210f5ba3d30a838b 100644
--- a/third_party/WebKit/Source/modules/webusb/USB.h
+++ b/third_party/WebKit/Source/modules/webusb/USB.h
@@ -9,20 +9,19 @@
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/dom/ContextLifecycleObserver.h"
#include "core/events/EventTarget.h"
+#include "device/usb/public/interfaces/chooser_service.mojom-blink.h"
+#include "device/usb/public/interfaces/device_manager.mojom-blink.h"
#include "platform/heap/Handle.h"
-#include "public/platform/modules/webusb/WebUSBClient.h"
namespace blink {
class LocalFrame;
class ScriptState;
class USBDeviceRequestOptions;
-class WebUSBDevice;
class USB final
: public RefCountedGarbageCollectedEventTargetWithInlineData<USB>
- , public ContextLifecycleObserver
- , public WebUSBClient::Observer {
+ , public ContextLifecycleObserver {
DEFINE_WRAPPERTYPEINFO();
REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(USB);
USING_GARBAGE_COLLECTED_MIXIN(USB);
@@ -32,7 +31,7 @@ public:
return new USB(frame);
}
- ~USB() override;
+ virtual ~USB();
// USB.idl
ScriptPromise getDevices(ScriptState*);
@@ -47,9 +46,9 @@ public:
// ContextLifecycleObserver overrides.
void contextDestroyed() override;
- // WebUSBClient::Observer overrides.
- void onDeviceConnected(WebPassOwnPtr<WebUSBDevice>) override;
- void onDeviceDisconnected(WebPassOwnPtr<WebUSBDevice>) override;
+ device::usb::blink::DeviceManager* deviceManager() const { return m_deviceManager.get(); }
esprehn 2016/04/06 20:10:45 did these get renamed from ::wtf at some point?
+
+ void onDeviceChanges(device::usb::blink::DeviceChangeNotificationPtr);
DECLARE_VIRTUAL_TRACE();
EAGERLY_FINALIZE();
@@ -57,7 +56,8 @@ public:
private:
explicit USB(LocalFrame& frame);
- WebUSBClient* m_client;
+ device::usb::blink::DeviceManagerPtr m_deviceManager;
+ device::usb::blink::ChooserServicePtr m_chooserService;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698