| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bluez_dbus_manager.h" | 5 #include "device/bluetooth/dbus/bluez_dbus_manager.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 client_bundle_->bluetooth_gatt_characteristic_client()->Init(GetSystemBus()); | 188 client_bundle_->bluetooth_gatt_characteristic_client()->Init(GetSystemBus()); |
| 189 client_bundle_->bluetooth_gatt_descriptor_client()->Init(GetSystemBus()); | 189 client_bundle_->bluetooth_gatt_descriptor_client()->Init(GetSystemBus()); |
| 190 client_bundle_->bluetooth_gatt_manager_client()->Init(GetSystemBus()); | 190 client_bundle_->bluetooth_gatt_manager_client()->Init(GetSystemBus()); |
| 191 client_bundle_->bluetooth_gatt_service_client()->Init(GetSystemBus()); | 191 client_bundle_->bluetooth_gatt_service_client()->Init(GetSystemBus()); |
| 192 client_bundle_->bluetooth_input_client()->Init(GetSystemBus()); | 192 client_bundle_->bluetooth_input_client()->Init(GetSystemBus()); |
| 193 client_bundle_->bluetooth_le_advertising_manager_client()->Init( | 193 client_bundle_->bluetooth_le_advertising_manager_client()->Init( |
| 194 GetSystemBus()); | 194 GetSystemBus()); |
| 195 client_bundle_->bluetooth_media_client()->Init(GetSystemBus()); | 195 client_bundle_->bluetooth_media_client()->Init(GetSystemBus()); |
| 196 client_bundle_->bluetooth_media_transport_client()->Init(GetSystemBus()); | 196 client_bundle_->bluetooth_media_transport_client()->Init(GetSystemBus()); |
| 197 client_bundle_->bluetooth_profile_manager_client()->Init(GetSystemBus()); | 197 client_bundle_->bluetooth_profile_manager_client()->Init(GetSystemBus()); |
| 198 | |
| 199 // This must be called after the list of clients so they've each had a | |
| 200 // chance to register with their object g_dbus_thread_managers. | |
| 201 if (GetSystemBus()) | |
| 202 GetSystemBus()->GetManagedObjects(); | |
| 203 } | 198 } |
| 204 | 199 |
| 205 // static | 200 // static |
| 206 void BluezDBusManager::Initialize(dbus::Bus* bus, bool use_dbus_stub) { | 201 void BluezDBusManager::Initialize(dbus::Bus* bus, bool use_dbus_stub) { |
| 207 // If we initialize BluezDBusManager twice we may also be shutting it down | 202 // If we initialize BluezDBusManager twice we may also be shutting it down |
| 208 // early; do not allow that. | 203 // early; do not allow that. |
| 209 if (g_using_bluez_dbus_manager_for_testing) | 204 if (g_using_bluez_dbus_manager_for_testing) |
| 210 return; | 205 return; |
| 211 | 206 |
| 212 CHECK(!g_bluez_dbus_manager); | 207 CHECK(!g_bluez_dbus_manager); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 ->client_bundle_->bluetooth_media_transport_client_ = std::move(client); | 320 ->client_bundle_->bluetooth_media_transport_client_ = std::move(client); |
| 326 } | 321 } |
| 327 | 322 |
| 328 void BluezDBusManagerSetter::SetBluetoothProfileManagerClient( | 323 void BluezDBusManagerSetter::SetBluetoothProfileManagerClient( |
| 329 std::unique_ptr<BluetoothProfileManagerClient> client) { | 324 std::unique_ptr<BluetoothProfileManagerClient> client) { |
| 330 bluez::BluezDBusManager::Get() | 325 bluez::BluezDBusManager::Get() |
| 331 ->client_bundle_->bluetooth_profile_manager_client_ = std::move(client); | 326 ->client_bundle_->bluetooth_profile_manager_client_ = std::move(client); |
| 332 } | 327 } |
| 333 | 328 |
| 334 } // namespace bluez | 329 } // namespace bluez |
| OLD | NEW |