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 #include "ipc/ipc_message.h" | |
9 | 10 |
10 namespace content { | 11 namespace content { |
11 | 12 |
12 WebBluetoothImpl::WebBluetoothImpl(ThreadSafeSender* thread_safe_sender) | 13 WebBluetoothImpl::WebBluetoothImpl(ThreadSafeSender* thread_safe_sender) |
13 : thread_safe_sender_(thread_safe_sender) { | 14 : WebBluetoothImpl(thread_safe_sender, MSG_ROUTING_NONE) { |
15 } | |
16 | |
17 WebBluetoothImpl::WebBluetoothImpl(ThreadSafeSender* thread_safe_sender, | |
18 int frame_routing_id) | |
19 : thread_safe_sender_(thread_safe_sender), | |
20 frame_routing_id_(frame_routing_id) { | |
jochen (gone - plz use gerrit)
2015/07/15 13:40:55
stuff in child/ shouldn't know about frames.
why
Jeffrey Yasskin
2015/07/15 15:47:16
Would this be better if I called it a "routing_id"
| |
14 } | 21 } |
15 | 22 |
16 WebBluetoothImpl::~WebBluetoothImpl() { | 23 WebBluetoothImpl::~WebBluetoothImpl() { |
17 } | 24 } |
18 | 25 |
19 void WebBluetoothImpl::requestDevice( | 26 void WebBluetoothImpl::requestDevice( |
20 const blink::WebRequestDeviceOptions& options, | 27 const blink::WebRequestDeviceOptions& options, |
21 blink::WebBluetoothRequestDeviceCallbacks* callbacks) { | 28 blink::WebBluetoothRequestDeviceCallbacks* callbacks) { |
22 GetDispatcher()->requestDevice(options, callbacks); | 29 GetDispatcher()->requestDevice(frame_routing_id_, options, callbacks); |
23 } | 30 } |
24 | 31 |
25 void WebBluetoothImpl::connectGATT(const blink::WebString& device_instance_id, | 32 void WebBluetoothImpl::connectGATT(const blink::WebString& device_instance_id, |
26 blink::WebBluetoothConnectGATTCallbacks* callbacks) { | 33 blink::WebBluetoothConnectGATTCallbacks* callbacks) { |
27 GetDispatcher()->connectGATT(device_instance_id, callbacks); | 34 GetDispatcher()->connectGATT(device_instance_id, callbacks); |
28 } | 35 } |
29 | 36 |
30 void WebBluetoothImpl::getPrimaryService( | 37 void WebBluetoothImpl::getPrimaryService( |
31 const blink::WebString& device_instance_id, | 38 const blink::WebString& device_instance_id, |
32 const blink::WebString& service_uuid, | 39 const blink::WebString& service_uuid, |
(...skipping 22 matching lines...) Expand all Loading... | |
55 blink::WebBluetoothWriteValueCallbacks* callbacks) { | 62 blink::WebBluetoothWriteValueCallbacks* callbacks) { |
56 GetDispatcher()->writeValue(characteristic_instance_id, value, callbacks); | 63 GetDispatcher()->writeValue(characteristic_instance_id, value, callbacks); |
57 } | 64 } |
58 | 65 |
59 BluetoothDispatcher* WebBluetoothImpl::GetDispatcher() { | 66 BluetoothDispatcher* WebBluetoothImpl::GetDispatcher() { |
60 return BluetoothDispatcher::GetOrCreateThreadSpecificInstance( | 67 return BluetoothDispatcher::GetOrCreateThreadSpecificInstance( |
61 thread_safe_sender_.get()); | 68 thread_safe_sender_.get()); |
62 } | 69 } |
63 | 70 |
64 } // namespace content | 71 } // namespace content |
OLD | NEW |