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

Unified Diff: content/child/bluetooth/bluetooth_dispatcher.cc

Issue 1120373004: bluetooth: Browser-side implementation of connectGATT. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-request-device-implementation
Patch Set: Address scheib's comments Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698