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

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

Issue 1262163003: Add WebUSB bindings and client interface [part 1] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Handle null navigator.frame() without ASSERT 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
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/webusb/NavigatorUSB.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webusb/NavigatorUSB.h
diff --git a/Source/modules/webusb/NavigatorUSB.h b/Source/modules/webusb/NavigatorUSB.h
new file mode 100644
index 0000000000000000000000000000000000000000..32ba5a0f9e494dac7c1ccbcc5daf4f205851a9a6
--- /dev/null
+++ b/Source/modules/webusb/NavigatorUSB.h
@@ -0,0 +1,39 @@
+// 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 NavigatorUSB_h
+#define NavigatorUSB_h
+
+#include "platform/Supplementable.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class Navigator;
+class USB;
+
+class NavigatorUSB final
+ : public GarbageCollected<NavigatorUSB>
+ , public HeapSupplement<Navigator> {
+ USING_GARBAGE_COLLECTED_MIXIN(NavigatorUSB);
+public:
+ // Gets, or creates, NavigatorUSB supplement on Navigator.
+ // See platform/Supplementable.h
+ static NavigatorUSB& from(Navigator&);
+
+ static USB* usb(Navigator&);
+ USB* usb();
+
+ DECLARE_TRACE();
+
+private:
+ explicit NavigatorUSB(Navigator&);
+ static const char* supplementName();
+
+ Member<USB> m_usb;
+};
+
+} // namespace blink
+
+#endif // NavigatorUSB_h
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/webusb/NavigatorUSB.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698