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 #ifndef CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 void OnGetCharacteristic(int thread_id, | 170 void OnGetCharacteristic(int thread_id, |
171 int request_id, | 171 int request_id, |
172 int frame_routing_id, | 172 int frame_routing_id, |
173 const std::string& service_instance_id, | 173 const std::string& service_instance_id, |
174 const std::string& characteristic_uuid); | 174 const std::string& characteristic_uuid); |
175 void OnGetCharacteristics(int thread_id, | 175 void OnGetCharacteristics(int thread_id, |
176 int request_id, | 176 int request_id, |
177 int frame_routing_id, | 177 int frame_routing_id, |
178 const std::string& service_instance_id, | 178 const std::string& service_instance_id, |
179 const std::string& characteristics_uuid); | 179 const std::string& characteristics_uuid); |
180 void OnReadValue(int thread_id, | |
181 int request_id, | |
182 int frame_routing_id, | |
183 const std::string& characteristic_instance_id); | |
184 | 180 |
185 // Callbacks for BluetoothDevice::OnRequestDevice. | 181 // Callbacks for BluetoothDevice::OnRequestDevice. |
186 // If necessary, the adapter must be obtained before continuing to Impl. | 182 // If necessary, the adapter must be obtained before continuing to Impl. |
187 void OnGetAdapter(base::Closure continuation, | 183 void OnGetAdapter(base::Closure continuation, |
188 scoped_refptr<device::BluetoothAdapter> adapter); | 184 scoped_refptr<device::BluetoothAdapter> adapter); |
189 void OnRequestDeviceImpl( | 185 void OnRequestDeviceImpl( |
190 int thread_id, | 186 int thread_id, |
191 int request_id, | 187 int request_id, |
192 int frame_routing_id, | 188 int frame_routing_id, |
193 const std::vector<content::BluetoothScanFilter>& filters, | 189 const std::vector<content::BluetoothScanFilter>& filters, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 base::TimeTicks start_time, | 222 base::TimeTicks start_time, |
227 device::BluetoothDevice::ConnectErrorCode error_code); | 223 device::BluetoothDevice::ConnectErrorCode error_code); |
228 | 224 |
229 // Adds the service to the map of services' instance ids to devices' instance | 225 // Adds the service to the map of services' instance ids to devices' instance |
230 // ids and sends the service to the renderer. | 226 // ids and sends the service to the renderer. |
231 void AddToServicesMapAndSendGetPrimaryServiceSuccess( | 227 void AddToServicesMapAndSendGetPrimaryServiceSuccess( |
232 const device::BluetoothGattService& service, | 228 const device::BluetoothGattService& service, |
233 int thread_id, | 229 int thread_id, |
234 int request_id); | 230 int request_id); |
235 | 231 |
236 // Callbacks for BluetoothGattCharacteristic::ReadRemoteCharacteristic. | |
237 void OnCharacteristicValueRead(int thread_id, | |
238 int request_id, | |
239 const std::vector<uint8_t>& value); | |
240 void OnCharacteristicReadValueError( | |
241 int thread_id, | |
242 int request_id, | |
243 device::BluetoothGattService::GattErrorCode); | |
244 | |
245 // Functions to query the platform cache for the bluetooth object. | 232 // Functions to query the platform cache for the bluetooth object. |
246 // result.outcome == CacheQueryOutcome::SUCCESS if the object was found in the | 233 // result.outcome == CacheQueryOutcome::SUCCESS if the object was found in the |
247 // cache. Otherwise result.outcome that can used to record the outcome and | 234 // cache. Otherwise result.outcome that can used to record the outcome and |
248 // result.error will contain the error that should be send to the renderer. | 235 // result.error will contain the error that should be send to the renderer. |
249 // One of the possible outcomes is BAD_RENDERER. In this case the outcome | 236 // One of the possible outcomes is BAD_RENDERER. In this case the outcome |
250 // was already recorded and since there renderer crashed there is no need to | 237 // was already recorded and since there renderer crashed there is no need to |
251 // send a response. | 238 // send a response. |
252 | 239 |
253 // Queries the platform cache for a Device with |device_id| for |origin|. | 240 // Queries the platform cache for a Device with |device_id| for |origin|. |
254 // Fills in the |outcome| field and the |device| field if successful. | 241 // Fills in the |outcome| field and the |device| field if successful. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 // copies verify they are also used on the UI thread. | 300 // copies verify they are also used on the UI thread. |
314 base::WeakPtr<BluetoothDispatcherHost> weak_ptr_on_ui_thread_; | 301 base::WeakPtr<BluetoothDispatcherHost> weak_ptr_on_ui_thread_; |
315 base::WeakPtrFactory<BluetoothDispatcherHost> weak_ptr_factory_; | 302 base::WeakPtrFactory<BluetoothDispatcherHost> weak_ptr_factory_; |
316 | 303 |
317 DISALLOW_COPY_AND_ASSIGN(BluetoothDispatcherHost); | 304 DISALLOW_COPY_AND_ASSIGN(BluetoothDispatcherHost); |
318 }; | 305 }; |
319 | 306 |
320 } // namespace content | 307 } // namespace content |
321 | 308 |
322 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_ | 309 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_ |
OLD | NEW |