| 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_service_service_provider_impl.h" | 5 #include "device/bluetooth/dbus/bluetooth_gatt_service_service_provider_impl.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 "third_party/cros_system_api/dbus/service_constants.h" | 9 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 const std::vector<dbus::ObjectPath>& includes) | 27 const std::vector<dbus::ObjectPath>& includes) |
| 28 : origin_thread_id_(base::PlatformThread::CurrentId()), | 28 : origin_thread_id_(base::PlatformThread::CurrentId()), |
| 29 uuid_(uuid), | 29 uuid_(uuid), |
| 30 is_primary_(is_primary), | 30 is_primary_(is_primary), |
| 31 includes_(includes), | 31 includes_(includes), |
| 32 bus_(bus), | 32 bus_(bus), |
| 33 object_path_(object_path), | 33 object_path_(object_path), |
| 34 weak_ptr_factory_(this) { | 34 weak_ptr_factory_(this) { |
| 35 VLOG(1) << "Creating Bluetooth GATT service: " << object_path_.value() | 35 VLOG(1) << "Creating Bluetooth GATT service: " << object_path_.value() |
| 36 << " UUID: " << uuid; | 36 << " UUID: " << uuid; |
| 37 | |
| 38 // If we have a null bus, this means that this is being initialized for a | |
| 39 // test, hence we shouldn't do any other setup. | |
| 40 if (!bus_) | 37 if (!bus_) |
| 41 return; | 38 return; |
| 42 | 39 |
| 43 DCHECK(!uuid_.empty()); | 40 DCHECK(!uuid_.empty()); |
| 44 DCHECK(object_path_.IsValid()); | 41 DCHECK(object_path_.IsValid()); |
| 45 | 42 |
| 46 exported_object_ = bus_->GetExportedObject(object_path_); | 43 exported_object_ = bus_->GetExportedObject(object_path_); |
| 47 | 44 |
| 48 exported_object_->ExportMethod( | 45 exported_object_->ExportMethod( |
| 49 dbus::kDBusPropertiesInterface, dbus::kDBusPropertiesGet, | 46 dbus::kDBusPropertiesInterface, dbus::kDBusPropertiesGet, |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 LOG_IF(WARNING, !success) << "Failed to export " << interface_name << "." | 221 LOG_IF(WARNING, !success) << "Failed to export " << interface_name << "." |
| 225 << method_name; | 222 << method_name; |
| 226 } | 223 } |
| 227 | 224 |
| 228 const dbus::ObjectPath& BluetoothGattServiceServiceProviderImpl::object_path() | 225 const dbus::ObjectPath& BluetoothGattServiceServiceProviderImpl::object_path() |
| 229 const { | 226 const { |
| 230 return object_path_; | 227 return object_path_; |
| 231 } | 228 } |
| 232 | 229 |
| 233 } // namespace bluez | 230 } // namespace bluez |
| OLD | NEW |