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

Unified Diff: Source/modules/webusb/USBController.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/webusb/USB.idl ('k') | Source/modules/webusb/USBController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webusb/USBController.h
diff --git a/Source/modules/webusb/USBController.h b/Source/modules/webusb/USBController.h
new file mode 100644
index 0000000000000000000000000000000000000000..7564a3ffb7751b59a9a575ded47f70edbeff1be3
--- /dev/null
+++ b/Source/modules/webusb/USBController.h
@@ -0,0 +1,44 @@
+// 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 USBController_h
+#define USBController_h
+
+#include "core/frame/LocalFrame.h"
+#include "core/frame/LocalFrameLifecycleObserver.h"
+#include "modules/ModulesExport.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class WebUSBClient;
+
+class MODULES_EXPORT USBController final
+ : public NoBaseWillBeGarbageCollectedFinalized<USBController>
+ , public WillBeHeapSupplement<LocalFrame>
+ , public LocalFrameLifecycleObserver {
+ WTF_MAKE_NONCOPYABLE(USBController);
+public:
+ virtual ~USBController();
+
+ WebUSBClient* client() { return m_client; }
+
+ static void provideTo(LocalFrame&, WebUSBClient*);
+ static USBController& from(LocalFrame&);
+ static const char* supplementName();
+
+ DECLARE_VIRTUAL_TRACE();
+
+private:
+ USBController(LocalFrame&, WebUSBClient*);
+
+ // Inherited from LocalFrameLifecycleObserver.
+ void willDetachFrameHost() override;
+
+ WebUSBClient* m_client;
+};
+
+} // namespace blink
+
+#endif // USBController_h
« no previous file with comments | « Source/modules/webusb/USB.idl ('k') | Source/modules/webusb/USBController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698