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..d7b0875b2180491d52818e69e74491cc75344704 |
--- /dev/null |
+++ b/Source/modules/webusb/USBController.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 USBController_h |
+#define USBController_h |
+ |
+#include "core/frame/LocalFrame.h" |
+#include "core/frame/LocalFrameLifecycleObserver.h" |
+#include "platform/heap/Handle.h" |
+ |
+namespace blink { |
+class WebUSBClient; |
+ |
+class 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 |