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/renderer/bluetooth/bluetooth_dispatcher.h" | 5 #include "content/renderer/bluetooth/bluetooth_dispatcher.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 | 220 |
221 void BluetoothDispatcher::connectGATT( | 221 void BluetoothDispatcher::connectGATT( |
222 int frame_routing_id, | 222 int frame_routing_id, |
223 const blink::WebString& device_id, | 223 const blink::WebString& device_id, |
224 blink::WebBluetoothConnectGATTCallbacks* callbacks) { | 224 blink::WebBluetoothConnectGATTCallbacks* callbacks) { |
225 int request_id = pending_connect_requests_.Add(callbacks); | 225 int request_id = pending_connect_requests_.Add(callbacks); |
226 Send(new BluetoothHostMsg_ConnectGATT(CurrentWorkerId(), request_id, | 226 Send(new BluetoothHostMsg_ConnectGATT(CurrentWorkerId(), request_id, |
227 frame_routing_id, device_id.utf8())); | 227 frame_routing_id, device_id.utf8())); |
228 } | 228 } |
229 | 229 |
| 230 void BluetoothDispatcher::disconnect(int frame_routing_id, |
| 231 const blink::WebString& device_id) { |
| 232 Send(new BluetoothHostMsg_Disconnect(CurrentWorkerId(), frame_routing_id, |
| 233 device_id.utf8())); |
| 234 } |
| 235 |
230 void BluetoothDispatcher::getPrimaryService( | 236 void BluetoothDispatcher::getPrimaryService( |
231 int frame_routing_id, | 237 int frame_routing_id, |
232 const blink::WebString& device_id, | 238 const blink::WebString& device_id, |
233 const blink::WebString& service_uuid, | 239 const blink::WebString& service_uuid, |
234 blink::WebBluetoothGetPrimaryServiceCallbacks* callbacks) { | 240 blink::WebBluetoothGetPrimaryServiceCallbacks* callbacks) { |
235 int request_id = pending_primary_service_requests_.Add( | 241 int request_id = pending_primary_service_requests_.Add( |
236 new BluetoothPrimaryServiceRequest(device_id, service_uuid, callbacks)); | 242 new BluetoothPrimaryServiceRequest(device_id, service_uuid, callbacks)); |
237 Send(new BluetoothHostMsg_GetPrimaryService( | 243 Send(new BluetoothHostMsg_GetPrimaryService( |
238 CurrentWorkerId(), request_id, frame_routing_id, device_id.utf8(), | 244 CurrentWorkerId(), request_id, frame_routing_id, device_id.utf8(), |
239 service_uuid.utf8())); | 245 service_uuid.utf8())); |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 int thread_id, | 792 int thread_id, |
787 const std::string& characteristic_instance_id, | 793 const std::string& characteristic_instance_id, |
788 const std::vector<uint8_t> new_value) { | 794 const std::vector<uint8_t> new_value) { |
789 auto active_iter = active_characteristics_.find(characteristic_instance_id); | 795 auto active_iter = active_characteristics_.find(characteristic_instance_id); |
790 if (active_iter != active_characteristics_.end()) { | 796 if (active_iter != active_characteristics_.end()) { |
791 active_iter->second->dispatchCharacteristicValueChanged(new_value); | 797 active_iter->second->dispatchCharacteristicValueChanged(new_value); |
792 } | 798 } |
793 } | 799 } |
794 | 800 |
795 } // namespace content | 801 } // namespace content |
OLD | NEW |