OLD | NEW |
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 "chromeos/dbus/bluetooth_gatt_service_client.h" | 5 #include "chromeos/dbus/bluetooth_gatt_service_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "dbus/bus.h" | 10 #include "dbus/bus.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 const std::string& property_name) { | 120 const std::string& property_name) { |
121 VLOG(2) << "Remote GATT service property changed: " << object_path.value() | 121 VLOG(2) << "Remote GATT service property changed: " << object_path.value() |
122 << ": " << property_name; | 122 << ": " << property_name; |
123 FOR_EACH_OBSERVER(BluetoothGattServiceClient::Observer, observers_, | 123 FOR_EACH_OBSERVER(BluetoothGattServiceClient::Observer, observers_, |
124 GattServicePropertyChanged(object_path, property_name)); | 124 GattServicePropertyChanged(object_path, property_name)); |
125 } | 125 } |
126 | 126 |
127 dbus::ObjectManager* object_manager_; | 127 dbus::ObjectManager* object_manager_; |
128 | 128 |
129 // List of observers interested in event notifications from us. | 129 // List of observers interested in event notifications from us. |
130 ObserverList<BluetoothGattServiceClient::Observer> observers_; | 130 base::ObserverList<BluetoothGattServiceClient::Observer> observers_; |
131 | 131 |
132 // Weak pointer factory for generating 'this' pointers that might live longer | 132 // Weak pointer factory for generating 'this' pointers that might live longer |
133 // than we do. | 133 // than we do. |
134 // Note: This should remain the last member so it'll be destroyed and | 134 // Note: This should remain the last member so it'll be destroyed and |
135 // invalidate its weak pointers before any other members are destroyed. | 135 // invalidate its weak pointers before any other members are destroyed. |
136 base::WeakPtrFactory<BluetoothGattServiceClientImpl> weak_ptr_factory_; | 136 base::WeakPtrFactory<BluetoothGattServiceClientImpl> weak_ptr_factory_; |
137 | 137 |
138 DISALLOW_COPY_AND_ASSIGN(BluetoothGattServiceClientImpl); | 138 DISALLOW_COPY_AND_ASSIGN(BluetoothGattServiceClientImpl); |
139 }; | 139 }; |
140 | 140 |
141 BluetoothGattServiceClient::BluetoothGattServiceClient() { | 141 BluetoothGattServiceClient::BluetoothGattServiceClient() { |
142 } | 142 } |
143 | 143 |
144 BluetoothGattServiceClient::~BluetoothGattServiceClient() { | 144 BluetoothGattServiceClient::~BluetoothGattServiceClient() { |
145 } | 145 } |
146 | 146 |
147 // static | 147 // static |
148 BluetoothGattServiceClient* BluetoothGattServiceClient::Create() { | 148 BluetoothGattServiceClient* BluetoothGattServiceClient::Create() { |
149 return new BluetoothGattServiceClientImpl(); | 149 return new BluetoothGattServiceClientImpl(); |
150 } | 150 } |
151 | 151 |
152 } // namespace chromeos | 152 } // namespace chromeos |
OLD | NEW |