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

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

Issue 1245363002: Add WebUSB bindings and client interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: cleanup, better error reporting Created 5 years, 5 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: Source/modules/webusb/USB.h
diff --git a/Source/modules/webusb/USB.h b/Source/modules/webusb/USB.h
new file mode 100644
index 0000000000000000000000000000000000000000..c41b0f1af558e1c59c2f9ce9395076250689d9ae
--- /dev/null
+++ b/Source/modules/webusb/USB.h
@@ -0,0 +1,42 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef USB_h
+#define USB_h
+
+#include "bindings/core/v8/ScriptPromise.h"
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "modules/webusb/USBController.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class LocalFrame;
+class ScriptState;
+class USBDeviceEnumerationOptions;
+
+class USB final
+ : public GarbageCollectedFinalized<USB>
+ , public ScriptWrappable {
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ static USB* create(LocalFrame& frame)
+ {
+ return new USB(frame);
+ }
+
+ USB(LocalFrame& frame);
+
+ // USBDeviceEnumeration interface:
Reilly Grant (use Gerrit) 2015/07/28 22:51:42 I think this comment is obsolete.
Ken Rockot(use gerrit already) 2015/07/28 23:21:39 Done.
+ ScriptPromise getDevices(ScriptState*, const USBDeviceEnumerationOptions&);
+
+ DECLARE_VIRTUAL_TRACE();
+
+private:
+ RawPtrWillBeMember<USBController> m_controller;
+};
+
+} // namespace blink
+
+#endif // USB_h

Powered by Google App Engine
This is Rietveld 408576698