| 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 #include "content/child/bluetooth/web_bluetooth_impl.h" | 5 #include "content/child/bluetooth/web_bluetooth_impl.h" |
| 6 | 6 |
| 7 #include "content/child/bluetooth/bluetooth_dispatcher.h" | 7 #include "content/child/bluetooth/bluetooth_dispatcher.h" |
| 8 #include "content/child/thread_safe_sender.h" | 8 #include "content/child/thread_safe_sender.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 | 11 |
| 12 WebBluetoothImpl::WebBluetoothImpl(ThreadSafeSender* thread_safe_sender) | 12 WebBluetoothImpl::WebBluetoothImpl(ThreadSafeSender* thread_safe_sender) |
| 13 : thread_safe_sender_(thread_safe_sender) { | 13 : thread_safe_sender_(thread_safe_sender) { |
| 14 } | 14 } |
| 15 | 15 |
| 16 WebBluetoothImpl::~WebBluetoothImpl() { | 16 WebBluetoothImpl::~WebBluetoothImpl() { |
| 17 } | 17 } |
| 18 | 18 |
| 19 void WebBluetoothImpl::requestDevice( | 19 void WebBluetoothImpl::requestDevice( |
| 20 const blink::WebRequestDeviceOptions& options, |
| 20 blink::WebBluetoothRequestDeviceCallbacks* callbacks) { | 21 blink::WebBluetoothRequestDeviceCallbacks* callbacks) { |
| 21 GetDispatcher()->requestDevice(callbacks); | 22 GetDispatcher()->requestDevice(options, callbacks); |
| 22 } | 23 } |
| 23 | 24 |
| 24 void WebBluetoothImpl::connectGATT(const blink::WebString& device_instance_id, | 25 void WebBluetoothImpl::connectGATT(const blink::WebString& device_instance_id, |
| 25 blink::WebBluetoothConnectGATTCallbacks* callbacks) { | 26 blink::WebBluetoothConnectGATTCallbacks* callbacks) { |
| 26 GetDispatcher()->connectGATT(device_instance_id, callbacks); | 27 GetDispatcher()->connectGATT(device_instance_id, callbacks); |
| 27 } | 28 } |
| 28 | 29 |
| 29 void WebBluetoothImpl::getPrimaryService( | 30 void WebBluetoothImpl::getPrimaryService( |
| 30 const blink::WebString& device_instance_id, | 31 const blink::WebString& device_instance_id, |
| 31 const blink::WebString& service_uuid, | 32 const blink::WebString& service_uuid, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 47 blink::WebBluetoothReadValueCallbacks* callbacks) { | 48 blink::WebBluetoothReadValueCallbacks* callbacks) { |
| 48 GetDispatcher()->readValue(characteristic_instance_id, callbacks); | 49 GetDispatcher()->readValue(characteristic_instance_id, callbacks); |
| 49 } | 50 } |
| 50 | 51 |
| 51 BluetoothDispatcher* WebBluetoothImpl::GetDispatcher() { | 52 BluetoothDispatcher* WebBluetoothImpl::GetDispatcher() { |
| 52 return BluetoothDispatcher::GetOrCreateThreadSpecificInstance( | 53 return BluetoothDispatcher::GetOrCreateThreadSpecificInstance( |
| 53 thread_safe_sender_.get()); | 54 thread_safe_sender_.get()); |
| 54 } | 55 } |
| 55 | 56 |
| 56 } // namespace content | 57 } // namespace content |
| OLD | NEW |