| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_CHILD_BLUETOOTH_WEB_BLUETOOTH_IMPL_H_ | 5 #ifndef CONTENT_CHILD_BLUETOOTH_WEB_BLUETOOTH_IMPL_H_ |
| 6 #define CONTENT_CHILD_BLUETOOTH_WEB_BLUETOOTH_IMPL_H_ | 6 #define CONTENT_CHILD_BLUETOOTH_WEB_BLUETOOTH_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "third_party/WebKit/public/platform/modules/bluetooth/WebBluetooth.h" | 13 #include "third_party/WebKit/public/platform/modules/bluetooth/WebBluetooth.h" |
| 14 | 14 |
| 15 namespace blink { |
| 16 class WebBluetoothGATTCharacteristic; |
| 17 } |
| 18 |
| 15 namespace content { | 19 namespace content { |
| 16 | 20 |
| 17 class BluetoothDispatcher; | 21 class BluetoothDispatcher; |
| 18 class ThreadSafeSender; | 22 class ThreadSafeSender; |
| 19 | 23 |
| 20 // Implementation of blink::WebBluetooth. Passes calls through to the thread | 24 // Implementation of blink::WebBluetooth. Passes calls through to the thread |
| 21 // specific BluetoothDispatcher. | 25 // specific BluetoothDispatcher. |
| 22 class CONTENT_EXPORT WebBluetoothImpl | 26 class CONTENT_EXPORT WebBluetoothImpl |
| 23 : NON_EXPORTED_BASE(public blink::WebBluetooth) { | 27 : NON_EXPORTED_BASE(public blink::WebBluetooth) { |
| 24 public: | 28 public: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 38 blink::WebBluetoothGetPrimaryServiceCallbacks* callbacks) override; | 42 blink::WebBluetoothGetPrimaryServiceCallbacks* callbacks) override; |
| 39 void getCharacteristic( | 43 void getCharacteristic( |
| 40 const blink::WebString& service_instance_id, | 44 const blink::WebString& service_instance_id, |
| 41 const blink::WebString& characteristic_uuid, | 45 const blink::WebString& characteristic_uuid, |
| 42 blink::WebBluetoothGetCharacteristicCallbacks* callbacks) override; | 46 blink::WebBluetoothGetCharacteristicCallbacks* callbacks) override; |
| 43 void readValue(const blink::WebString& characteristic_instance_id, | 47 void readValue(const blink::WebString& characteristic_instance_id, |
| 44 blink::WebBluetoothReadValueCallbacks* callbacks) override; | 48 blink::WebBluetoothReadValueCallbacks* callbacks) override; |
| 45 void writeValue(const blink::WebString& characteristic_instance_id, | 49 void writeValue(const blink::WebString& characteristic_instance_id, |
| 46 const std::vector<uint8_t>& value, | 50 const std::vector<uint8_t>& value, |
| 47 blink::WebBluetoothWriteValueCallbacks*) override; | 51 blink::WebBluetoothWriteValueCallbacks*) override; |
| 52 void startNotifications(const blink::WebString& characteristic_instance_id, |
| 53 blink::WebBluetoothGATTCharacteristic* characteristic, |
| 54 blink::WebBluetoothNotificationsCallbacks*) override; |
| 55 void stopNotifications(const blink::WebString& characteristic_instance_id, |
| 56 blink::WebBluetoothGATTCharacteristic* characteristic, |
| 57 blink::WebBluetoothNotificationsCallbacks*) override; |
| 58 void characteristicObjectRemoved( |
| 59 const blink::WebString& characteristic_instance_id, |
| 60 blink::WebBluetoothGATTCharacteristic* characteristic) override; |
| 48 | 61 |
| 49 private: | 62 private: |
| 50 BluetoothDispatcher* GetDispatcher(); | 63 BluetoothDispatcher* GetDispatcher(); |
| 51 | 64 |
| 52 const scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 65 const scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| 53 const int frame_routing_id_; | 66 const int frame_routing_id_; |
| 54 | 67 |
| 55 DISALLOW_COPY_AND_ASSIGN(WebBluetoothImpl); | 68 DISALLOW_COPY_AND_ASSIGN(WebBluetoothImpl); |
| 56 }; | 69 }; |
| 57 | 70 |
| 58 } // namespace content | 71 } // namespace content |
| 59 | 72 |
| 60 #endif // CONTENT_CHILD_BLUETOOTH_WEB_BLUETOOTH_IMPL_H_ | 73 #endif // CONTENT_CHILD_BLUETOOTH_WEB_BLUETOOTH_IMPL_H_ |
| OLD | NEW |