Chromium Code Reviews| 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..612e296effbccb3ad71d91b621713ad2003f3dfa |
| --- /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/Heap.h" |
|
haraken
2015/07/30 11:26:52
Heap.h => Handle.h (We normally include it.)
Ken Rockot(use gerrit already)
2015/07/30 18:06:54
Done.
|
| + |
| +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 |