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_service_provider.h" | 5 #include "chromeos/dbus/bluetooth_gatt_descriptor_service_provider.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 weak_ptr_factory_.GetWeakPtr())); | 80 weak_ptr_factory_.GetWeakPtr())); |
81 } | 81 } |
82 | 82 |
83 virtual ~BluetoothGattDescriptorServiceProviderImpl() { | 83 virtual ~BluetoothGattDescriptorServiceProviderImpl() { |
84 VLOG(1) << "Cleaning up Bluetooth GATT characteristic descriptor: " | 84 VLOG(1) << "Cleaning up Bluetooth GATT characteristic descriptor: " |
85 << object_path_.value(); | 85 << object_path_.value(); |
86 bus_->UnregisterExportedObject(object_path_); | 86 bus_->UnregisterExportedObject(object_path_); |
87 } | 87 } |
88 | 88 |
89 // BluetoothGattDescriptorServiceProvider override. | 89 // BluetoothGattDescriptorServiceProvider override. |
90 virtual void SendValueChanged(const std::vector<uint8>& value) OVERRIDE { | 90 virtual void SendValueChanged(const std::vector<uint8>& value) override { |
91 VLOG(2) << "Emitting a PropertiesChanged signal for descriptor value."; | 91 VLOG(2) << "Emitting a PropertiesChanged signal for descriptor value."; |
92 dbus::Signal signal( | 92 dbus::Signal signal( |
93 dbus::kDBusPropertiesInterface, | 93 dbus::kDBusPropertiesInterface, |
94 dbus::kDBusPropertiesChangedSignal); | 94 dbus::kDBusPropertiesChangedSignal); |
95 dbus::MessageWriter writer(&signal); | 95 dbus::MessageWriter writer(&signal); |
96 dbus::MessageWriter array_writer(NULL); | 96 dbus::MessageWriter array_writer(NULL); |
97 dbus::MessageWriter dict_entry_writer(NULL); | 97 dbus::MessageWriter dict_entry_writer(NULL); |
98 dbus::MessageWriter variant_writer(NULL); | 98 dbus::MessageWriter variant_writer(NULL); |
99 | 99 |
100 // interface_name | 100 // interface_name |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 const dbus::ObjectPath& characteristic_path) { | 462 const dbus::ObjectPath& characteristic_path) { |
463 if (!DBusThreadManager::Get()->IsUsingStub(DBusClientBundle::BLUETOOTH)) { | 463 if (!DBusThreadManager::Get()->IsUsingStub(DBusClientBundle::BLUETOOTH)) { |
464 return new BluetoothGattDescriptorServiceProviderImpl( | 464 return new BluetoothGattDescriptorServiceProviderImpl( |
465 bus, object_path, delegate, uuid, permissions, characteristic_path); | 465 bus, object_path, delegate, uuid, permissions, characteristic_path); |
466 } | 466 } |
467 return new FakeBluetoothGattDescriptorServiceProvider( | 467 return new FakeBluetoothGattDescriptorServiceProvider( |
468 object_path, delegate, uuid, permissions, characteristic_path); | 468 object_path, delegate, uuid, permissions, characteristic_path); |
469 } | 469 } |
470 | 470 |
471 } // namespace chromeos | 471 } // namespace chromeos |
OLD | NEW |