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

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

Issue 1592733002: Clear the BLE services list on disconnect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the bluetooth/getPrimaryService.html timeout issue Created 4 years, 11 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 fcb4ada4d4029ff35814bbae1f0fa55a4e70dbc5..cb133c00114cd19bf886157dff17cf9e3c4cdb34 100644
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.cc
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.cc
@@ -322,7 +322,6 @@ void BluetoothDispatcherHost::SetBluetoothAdapterForTesting(
characteristic_id_to_notify_session_.clear();
active_characteristic_threads_.clear();
connections_.clear();
- devices_with_discovered_services_.clear();
}
set_adapter(std::move(mock_adapter));
@@ -524,8 +523,6 @@ void BluetoothDispatcherHost::GattServicesDiscovered(
const std::string& device_id = device->GetAddress();
VLOG(1) << "Services discovered for device: " << device_id;
- devices_with_discovered_services_.insert(device_id);
-
auto iter = pending_primary_services_requests_.find(device_id);
if (iter == pending_primary_services_requests_.end()) {
return;
@@ -788,7 +785,7 @@ void BluetoothDispatcherHost::OnGetPrimaryService(
}
// 3.
- if (IsServicesDiscoveryCompleteForDevice(device_id)) {
+ if (query_result.device->IsGattServicesDiscoveryComplete()) {
VLOG(1) << "Service not found in device.";
RecordGetPrimaryServiceOutcome(UMAGetPrimaryServiceOutcome::NOT_FOUND);
Send(new BluetoothMsg_GetPrimaryServiceError(
@@ -1344,11 +1341,6 @@ BluetoothDispatcherHost::QueryCacheForCharacteristic(
return result;
}
-bool BluetoothDispatcherHost::IsServicesDiscoveryCompleteForDevice(
- const std::string& device_id) {
- return ContainsKey(devices_with_discovered_services_, device_id);
-}
-
void BluetoothDispatcherHost::AddToPendingPrimaryServicesRequest(
const std::string& device_id,
const PrimaryServicesRequest& request) {

Powered by Google App Engine
This is Rietveld 408576698