| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "device/bluetooth/dbus/bluetooth_gatt_descriptor_service_provider_impl.
h" | 5 #include "device/bluetooth/dbus/bluetooth_gatt_descriptor_service_provider_impl.
h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 : origin_thread_id_(base::PlatformThread::CurrentId()), | 34 : origin_thread_id_(base::PlatformThread::CurrentId()), |
| 35 uuid_(uuid), | 35 uuid_(uuid), |
| 36 flags_(flags), | 36 flags_(flags), |
| 37 bus_(bus), | 37 bus_(bus), |
| 38 delegate_(std::move(delegate)), | 38 delegate_(std::move(delegate)), |
| 39 object_path_(object_path), | 39 object_path_(object_path), |
| 40 characteristic_path_(characteristic_path), | 40 characteristic_path_(characteristic_path), |
| 41 weak_ptr_factory_(this) { | 41 weak_ptr_factory_(this) { |
| 42 VLOG(1) << "Created Bluetooth GATT characteristic descriptor: " | 42 VLOG(1) << "Created Bluetooth GATT characteristic descriptor: " |
| 43 << object_path.value() << " UUID: " << uuid; | 43 << object_path.value() << " UUID: " << uuid; |
| 44 | |
| 45 // If we have a null bus, this means that this is being initialized for a | |
| 46 // test, hence we shouldn't do any other setup. | |
| 47 if (!bus_) | 44 if (!bus_) |
| 48 return; | 45 return; |
| 49 | 46 |
| 50 DCHECK(delegate_); | 47 DCHECK(delegate_); |
| 51 DCHECK(!uuid_.empty()); | 48 DCHECK(!uuid_.empty()); |
| 52 DCHECK(object_path_.IsValid()); | 49 DCHECK(object_path_.IsValid()); |
| 53 DCHECK(characteristic_path_.IsValid()); | 50 DCHECK(characteristic_path_.IsValid()); |
| 54 DCHECK(base::StartsWith(object_path_.value(), | 51 DCHECK(base::StartsWith(object_path_.value(), |
| 55 characteristic_path_.value() + "/", | 52 characteristic_path_.value() + "/", |
| 56 base::CompareCase::SENSITIVE)); | 53 base::CompareCase::SENSITIVE)); |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 method_call, kErrorFailed, "Failed to get/set descriptor value."); | 403 method_call, kErrorFailed, "Failed to get/set descriptor value."); |
| 407 response_sender.Run(std::move(error_response)); | 404 response_sender.Run(std::move(error_response)); |
| 408 } | 405 } |
| 409 | 406 |
| 410 const dbus::ObjectPath& | 407 const dbus::ObjectPath& |
| 411 BluetoothGattDescriptorServiceProviderImpl::object_path() const { | 408 BluetoothGattDescriptorServiceProviderImpl::object_path() const { |
| 412 return object_path_; | 409 return object_path_; |
| 413 } | 410 } |
| 414 | 411 |
| 415 } // namespace bluez | 412 } // namespace bluez |
| OLD | NEW |