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

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

Issue 1723723002: bluetooth: Implement Service.getCharacteristics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Clean up Created 4 years, 10 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 47
48 void WebBluetoothImpl::getCharacteristic( 48 void WebBluetoothImpl::getCharacteristic(
49 const blink::WebString& service_instance_id, 49 const blink::WebString& service_instance_id,
50 const blink::WebString& characteristic_uuid, 50 const blink::WebString& characteristic_uuid,
51 blink::WebBluetoothGetCharacteristicCallbacks* callbacks) { 51 blink::WebBluetoothGetCharacteristicCallbacks* callbacks) {
52 GetDispatcher()->getCharacteristic(frame_routing_id_, service_instance_id, 52 GetDispatcher()->getCharacteristic(frame_routing_id_, service_instance_id,
53 characteristic_uuid, callbacks); 53 characteristic_uuid, callbacks);
54 } 54 }
55 55
56 void WebBluetoothImpl::getCharacteristics(
57 const blink::WebString& service_instance_id,
58 const blink::WebString& characteristic_uuid,
59 blink::WebBluetoothGetCharacteristicsCallbacks* callbacks) {
60 GetDispatcher()->getCharacteristics(frame_routing_id_, service_instance_id,
61 characteristic_uuid, callbacks);
62 }
63
56 void WebBluetoothImpl::readValue( 64 void WebBluetoothImpl::readValue(
57 const blink::WebString& characteristic_instance_id, 65 const blink::WebString& characteristic_instance_id,
58 blink::WebBluetoothReadValueCallbacks* callbacks) { 66 blink::WebBluetoothReadValueCallbacks* callbacks) {
59 GetDispatcher()->readValue(frame_routing_id_, characteristic_instance_id, 67 GetDispatcher()->readValue(frame_routing_id_, characteristic_instance_id,
60 callbacks); 68 callbacks);
61 } 69 }
62 70
63 void WebBluetoothImpl::writeValue( 71 void WebBluetoothImpl::writeValue(
64 const blink::WebString& characteristic_instance_id, 72 const blink::WebString& characteristic_instance_id,
65 const blink::WebVector<uint8_t>& value, 73 const blink::WebVector<uint8_t>& value,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 GetDispatcher()->registerCharacteristicObject( 105 GetDispatcher()->registerCharacteristicObject(
98 frame_routing_id_, characteristic_instance_id, characteristic); 106 frame_routing_id_, characteristic_instance_id, characteristic);
99 } 107 }
100 108
101 BluetoothDispatcher* WebBluetoothImpl::GetDispatcher() { 109 BluetoothDispatcher* WebBluetoothImpl::GetDispatcher() {
102 return BluetoothDispatcher::GetOrCreateThreadSpecificInstance( 110 return BluetoothDispatcher::GetOrCreateThreadSpecificInstance(
103 thread_safe_sender_.get()); 111 thread_safe_sender_.get());
104 } 112 }
105 113
106 } // namespace content 114 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698