| 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_characteristic_client.h" | 5 #include "chromeos/dbus/bluetooth_gatt_characteristic_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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 } else { | 292 } else { |
| 293 error_name = kNoResponseError; | 293 error_name = kNoResponseError; |
| 294 error_message = ""; | 294 error_message = ""; |
| 295 } | 295 } |
| 296 error_callback.Run(error_name, error_message); | 296 error_callback.Run(error_name, error_message); |
| 297 } | 297 } |
| 298 | 298 |
| 299 dbus::ObjectManager* object_manager_; | 299 dbus::ObjectManager* object_manager_; |
| 300 | 300 |
| 301 // List of observers interested in event notifications from us. | 301 // List of observers interested in event notifications from us. |
| 302 ObserverList<BluetoothGattCharacteristicClient::Observer> observers_; | 302 base::ObserverList<BluetoothGattCharacteristicClient::Observer> observers_; |
| 303 | 303 |
| 304 // Weak pointer factory for generating 'this' pointers that might live longer | 304 // Weak pointer factory for generating 'this' pointers that might live longer |
| 305 // than we do. | 305 // than we do. |
| 306 // Note: This should remain the last member so it'll be destroyed and | 306 // Note: This should remain the last member so it'll be destroyed and |
| 307 // invalidate its weak pointers before any other members are destroyed. | 307 // invalidate its weak pointers before any other members are destroyed. |
| 308 base::WeakPtrFactory<BluetoothGattCharacteristicClientImpl> | 308 base::WeakPtrFactory<BluetoothGattCharacteristicClientImpl> |
| 309 weak_ptr_factory_; | 309 weak_ptr_factory_; |
| 310 | 310 |
| 311 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristicClientImpl); | 311 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristicClientImpl); |
| 312 }; | 312 }; |
| 313 | 313 |
| 314 BluetoothGattCharacteristicClient::BluetoothGattCharacteristicClient() { | 314 BluetoothGattCharacteristicClient::BluetoothGattCharacteristicClient() { |
| 315 } | 315 } |
| 316 | 316 |
| 317 BluetoothGattCharacteristicClient::~BluetoothGattCharacteristicClient() { | 317 BluetoothGattCharacteristicClient::~BluetoothGattCharacteristicClient() { |
| 318 } | 318 } |
| 319 | 319 |
| 320 // static | 320 // static |
| 321 BluetoothGattCharacteristicClient* BluetoothGattCharacteristicClient::Create() { | 321 BluetoothGattCharacteristicClient* BluetoothGattCharacteristicClient::Create() { |
| 322 return new BluetoothGattCharacteristicClientImpl(); | 322 return new BluetoothGattCharacteristicClientImpl(); |
| 323 } | 323 } |
| 324 | 324 |
| 325 } // namespace chromeos | 325 } // namespace chromeos |
| OLD | NEW |