Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Side by Side Diff: content/renderer/bluetooth/web_bluetooth_impl.cc

Issue 1527853002: bluetooth: Add disconnect function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-device-identifier
Patch Set: Fix test that fails after upstream change. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/web_bluetooth_impl.h" 5 #include "content/renderer/bluetooth/web_bluetooth_impl.h"
6 6
7 #include "content/child/thread_safe_sender.h" 7 #include "content/child/thread_safe_sender.h"
8 #include "content/renderer/bluetooth/bluetooth_dispatcher.h" 8 #include "content/renderer/bluetooth/bluetooth_dispatcher.h"
9 #include "ipc/ipc_message.h" 9 #include "ipc/ipc_message.h"
10 10
(...skipping 15 matching lines...) Expand all
26 blink::WebBluetoothRequestDeviceCallbacks* callbacks) { 26 blink::WebBluetoothRequestDeviceCallbacks* callbacks) {
27 GetDispatcher()->requestDevice(frame_routing_id_, options, callbacks); 27 GetDispatcher()->requestDevice(frame_routing_id_, options, callbacks);
28 } 28 }
29 29
30 void WebBluetoothImpl::connectGATT( 30 void WebBluetoothImpl::connectGATT(
31 const blink::WebString& device_id, 31 const blink::WebString& device_id,
32 blink::WebBluetoothConnectGATTCallbacks* callbacks) { 32 blink::WebBluetoothConnectGATTCallbacks* callbacks) {
33 GetDispatcher()->connectGATT(frame_routing_id_, device_id, callbacks); 33 GetDispatcher()->connectGATT(frame_routing_id_, device_id, callbacks);
34 } 34 }
35 35
36 void WebBluetoothImpl::disconnect(const blink::WebString& device_id) {
37 GetDispatcher()->disconnect(frame_routing_id_, device_id);
38 }
39
36 void WebBluetoothImpl::getPrimaryService( 40 void WebBluetoothImpl::getPrimaryService(
37 const blink::WebString& device_id, 41 const blink::WebString& device_id,
38 const blink::WebString& service_uuid, 42 const blink::WebString& service_uuid,
39 blink::WebBluetoothGetPrimaryServiceCallbacks* callbacks) { 43 blink::WebBluetoothGetPrimaryServiceCallbacks* callbacks) {
40 GetDispatcher()->getPrimaryService(frame_routing_id_, device_id, service_uuid, 44 GetDispatcher()->getPrimaryService(frame_routing_id_, device_id, service_uuid,
41 callbacks); 45 callbacks);
42 } 46 }
43 47
44 void WebBluetoothImpl::getCharacteristic( 48 void WebBluetoothImpl::getCharacteristic(
45 const blink::WebString& service_instance_id, 49 const blink::WebString& service_instance_id,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 GetDispatcher()->registerCharacteristicObject( 97 GetDispatcher()->registerCharacteristicObject(
94 frame_routing_id_, characteristic_instance_id, characteristic); 98 frame_routing_id_, characteristic_instance_id, characteristic);
95 } 99 }
96 100
97 BluetoothDispatcher* WebBluetoothImpl::GetDispatcher() { 101 BluetoothDispatcher* WebBluetoothImpl::GetDispatcher() {
98 return BluetoothDispatcher::GetOrCreateThreadSpecificInstance( 102 return BluetoothDispatcher::GetOrCreateThreadSpecificInstance(
99 thread_safe_sender_.get()); 103 thread_safe_sender_.get());
100 } 104 }
101 105
102 } // namespace content 106 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/bluetooth/web_bluetooth_impl.h ('k') | third_party/WebKit/LayoutTests/bluetooth/connectGATT.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698