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_descriptor_client.h" | 5 #include "chromeos/dbus/bluetooth_gatt_descriptor_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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 } else { | 234 } else { |
235 error_name = kNoResponseError; | 235 error_name = kNoResponseError; |
236 error_message = ""; | 236 error_message = ""; |
237 } | 237 } |
238 error_callback.Run(error_name, error_message); | 238 error_callback.Run(error_name, error_message); |
239 } | 239 } |
240 | 240 |
241 dbus::ObjectManager* object_manager_; | 241 dbus::ObjectManager* object_manager_; |
242 | 242 |
243 // List of observers interested in event notifications from us. | 243 // List of observers interested in event notifications from us. |
244 ObserverList<BluetoothGattDescriptorClient::Observer> observers_; | 244 base::ObserverList<BluetoothGattDescriptorClient::Observer> observers_; |
245 | 245 |
246 // Weak pointer factory for generating 'this' pointers that might live longer | 246 // Weak pointer factory for generating 'this' pointers that might live longer |
247 // than we do. | 247 // than we do. |
248 // Note: This should remain the last member so it'll be destroyed and | 248 // Note: This should remain the last member so it'll be destroyed and |
249 // invalidate its weak pointers before any other members are destroyed. | 249 // invalidate its weak pointers before any other members are destroyed. |
250 base::WeakPtrFactory<BluetoothGattDescriptorClientImpl> weak_ptr_factory_; | 250 base::WeakPtrFactory<BluetoothGattDescriptorClientImpl> weak_ptr_factory_; |
251 | 251 |
252 DISALLOW_COPY_AND_ASSIGN(BluetoothGattDescriptorClientImpl); | 252 DISALLOW_COPY_AND_ASSIGN(BluetoothGattDescriptorClientImpl); |
253 }; | 253 }; |
254 | 254 |
255 BluetoothGattDescriptorClient::BluetoothGattDescriptorClient() { | 255 BluetoothGattDescriptorClient::BluetoothGattDescriptorClient() { |
256 } | 256 } |
257 | 257 |
258 BluetoothGattDescriptorClient::~BluetoothGattDescriptorClient() { | 258 BluetoothGattDescriptorClient::~BluetoothGattDescriptorClient() { |
259 } | 259 } |
260 | 260 |
261 // static | 261 // static |
262 BluetoothGattDescriptorClient* BluetoothGattDescriptorClient::Create() { | 262 BluetoothGattDescriptorClient* BluetoothGattDescriptorClient::Create() { |
263 return new BluetoothGattDescriptorClientImpl(); | 263 return new BluetoothGattDescriptorClientImpl(); |
264 } | 264 } |
265 | 265 |
266 } // namespace chromeos | 266 } // namespace chromeos |
OLD | NEW |