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

Side by Side Diff: device/bluetooth/dbus/fake_bluetooth_gatt_service_client.cc

Issue 2423793002: Remove usage of FOR_EACH_OBSERVER macro in device/ (Closed)
Patch Set: rebase Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/bluetooth/dbus/fake_bluetooth_gatt_service_client.h" 5 #include "device/bluetooth/dbus/fake_bluetooth_gatt_service_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 dbus::ObjectPath FakeBluetoothGattServiceClient::GetBatteryServicePath() const { 175 dbus::ObjectPath FakeBluetoothGattServiceClient::GetBatteryServicePath() const {
176 return dbus::ObjectPath(battery_service_path_); 176 return dbus::ObjectPath(battery_service_path_);
177 } 177 }
178 178
179 void FakeBluetoothGattServiceClient::OnPropertyChanged( 179 void FakeBluetoothGattServiceClient::OnPropertyChanged(
180 const dbus::ObjectPath& object_path, 180 const dbus::ObjectPath& object_path,
181 const std::string& property_name) { 181 const std::string& property_name) {
182 VLOG(2) << "Fake GATT Service property changed: " << object_path.value() 182 VLOG(2) << "Fake GATT Service property changed: " << object_path.value()
183 << ": " << property_name; 183 << ": " << property_name;
184 FOR_EACH_OBSERVER(BluetoothGattServiceClient::Observer, observers_, 184 for (auto& observer : observers_)
185 GattServicePropertyChanged(object_path, property_name)); 185 observer.GattServicePropertyChanged(object_path, property_name);
186 } 186 }
187 187
188 void FakeBluetoothGattServiceClient::NotifyServiceAdded( 188 void FakeBluetoothGattServiceClient::NotifyServiceAdded(
189 const dbus::ObjectPath& object_path) { 189 const dbus::ObjectPath& object_path) {
190 VLOG(2) << "GATT service added: " << object_path.value(); 190 VLOG(2) << "GATT service added: " << object_path.value();
191 FOR_EACH_OBSERVER(BluetoothGattServiceClient::Observer, observers_, 191 for (auto& observer : observers_)
192 GattServiceAdded(object_path)); 192 observer.GattServiceAdded(object_path);
193 } 193 }
194 194
195 void FakeBluetoothGattServiceClient::NotifyServiceRemoved( 195 void FakeBluetoothGattServiceClient::NotifyServiceRemoved(
196 const dbus::ObjectPath& object_path) { 196 const dbus::ObjectPath& object_path) {
197 VLOG(2) << "GATT service removed: " << object_path.value(); 197 VLOG(2) << "GATT service removed: " << object_path.value();
198 FOR_EACH_OBSERVER(BluetoothGattServiceClient::Observer, observers_, 198 for (auto& observer : observers_)
199 GattServiceRemoved(object_path)); 199 observer.GattServiceRemoved(object_path);
200 } 200 }
201 201
202 void FakeBluetoothGattServiceClient::ExposeHeartRateCharacteristics() { 202 void FakeBluetoothGattServiceClient::ExposeHeartRateCharacteristics() {
203 if (!IsHeartRateVisible()) { 203 if (!IsHeartRateVisible()) {
204 VLOG(2) << "Heart Rate service not visible. Not exposing characteristics."; 204 VLOG(2) << "Heart Rate service not visible. Not exposing characteristics.";
205 return; 205 return;
206 } 206 }
207 FakeBluetoothGattCharacteristicClient* char_client = 207 FakeBluetoothGattCharacteristicClient* char_client =
208 static_cast<FakeBluetoothGattCharacteristicClient*>( 208 static_cast<FakeBluetoothGattCharacteristicClient*>(
209 bluez::BluezDBusManager::Get() 209 bluez::BluezDBusManager::Get()
210 ->GetBluetoothGattCharacteristicClient()); 210 ->GetBluetoothGattCharacteristicClient());
211 char_client->ExposeHeartRateCharacteristics( 211 char_client->ExposeHeartRateCharacteristics(
212 dbus::ObjectPath(heart_rate_service_path_)); 212 dbus::ObjectPath(heart_rate_service_path_));
213 } 213 }
214 214
215 } // namespace bluez 215 } // namespace bluez
OLDNEW
« no previous file with comments | « device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_client.cc ('k') | device/bluetooth/dbus/fake_bluetooth_input_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698