Chromium Code Reviews| Index: Source/modules/bluetooth/BluetoothSupplement.h |
| diff --git a/Source/modules/bluetooth/BluetoothSupplement.h b/Source/modules/bluetooth/BluetoothSupplement.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bd534a9740df123171093acf166dec5df5026e89 |
| --- /dev/null |
| +++ b/Source/modules/bluetooth/BluetoothSupplement.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 BluetoothSupplement_h |
| +#define BluetoothSupplement_h |
| + |
| +#include "core/frame/LocalFrame.h" |
| + |
| +namespace blink { |
| + |
| +class WebBluetooth; |
| + |
| +class BLINK_EXPORT BluetoothSupplement : public NoBaseWillBeGarbageCollected<BluetoothSupplement>, public WillBeHeapSupplement<LocalFrame> { |
|
scheib
2015/07/16 01:03:03
Class comment please to increase readability for t
Jeffrey Yasskin
2015/07/16 22:27:14
How's this?
scheib
2015/07/16 23:04:17
Great, thank you.
|
| + WTF_MAKE_NONCOPYABLE(BluetoothSupplement); |
| + WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BluetoothSupplement); |
| + |
| +public: |
| + static const char* supplementName(); |
| + |
| + static void provideTo(LocalFrame&, WebBluetooth*); |
| + |
| + static WebBluetooth* from(LocalFrame*); |
|
scheib
2015/07/16 01:03:03
We only expect users to call from(ScriptState*), r
Jeffrey Yasskin
2015/07/16 22:27:14
I've inlined and deleted it.
|
| + |
| + // Returns the WebBluetooth attached to the ScriptState's frame if that exists; |
| + // otherwise the Platform's WebBluetooth. |
| + static WebBluetooth* from(ScriptState*); |
| + |
| + DECLARE_VIRTUAL_TRACE(); |
| + |
| +private: |
| + explicit BluetoothSupplement(WebBluetooth*); |
| + |
| + WebBluetooth* m_bluetooth; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // BluetoothRoutingId_h |