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

Unified Diff: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc

Issue 1976453002: Add permission parsing and the removeService API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@idl_changes
Patch Set: Created 4 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: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
diff --git a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
index bb9bfb9549fca8e0e3b84e0ee381c5ee60d3f6a1..c61cac4615fb0c7f4854f2a3c431c4bd2de9033b 100644
--- a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
+++ b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
@@ -1265,6 +1265,26 @@ void BluetoothLowEnergyEventRouter::AddServiceToApp(
}
}
+void BluetoothLowEnergyEventRouter::RemoveServiceFromApp(
+ const std::string& app_id,
+ const std::string& service_id) {
+ const auto& services = app_id_to_service_ids_.find(app_id);
+ if (services == app_id_to_service_ids_.end()) {
+ LOG(WARNING) << "No service mapping exists for app: " << app_id;
+ return;
+ }
+
+ const auto& service =
+ find(services->second.begin(), services->second.end(), service_id);
+ if (service == services->second.end()) {
+ LOG(WARNING) << "Service:" << service_id
+ << " doesn't exist in app: " << app_id;
+ return;
+ }
+
+ services->second.erase(service);
+}
+
void BluetoothLowEnergyEventRouter::RegisterGattService(
const Extension* extension,
const std::string& service_id,

Powered by Google App Engine
This is Rietveld 408576698