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

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

Issue 1340523004: Implement USB connection events through the WebUSB client interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Change Member back to PersistentWillBeMember. Created 5 years, 3 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/USB.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webusb/USB.h
diff --git a/Source/modules/webusb/USB.h b/Source/modules/webusb/USB.h
index d8c252b5b286e9925602335842c18f7ab5571a3f..9fe5ffe54a4bc4e69a53d29a89738879165bdaf6 100644
--- a/Source/modules/webusb/USB.h
+++ b/Source/modules/webusb/USB.h
@@ -10,15 +10,18 @@
#include "core/events/EventTarget.h"
#include "modules/webusb/USBController.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 RefCountedGarbageCollectedEventTargetWithInlineData<USB>
+ , public WebUSBClient::Observer {
DEFINE_WRAPPERTYPEINFO();
REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(USB);
public:
@@ -27,6 +30,8 @@ public:
return new USB(frame);
}
+ ~USB() override;
+
// USB.idl
ScriptPromise getDevices(ScriptState*);
ScriptPromise requestDevice(ScriptState*, const USBDeviceRequestOptions&);
@@ -37,6 +42,10 @@ public:
ExecutionContext* executionContext() const override;
const AtomicString& interfaceName() const override;
+ // WebUSBClient::Observer overrides.
+ void onDeviceConnected(WebPassOwnPtr<WebUSBDevice>) override;
+ void onDeviceDisconnected(WebPassOwnPtr<WebUSBDevice>) override;
+
DECLARE_VIRTUAL_TRACE();
private:
« no previous file with comments | « no previous file | Source/modules/webusb/USB.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698