Chromium Code Reviews| Index: content/child/bluetooth/bluetooth_dispatcher.cc |
| diff --git a/content/child/bluetooth/bluetooth_dispatcher.cc b/content/child/bluetooth/bluetooth_dispatcher.cc |
| index c76c5ef571eadad3147379c3132f856490e77285..4ea6154ab52f70d07ea02ff92a8ae778424261cf 100644 |
| --- a/content/child/bluetooth/bluetooth_dispatcher.cc |
| +++ b/content/child/bluetooth/bluetooth_dispatcher.cc |
| @@ -101,6 +101,7 @@ void BluetoothDispatcher::OnMessageReceived(const IPC::Message& msg) { |
| OnRequestDeviceSuccess); |
| IPC_MESSAGE_HANDLER(BluetoothMsg_RequestDeviceError, OnRequestDeviceError); |
| IPC_MESSAGE_HANDLER(BluetoothMsg_ConnectGATTSuccess, OnConnectGATTSuccess); |
| + IPC_MESSAGE_HANDLER(BluetoothMsg_ConnectGATTError, OnConnectGATTError); |
| IPC_MESSAGE_UNHANDLED(handled = false) |
| IPC_END_MESSAGE_MAP() |
| DCHECK(handled) << "Unhandled message:" << msg.type(); |
| @@ -143,6 +144,16 @@ void BluetoothDispatcher::OnRequestDeviceSuccess( |
| pending_requests_.Remove(request_id); |
| } |
| +void BluetoothDispatcher::OnRequestDeviceError(int thread_id, |
| + int request_id, |
| + BluetoothError error_type) { |
| + DCHECK(pending_requests_.Lookup(request_id)) << request_id; |
| + pending_requests_.Lookup(request_id) |
| + ->onError(new WebBluetoothError( |
| + WebBluetoothErrorFromBluetoothError(error_type), "")); |
| + pending_requests_.Remove(request_id); |
| +} |
| + |
| void BluetoothDispatcher::OnConnectGATTSuccess( |
| int thread_id, |
| int request_id, |
| @@ -154,14 +165,14 @@ void BluetoothDispatcher::OnConnectGATTSuccess( |
| pending_connect_requests_.Remove(request_id); |
| } |
| -void BluetoothDispatcher::OnRequestDeviceError(int thread_id, |
| - int request_id, |
| - BluetoothError error_type) { |
| - DCHECK(pending_requests_.Lookup(request_id)) << request_id; |
| - pending_requests_.Lookup(request_id) |
| +void BluetoothDispatcher::OnConnectGATTError(int thread_id, |
| + int request_id, |
| + BluetoothError error_type) { |
| + DCHECK(pending_connect_requests_.Lookup(request_id)) << request_id; |
| + pending_connect_requests_.Lookup(request_id) |
| ->onError(new WebBluetoothError( |
| WebBluetoothErrorFromBluetoothError(error_type), "")); |
|
Jeffrey Yasskin
2015/05/20 22:19:48
"" is bad here, since it leaves developers guessin
ortuno
2015/05/20 23:35:19
TODO added.
|
| - pending_requests_.Remove(request_id); |
| + pending_connect_requests_.Remove(request_id); |
| } |
| } // namespace content |