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

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 jyasskin'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
« no previous file with comments | « content/child/bluetooth/bluetooth_dispatcher.h ('k') | content/common/bluetooth/bluetooth_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..576fa8dde52826cdbcbe0235eba9cd41ade778e0 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,18 @@ 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(
+ // TODO(ortuno): Return more descriptive error messages.
+ // http://crbug.com/490419
+ WebBluetoothErrorFromBluetoothError(error_type), ""));
+ pending_requests_.Remove(request_id);
+}
+
void BluetoothDispatcher::OnConnectGATTSuccess(
int thread_id,
int request_id,
@@ -154,14 +167,16 @@ 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(
+ // TODO(ortuno): Return more descriptive error messages.
+ // http://crbug.com/490419
WebBluetoothErrorFromBluetoothError(error_type), ""));
- pending_requests_.Remove(request_id);
+ pending_connect_requests_.Remove(request_id);
}
} // namespace content
« no previous file with comments | « content/child/bluetooth/bluetooth_dispatcher.h ('k') | content/common/bluetooth/bluetooth_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698