| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_CHILD_BLUETOOTH_WEB_BLUETOOTH_IMPL_H_ | |
| 6 #define CONTENT_CHILD_BLUETOOTH_WEB_BLUETOOTH_IMPL_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/compiler_specific.h" | |
| 11 #include "base/memory/ref_counted.h" | |
| 12 #include "content/common/content_export.h" | |
| 13 #include "third_party/WebKit/public/platform/modules/bluetooth/WebBluetooth.h" | |
| 14 | |
| 15 namespace content { | |
| 16 | |
| 17 class BluetoothDispatcher; | |
| 18 class ThreadSafeSender; | |
| 19 | |
| 20 // Implementation of blink::WebBluetooth. Passes calls through to the thread | |
| 21 // specific BluetoothDispatcher. | |
| 22 class CONTENT_EXPORT WebBluetoothImpl | |
| 23 : NON_EXPORTED_BASE(public blink::WebBluetooth) { | |
| 24 public: | |
| 25 explicit WebBluetoothImpl(ThreadSafeSender* thread_safe_sender); | |
| 26 ~WebBluetoothImpl(); | |
| 27 | |
| 28 // blink::WebBluetooth interface: | |
| 29 void requestDevice( | |
| 30 const blink::WebRequestDeviceOptions& options, | |
| 31 blink::WebBluetoothRequestDeviceCallbacks* callbacks) override; | |
| 32 void connectGATT(const blink::WebString& device_instance_id, | |
| 33 blink::WebBluetoothConnectGATTCallbacks* callbacks) override; | |
| 34 void getPrimaryService( | |
| 35 const blink::WebString& device_instance_id, | |
| 36 const blink::WebString& service_uuid, | |
| 37 blink::WebBluetoothGetPrimaryServiceCallbacks* callbacks) override; | |
| 38 void getCharacteristic( | |
| 39 const blink::WebString& service_instance_id, | |
| 40 const blink::WebString& characteristic_uuid, | |
| 41 blink::WebBluetoothGetCharacteristicCallbacks* callbacks) override; | |
| 42 void readValue(const blink::WebString& characteristic_instance_id, | |
| 43 blink::WebBluetoothReadValueCallbacks* callbacks) override; | |
| 44 void writeValue(const blink::WebString& characteristic_instance_id, | |
| 45 const std::vector<uint8_t>& value, | |
| 46 blink::WebBluetoothWriteValueCallbacks*) override; | |
| 47 | |
| 48 private: | |
| 49 BluetoothDispatcher* GetDispatcher(); | |
| 50 | |
| 51 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(WebBluetoothImpl); | |
| 54 }; | |
| 55 | |
| 56 } // namespace content | |
| 57 | |
| 58 #endif // CONTENT_CHILD_BLUETOOTH_WEB_BLUETOOTH_IMPL_H_ | |
| OLD | NEW |