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

Unified Diff: content/browser/bluetooth/bluetooth_dispatcher_host.cc

Issue 1082273006: bluetooth: Impl uses new WebBluetoothGATTRemoteServer content/browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes based on comments Created 5 years, 8 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/browser/bluetooth/bluetooth_dispatcher_host.cc
diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.cc b/content/browser/bluetooth/bluetooth_dispatcher_host.cc
index 2af1e89f35adf594085f727af85d16e1efae807f..9cf6967c4d743d8fb9a053717b4d0a07b5fe14a1 100644
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.cc
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.cc
@@ -36,6 +36,7 @@ bool BluetoothDispatcherHost::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(BluetoothDispatcherHost, message)
IPC_MESSAGE_HANDLER(BluetoothHostMsg_RequestDevice, OnRequestDevice)
+ IPC_MESSAGE_HANDLER(BluetoothHostMsg_ConnectGATT, OnConnectGATT)
IPC_MESSAGE_HANDLER(BluetoothHostMsg_SetBluetoothMockDataSetForTesting,
OnSetBluetoothMockDataSetForTesting)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -139,6 +140,29 @@ void BluetoothDispatcherHost::OnRequestDeviceOnUI(int thread_id,
NOTREACHED();
}
+void BluetoothDispatcherHost::OnConnectGATT(
+ int thread_id,
+ int request_id,
+ const std::string& device_instance_id) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ BrowserThread::PostTask(BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(
+ &BluetoothDispatcherHost::OnConnectGATTOnUI,
+ this, thread_id, request_id, device_instance_id));
+}
+
+void BluetoothDispatcherHost::OnConnectGATTOnUI(
+ int thread_id,
+ int request_id,
+ const std::string& device_instance_id) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ // TODO(ortuno): Add actual implementation of connectGATT. This needs to be
+ // done after the "allowed devices map" is implemented.
+ Send(new BluetoothMsg_ConnectGATTSuccess(thread_id, request_id,
+ device_instance_id));
+}
+
void BluetoothDispatcherHost::OnSetBluetoothMockDataSetForTesting(
const std::string& name) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
« no previous file with comments | « content/browser/bluetooth/bluetooth_dispatcher_host.h ('k') | content/child/bluetooth/bluetooth_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698