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

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

Issue 1973343005: Remove service, add device, in BluetoothLocalGattService::Delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 4cc9f9748aae3f1f2de595464ee9ea4b89aeafc3..8cbe640939cd07196a261343d6fb3f27af4eab84 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
@@ -1091,12 +1091,12 @@ void BluetoothLowEnergyEventRouter::GattDescriptorValueChanged(
}
void BluetoothLowEnergyEventRouter::OnCharacteristicReadRequest(
- const device::BluetoothLocalGattService* service,
+ const device::BluetoothDevice* device,
const device::BluetoothLocalGattCharacteristic* characteristic,
int offset,
const Delegate::ValueCallback& value_callback,
const Delegate::ErrorCallback& error_callback) {
- const std::string& service_id = service->GetIdentifier();
+ const std::string& service_id = characteristic->GetService()->GetIdentifier();
if (service_id_to_extension_id_.find(service_id) ==
service_id_to_extension_id_.end()) {
LOG(DFATAL) << "Service with ID " << service_id
@@ -1117,13 +1117,13 @@ void BluetoothLowEnergyEventRouter::OnCharacteristicReadRequest(
}
void BluetoothLowEnergyEventRouter::OnCharacteristicWriteRequest(
- const device::BluetoothLocalGattService* service,
+ const device::BluetoothDevice* device,
const device::BluetoothLocalGattCharacteristic* characteristic,
const std::vector<uint8_t>& value,
int offset,
const base::Closure& callback,
const Delegate::ErrorCallback& error_callback) {
- const std::string& service_id = service->GetIdentifier();
+ const std::string& service_id = characteristic->GetService()->GetIdentifier();
if (service_id_to_extension_id_.find(service_id) ==
service_id_to_extension_id_.end()) {
LOG(DFATAL) << "Service with ID " << service_id
@@ -1148,12 +1148,13 @@ void BluetoothLowEnergyEventRouter::OnCharacteristicWriteRequest(
}
void BluetoothLowEnergyEventRouter::OnDescriptorReadRequest(
- const device::BluetoothLocalGattService* service,
+ const device::BluetoothDevice* device,
const device::BluetoothLocalGattDescriptor* descriptor,
int offset,
const Delegate::ValueCallback& value_callback,
const Delegate::ErrorCallback& error_callback) {
- const std::string& service_id = service->GetIdentifier();
+ const std::string& service_id =
+ descriptor->GetCharacteristic()->GetService()->GetIdentifier();
if (service_id_to_extension_id_.find(service_id) ==
service_id_to_extension_id_.end()) {
LOG(DFATAL) << "Service with ID " << service_id
@@ -1176,13 +1177,14 @@ void BluetoothLowEnergyEventRouter::OnDescriptorReadRequest(
}
void BluetoothLowEnergyEventRouter::OnDescriptorWriteRequest(
- const device::BluetoothLocalGattService* service,
+ const device::BluetoothDevice* device,
const device::BluetoothLocalGattDescriptor* descriptor,
const std::vector<uint8_t>& value,
int offset,
const base::Closure& callback,
const Delegate::ErrorCallback& error_callback) {
- const std::string& service_id = service->GetIdentifier();
+ const std::string& service_id =
+ descriptor->GetCharacteristic()->GetService()->GetIdentifier();
if (service_id_to_extension_id_.find(service_id) ==
service_id_to_extension_id_.end()) {
LOG(DFATAL) << "Service with ID " << service_id
@@ -1207,11 +1209,11 @@ void BluetoothLowEnergyEventRouter::OnDescriptorWriteRequest(
}
void BluetoothLowEnergyEventRouter::OnNotificationsStart(
- const device::BluetoothLocalGattService* service,
+ const device::BluetoothDevice* device,
const device::BluetoothLocalGattCharacteristic* characteristic) {}
void BluetoothLowEnergyEventRouter::OnNotificationsStop(
- const device::BluetoothLocalGattService* service,
+ const device::BluetoothDevice* device,
const device::BluetoothLocalGattCharacteristic* characteristic) {}
void BluetoothLowEnergyEventRouter::OnExtensionUnloaded(

Powered by Google App Engine
This is Rietveld 408576698