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/fake_bluetooth_gatt_descriptor_service_provider.h" | 5 #include "chromeos/dbus/fake_bluetooth_gatt_descriptor_service_provider.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "chromeos/dbus/dbus_thread_manager.h" | 9 #include "chromeos/dbus/dbus_thread_manager.h" |
10 #include "chromeos/dbus/fake_bluetooth_gatt_characteristic_service_provider.h" | 10 #include "chromeos/dbus/fake_bluetooth_gatt_characteristic_service_provider.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 : object_path_(object_path), | 22 : object_path_(object_path), |
23 uuid_(uuid), | 23 uuid_(uuid), |
24 characteristic_path_(characteristic_path), | 24 characteristic_path_(characteristic_path), |
25 delegate_(delegate) { | 25 delegate_(delegate) { |
26 VLOG(1) << "Creating Bluetooth GATT descriptor: " << object_path_.value(); | 26 VLOG(1) << "Creating Bluetooth GATT descriptor: " << object_path_.value(); |
27 | 27 |
28 DCHECK(object_path_.IsValid()); | 28 DCHECK(object_path_.IsValid()); |
29 DCHECK(characteristic_path_.IsValid()); | 29 DCHECK(characteristic_path_.IsValid()); |
30 DCHECK(!uuid.empty()); | 30 DCHECK(!uuid.empty()); |
31 DCHECK(delegate_); | 31 DCHECK(delegate_); |
32 DCHECK(base::StartsWithASCII(object_path_.value(), | 32 DCHECK(base::StartsWith(object_path_.value(), |
33 characteristic_path_.value() + "/", true)); | 33 characteristic_path_.value() + "/", |
| 34 base::CompareCase::SENSITIVE)); |
34 | 35 |
35 // TODO(armansito): Do something with |permissions|. | 36 // TODO(armansito): Do something with |permissions|. |
36 | 37 |
37 FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client = | 38 FakeBluetoothGattManagerClient* fake_bluetooth_gatt_manager_client = |
38 static_cast<FakeBluetoothGattManagerClient*>( | 39 static_cast<FakeBluetoothGattManagerClient*>( |
39 DBusThreadManager::Get()->GetBluetoothGattManagerClient()); | 40 DBusThreadManager::Get()->GetBluetoothGattManagerClient()); |
40 fake_bluetooth_gatt_manager_client-> | 41 fake_bluetooth_gatt_manager_client-> |
41 RegisterDescriptorServiceProvider(this); | 42 RegisterDescriptorServiceProvider(this); |
42 } | 43 } |
43 | 44 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 error_callback.Run(); | 115 error_callback.Run(); |
115 return; | 116 return; |
116 } | 117 } |
117 | 118 |
118 // Pass on to the delegate. | 119 // Pass on to the delegate. |
119 DCHECK(delegate_); | 120 DCHECK(delegate_); |
120 delegate_->SetDescriptorValue(value, callback, error_callback); | 121 delegate_->SetDescriptorValue(value, callback, error_callback); |
121 } | 122 } |
122 | 123 |
123 } // namespace chromeos | 124 } // namespace chromeos |
OLD | NEW |