| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BluetoothSupplement_h | 5 #ifndef BluetoothSupplement_h |
| 6 #define BluetoothSupplement_h | 6 #define BluetoothSupplement_h |
| 7 | 7 |
| 8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 class WebBluetooth; | 12 class WebBluetooth; |
| 13 | 13 |
| 14 // This class is attached to a LocalFrame in WebLocalFrameImpl::setCoreFrame, to | 14 // This class is attached to a LocalFrame in WebLocalFrameImpl::setCoreFrame, to |
| 15 // pass WebFrameClient::bluetooth() (accessible by web/ only) to the Bluetooth | 15 // pass WebFrameClient::bluetooth() (accessible by web/ only) to the Bluetooth |
| 16 // code in modules/. | 16 // code in modules/. |
| 17 class BLINK_EXPORT BluetoothSupplement : public NoBaseWillBeGarbageCollected<Blu
etoothSupplement>, public WillBeHeapSupplement<LocalFrame> { | 17 class BLINK_EXPORT BluetoothSupplement : public GarbageCollected<BluetoothSupple
ment>, public HeapSupplement<LocalFrame> { |
| 18 WTF_MAKE_NONCOPYABLE(BluetoothSupplement); | 18 WTF_MAKE_NONCOPYABLE(BluetoothSupplement); |
| 19 USING_FAST_MALLOC_WILL_BE_REMOVED(BluetoothSupplement); | 19 USING_GARBAGE_COLLECTED_MIXIN(BluetoothSupplement); |
| 20 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(BluetoothSupplement); | |
| 21 | 20 |
| 22 public: | 21 public: |
| 23 static const char* supplementName(); | 22 static const char* supplementName(); |
| 24 | 23 |
| 25 static void provideTo(LocalFrame&, WebBluetooth*); | 24 static void provideTo(LocalFrame&, WebBluetooth*); |
| 26 | 25 |
| 27 // Returns the WebBluetooth attached to the frame. | 26 // Returns the WebBluetooth attached to the frame. |
| 28 static WebBluetooth* from(LocalFrame*); | 27 static WebBluetooth* from(LocalFrame*); |
| 29 | 28 |
| 30 // Returns the WebBluetooth attached to the frame if the frame exists. | 29 // Returns the WebBluetooth attached to the frame if the frame exists. |
| 31 // Otherwise returns nullptr. | 30 // Otherwise returns nullptr. |
| 32 static WebBluetooth* fromScriptState(ScriptState*); | 31 static WebBluetooth* fromScriptState(ScriptState*); |
| 33 // Returns the WebBluetooth attached to the execution context. | 32 // Returns the WebBluetooth attached to the execution context. |
| 34 static WebBluetooth* fromExecutionContext(ExecutionContext*); | 33 static WebBluetooth* fromExecutionContext(ExecutionContext*); |
| 35 | 34 |
| 36 DECLARE_VIRTUAL_TRACE(); | 35 DECLARE_VIRTUAL_TRACE(); |
| 37 | 36 |
| 38 private: | 37 private: |
| 39 explicit BluetoothSupplement(WebBluetooth*); | 38 explicit BluetoothSupplement(WebBluetooth*); |
| 40 | 39 |
| 41 WebBluetooth* m_bluetooth; | 40 WebBluetooth* m_bluetooth; |
| 42 }; | 41 }; |
| 43 | 42 |
| 44 } // namespace blink | 43 } // namespace blink |
| 45 | 44 |
| 46 #endif // BluetoothRoutingId_h | 45 #endif // BluetoothRoutingId_h |
| OLD | NEW |