Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2268)

Unified Diff: device/bluetooth/dbus/bluetooth_gatt_service_service_provider_impl.cc

Issue 1954643002: DBus support for attribute properties and permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@register_and_events
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/dbus/bluetooth_gatt_service_service_provider_impl.cc
diff --git a/device/bluetooth/dbus/bluetooth_gatt_service_service_provider_impl.cc b/device/bluetooth/dbus/bluetooth_gatt_service_service_provider_impl.cc
index 77d34837bd8927f41ba8e338b018d632a57c9414..0937aba1da9572dd1467d545cf967927ab6e224a 100644
--- a/device/bluetooth/dbus/bluetooth_gatt_service_service_provider_impl.cc
+++ b/device/bluetooth/dbus/bluetooth_gatt_service_service_provider_impl.cc
@@ -34,9 +34,14 @@ BluetoothGattServiceServiceProviderImpl::
weak_ptr_factory_(this) {
VLOG(1) << "Creating Bluetooth GATT service: " << object_path_.value()
<< " UUID: " << uuid;
+
+ // If we have a null bus, this means that this is being initialized for a
+ // test, hence we shouldn't do any other setup.
+ if (!bus_)
+ return;
+
DCHECK(!uuid_.empty());
DCHECK(object_path_.IsValid());
- DCHECK(bus_);
exported_object_ = bus_->GetExportedObject(object_path_);
@@ -69,17 +74,6 @@ BluetoothGattServiceServiceProviderImpl::
bus_->UnregisterExportedObject(object_path_);
}
-BluetoothGattServiceServiceProviderImpl::
- BluetoothGattServiceServiceProviderImpl(const dbus::ObjectPath& object_path,
- const std::string& uuid,
- bool is_primary)
- : origin_thread_id_(base::PlatformThread::CurrentId()),
- uuid_(uuid),
- is_primary_(is_primary),
- bus_(nullptr),
- object_path_(object_path),
- weak_ptr_factory_(this) {}
-
bool BluetoothGattServiceServiceProviderImpl::OnOriginThread() {
return base::PlatformThread::CurrentId() == origin_thread_id_;
}

Powered by Google App Engine
This is Rietveld 408576698