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
3 // found in the LICENSE file.
5 #include "chromeos/dbus/dbus_thread_manager.h"
7 #include "base/command_line.h"
8 #include "base/sys_info.h"
9 #include "base/threading/thread.h"
10 #include "chromeos/chromeos_switches.h"
11 #include "chromeos/dbus/amplifier_client.h"
12 #include "chromeos/dbus/ap_manager_client.h"
13 #include "chromeos/dbus/audio_dsp_client.h"
14 #include "chromeos/dbus/bluetooth_adapter_client.h"
15 #include "chromeos/dbus/bluetooth_agent_manager_client.h"
16 #include "chromeos/dbus/bluetooth_device_client.h"
17 #include "chromeos/dbus/bluetooth_gatt_characteristic_client.h"
18 #include "chromeos/dbus/bluetooth_gatt_descriptor_client.h"
19 #include "chromeos/dbus/bluetooth_gatt_manager_client.h"
20 #include "chromeos/dbus/bluetooth_gatt_service_client.h"
21 #include "chromeos/dbus/bluetooth_input_client.h"
22 #include "chromeos/dbus/bluetooth_media_client.h"
23 #include "chromeos/dbus/bluetooth_media_transport_client.h"
24 #include "chromeos/dbus/bluetooth_profile_manager_client.h"
25 #include "chromeos/dbus/cras_audio_client.h"
26 #include "chromeos/dbus/cros_disks_client.h"
27 #include "chromeos/dbus/cryptohome_client.h"
28 #include "chromeos/dbus/dbus_client.h"
29 #include "chromeos/dbus/debug_daemon_client.h"
30 #include "chromeos/dbus/easy_unlock_client.h"
31 #include "chromeos/dbus/gsm_sms_client.h"
32 #include "chromeos/dbus/image_burner_client.h"
33 #include "chromeos/dbus/introspectable_client.h"
34 #include "chromeos/dbus/leadership_daemon_manager_client.h"
35 #include "chromeos/dbus/lorgnette_manager_client.h"
36 #include "chromeos/dbus/metronome_client.h"
37 #include "chromeos/dbus/modem_messaging_client.h"
38 #include "chromeos/dbus/nfc_adapter_client.h"
39 #include "chromeos/dbus/nfc_device_client.h"
40 #include "chromeos/dbus/nfc_manager_client.h"
41 #include "chromeos/dbus/nfc_record_client.h"
42 #include "chromeos/dbus/nfc_tag_client.h"
43 #include "chromeos/dbus/peer_daemon_manager_client.h"
44 #include "chromeos/dbus/permission_broker_client.h"
45 #include "chromeos/dbus/power_manager_client.h"
46 #include "chromeos/dbus/privet_daemon_manager_client.h"
47 #include "chromeos/dbus/session_manager_client.h"
48 #include "chromeos/dbus/shill_device_client.h"
49 #include "chromeos/dbus/shill_ipconfig_client.h"
50 #include "chromeos/dbus/shill_manager_client.h"
51 #include "chromeos/dbus/shill_profile_client.h"
52 #include "chromeos/dbus/shill_service_client.h"
53 #include "chromeos/dbus/shill_third_party_vpn_driver_client.h"
54 #include "chromeos/dbus/sms_client.h"
55 #include "chromeos/dbus/system_clock_client.h"
56 #include "chromeos/dbus/update_engine_client.h"
58 #include "dbus/dbus_statistics.h"
62 static DBusThreadManager
* g_dbus_thread_manager
= NULL
;
63 static bool g_using_dbus_thread_manager_for_testing
= false;
65 DBusThreadManager::DBusThreadManager(scoped_ptr
<DBusClientBundle
> client_bundle
)
66 : client_bundle_(client_bundle
.Pass()) {
67 dbus::statistics::Initialize();
69 if (client_bundle_
->IsUsingAnyRealClient()) {
70 // At least one real DBusClient is used.
71 // Create the D-Bus thread.
72 base::Thread::Options thread_options
;
73 thread_options
.message_loop_type
= base::MessageLoop::TYPE_IO
;
74 dbus_thread_
.reset(new base::Thread("D-Bus thread"));
75 dbus_thread_
->StartWithOptions(thread_options
);
77 // Create the connection to the system bus.
78 dbus::Bus::Options system_bus_options
;
79 system_bus_options
.bus_type
= dbus::Bus::SYSTEM
;
80 system_bus_options
.connection_type
= dbus::Bus::PRIVATE
;
81 system_bus_options
.dbus_task_runner
= dbus_thread_
->message_loop_proxy();
82 system_bus_
= new dbus::Bus(system_bus_options
);
86 DBusThreadManager::~DBusThreadManager() {
87 // Delete all D-Bus clients before shutting down the system bus.
88 client_bundle_
.reset();
90 // Shut down the bus. During the browser shutdown, it's ok to shut down
91 // the bus synchronously.
92 if (system_bus_
.get())
93 system_bus_
->ShutdownOnDBusThreadAndBlock();
95 // Stop the D-Bus thread.
99 dbus::statistics::Shutdown();
101 if (!g_dbus_thread_manager
)
102 return; // Called form Shutdown() or local test instance.
104 // There should never be both a global instance and a local instance.
105 CHECK(this == g_dbus_thread_manager
);
106 if (g_using_dbus_thread_manager_for_testing
) {
107 g_dbus_thread_manager
= NULL
;
108 g_using_dbus_thread_manager_for_testing
= false;
109 VLOG(1) << "DBusThreadManager destroyed";
111 LOG(FATAL
) << "~DBusThreadManager() called outside of Shutdown()";
115 dbus::Bus
* DBusThreadManager::GetSystemBus() {
116 return system_bus_
.get();
119 AmplifierClient
* DBusThreadManager::GetAmplifierClient() {
120 return client_bundle_
->amplifier_client();
123 ApManagerClient
* DBusThreadManager::GetApManagerClient() {
124 return client_bundle_
->ap_manager_client();
127 AudioDspClient
* DBusThreadManager::GetAudioDspClient() {
128 return client_bundle_
->audio_dsp_client();
131 BluetoothAdapterClient
* DBusThreadManager::GetBluetoothAdapterClient() {
132 return client_bundle_
->bluetooth_adapter_client();
135 BluetoothAgentManagerClient
*
136 DBusThreadManager::GetBluetoothAgentManagerClient() {
137 return client_bundle_
->bluetooth_agent_manager_client();
140 BluetoothDeviceClient
* DBusThreadManager::GetBluetoothDeviceClient() {
141 return client_bundle_
->bluetooth_device_client();
144 BluetoothGattCharacteristicClient
*
145 DBusThreadManager::GetBluetoothGattCharacteristicClient() {
146 return client_bundle_
->bluetooth_gatt_characteristic_client();
149 BluetoothGattDescriptorClient
*
150 DBusThreadManager::GetBluetoothGattDescriptorClient() {
151 return client_bundle_
->bluetooth_gatt_descriptor_client();
154 BluetoothGattManagerClient
*
155 DBusThreadManager::GetBluetoothGattManagerClient() {
156 return client_bundle_
->bluetooth_gatt_manager_client();
159 BluetoothGattServiceClient
*
160 DBusThreadManager::GetBluetoothGattServiceClient() {
161 return client_bundle_
->bluetooth_gatt_service_client();
164 BluetoothInputClient
* DBusThreadManager::GetBluetoothInputClient() {
165 return client_bundle_
->bluetooth_input_client();
168 BluetoothMediaClient
* DBusThreadManager::GetBluetoothMediaClient() {
169 return client_bundle_
->bluetooth_media_client();
172 BluetoothMediaTransportClient
*
173 DBusThreadManager::GetBluetoothMediaTransportClient() {
174 return client_bundle_
->bluetooth_media_transport_client();
177 BluetoothProfileManagerClient
*
178 DBusThreadManager::GetBluetoothProfileManagerClient() {
179 return client_bundle_
->bluetooth_profile_manager_client();
182 CrasAudioClient
* DBusThreadManager::GetCrasAudioClient() {
183 return client_bundle_
->cras_audio_client();
186 CrosDisksClient
* DBusThreadManager::GetCrosDisksClient() {
187 return client_bundle_
->cros_disks_client();
190 CryptohomeClient
* DBusThreadManager::GetCryptohomeClient() {
191 return client_bundle_
->cryptohome_client();
194 DebugDaemonClient
* DBusThreadManager::GetDebugDaemonClient() {
195 return client_bundle_
->debug_daemon_client();
198 EasyUnlockClient
* DBusThreadManager::GetEasyUnlockClient() {
199 return client_bundle_
->easy_unlock_client();
202 LeadershipDaemonManagerClient
*
203 DBusThreadManager::GetLeadershipDaemonManagerClient() {
204 return client_bundle_
->leadership_daemon_manager_client();
207 LorgnetteManagerClient
*
208 DBusThreadManager::GetLorgnetteManagerClient() {
209 return client_bundle_
->lorgnette_manager_client();
212 MetronomeClient
* DBusThreadManager::GetMetronomeClient() {
213 return client_bundle_
->metronome_client();
217 DBusThreadManager::GetShillDeviceClient() {
218 return client_bundle_
->shill_device_client();
222 DBusThreadManager::GetShillIPConfigClient() {
223 return client_bundle_
->shill_ipconfig_client();
227 DBusThreadManager::GetShillManagerClient() {
228 return client_bundle_
->shill_manager_client();
232 DBusThreadManager::GetShillServiceClient() {
233 return client_bundle_
->shill_service_client();
237 DBusThreadManager::GetShillProfileClient() {
238 return client_bundle_
->shill_profile_client();
241 ShillThirdPartyVpnDriverClient
*
242 DBusThreadManager::GetShillThirdPartyVpnDriverClient() {
243 return client_bundle_
->shill_third_party_vpn_driver_client();
246 GsmSMSClient
* DBusThreadManager::GetGsmSMSClient() {
247 return client_bundle_
->gsm_sms_client();
250 ImageBurnerClient
* DBusThreadManager::GetImageBurnerClient() {
251 return client_bundle_
->image_burner_client();
254 IntrospectableClient
* DBusThreadManager::GetIntrospectableClient() {
255 return client_bundle_
->introspectable_client();
258 ModemMessagingClient
* DBusThreadManager::GetModemMessagingClient() {
259 return client_bundle_
->modem_messaging_client();
262 NfcAdapterClient
* DBusThreadManager::GetNfcAdapterClient() {
263 return client_bundle_
->nfc_adapter_client();
266 NfcDeviceClient
* DBusThreadManager::GetNfcDeviceClient() {
267 return client_bundle_
->nfc_device_client();
270 NfcManagerClient
* DBusThreadManager::GetNfcManagerClient() {
271 return client_bundle_
->nfc_manager_client();
274 NfcRecordClient
* DBusThreadManager::GetNfcRecordClient() {
275 return client_bundle_
->nfc_record_client();
278 NfcTagClient
* DBusThreadManager::GetNfcTagClient() {
279 return client_bundle_
->nfc_tag_client();
282 PeerDaemonManagerClient
* DBusThreadManager::GetPeerDaemonManagerClient() {
283 return client_bundle_
->peer_daemon_manager_client();
286 PermissionBrokerClient
* DBusThreadManager::GetPermissionBrokerClient() {
287 return client_bundle_
->permission_broker_client();
290 PowerManagerClient
* DBusThreadManager::GetPowerManagerClient() {
291 return client_bundle_
->power_manager_client();
294 PrivetDaemonManagerClient
* DBusThreadManager::GetPrivetDaemonManagerClient() {
295 return client_bundle_
->privet_daemon_manager_client();
298 SessionManagerClient
* DBusThreadManager::GetSessionManagerClient() {
299 return client_bundle_
->session_manager_client();
302 SMSClient
* DBusThreadManager::GetSMSClient() {
303 return client_bundle_
->sms_client();
306 SystemClockClient
* DBusThreadManager::GetSystemClockClient() {
307 return client_bundle_
->system_clock_client();
310 UpdateEngineClient
* DBusThreadManager::GetUpdateEngineClient() {
311 return client_bundle_
->update_engine_client();
314 void DBusThreadManager::InitializeClients() {
315 GetAmplifierClient()->Init(GetSystemBus());
316 GetApManagerClient()->Init(GetSystemBus());
317 GetAudioDspClient()->Init(GetSystemBus());
318 GetBluetoothAdapterClient()->Init(GetSystemBus());
319 GetBluetoothAgentManagerClient()->Init(GetSystemBus());
320 GetBluetoothDeviceClient()->Init(GetSystemBus());
321 GetBluetoothGattCharacteristicClient()->Init(GetSystemBus());
322 GetBluetoothGattDescriptorClient()->Init(GetSystemBus());
323 GetBluetoothGattManagerClient()->Init(GetSystemBus());
324 GetBluetoothGattServiceClient()->Init(GetSystemBus());
325 GetBluetoothInputClient()->Init(GetSystemBus());
326 GetBluetoothMediaClient()->Init(GetSystemBus());
327 GetBluetoothMediaTransportClient()->Init(GetSystemBus());
328 GetBluetoothProfileManagerClient()->Init(GetSystemBus());
329 GetCrasAudioClient()->Init(GetSystemBus());
330 GetCrosDisksClient()->Init(GetSystemBus());
331 GetCryptohomeClient()->Init(GetSystemBus());
332 GetDebugDaemonClient()->Init(GetSystemBus());
333 GetEasyUnlockClient()->Init(GetSystemBus());
334 GetGsmSMSClient()->Init(GetSystemBus());
335 GetImageBurnerClient()->Init(GetSystemBus());
336 GetIntrospectableClient()->Init(GetSystemBus());
337 GetLeadershipDaemonManagerClient()->Init(GetSystemBus());
338 GetLorgnetteManagerClient()->Init(GetSystemBus());
339 GetMetronomeClient()->Init(GetSystemBus());
340 GetModemMessagingClient()->Init(GetSystemBus());
341 GetPermissionBrokerClient()->Init(GetSystemBus());
342 GetPeerDaemonManagerClient()->Init(GetSystemBus());
343 GetPrivetDaemonManagerClient()->Init(GetSystemBus());
344 GetPowerManagerClient()->Init(GetSystemBus());
345 GetSessionManagerClient()->Init(GetSystemBus());
346 GetShillDeviceClient()->Init(GetSystemBus());
347 GetShillIPConfigClient()->Init(GetSystemBus());
348 GetShillManagerClient()->Init(GetSystemBus());
349 GetShillServiceClient()->Init(GetSystemBus());
350 GetShillProfileClient()->Init(GetSystemBus());
351 GetShillThirdPartyVpnDriverClient()->Init(GetSystemBus());
352 GetSMSClient()->Init(GetSystemBus());
353 GetSystemClockClient()->Init(GetSystemBus());
354 GetUpdateEngineClient()->Init(GetSystemBus());
356 // Initialize the NFC clients in the correct order. The order of
357 // initialization matters due to dependencies that exist between the
359 GetNfcManagerClient()->Init(GetSystemBus());
360 GetNfcAdapterClient()->Init(GetSystemBus());
361 GetNfcDeviceClient()->Init(GetSystemBus());
362 GetNfcTagClient()->Init(GetSystemBus());
363 GetNfcRecordClient()->Init(GetSystemBus());
365 // This must be called after the list of clients so they've each had a
366 // chance to register with their object g_dbus_thread_managers.
368 GetSystemBus()->GetManagedObjects();
370 client_bundle_
->SetupDefaultEnvironment();
373 bool DBusThreadManager::IsUsingStub(DBusClientBundle::DBusClientType client
) {
374 return client_bundle_
->IsUsingStub(client
);
378 void DBusThreadManager::Initialize() {
379 // If we initialize DBusThreadManager twice we may also be shutting it down
380 // early; do not allow that.
381 if (g_using_dbus_thread_manager_for_testing
)
384 CHECK(!g_dbus_thread_manager
);
385 bool use_dbus_stub
= !base::SysInfo::IsRunningOnChromeOS() ||
386 base::CommandLine::ForCurrentProcess()->HasSwitch(
387 chromeos::switches::kDbusStub
);
388 bool force_unstub_clients
= base::CommandLine::ForCurrentProcess()->HasSwitch(
389 chromeos::switches::kDbusUnstubClients
);
390 // Determine whether we use stub or real client implementations.
391 if (force_unstub_clients
) {
392 InitializeWithPartialStub(
393 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
394 chromeos::switches::kDbusUnstubClients
));
395 } else if (use_dbus_stub
) {
396 InitializeWithStubs();
398 InitializeWithRealClients();
403 scoped_ptr
<DBusThreadManagerSetter
> DBusThreadManager::GetSetterForTesting() {
404 if (!g_using_dbus_thread_manager_for_testing
) {
405 g_using_dbus_thread_manager_for_testing
= true;
406 InitializeWithStubs();
409 return make_scoped_ptr(new DBusThreadManagerSetter());
413 void DBusThreadManager::CreateGlobalInstance(
414 DBusClientBundle::DBusClientTypeMask unstub_client_mask
) {
415 CHECK(!g_dbus_thread_manager
);
416 g_dbus_thread_manager
= new DBusThreadManager(
417 make_scoped_ptr(new DBusClientBundle(unstub_client_mask
)));
418 g_dbus_thread_manager
->InitializeClients();
422 void DBusThreadManager::InitializeWithRealClients() {
423 CreateGlobalInstance(~static_cast<DBusClientBundle::DBusClientTypeMask
>(0));
424 VLOG(1) << "DBusThreadManager initialized for Chrome OS";
428 void DBusThreadManager::InitializeWithStubs() {
429 CreateGlobalInstance(0 /* unstub_client_mask */);
430 VLOG(1) << "DBusThreadManager created for testing";
434 void DBusThreadManager::InitializeWithPartialStub(
435 const std::string
& unstub_clients
) {
436 DBusClientBundle::DBusClientTypeMask unstub_client_mask
=
437 DBusClientBundle::ParseUnstubList(unstub_clients
);
438 // We should have something parsed correctly here.
439 LOG_IF(FATAL
, unstub_client_mask
== 0)
440 << "Switch values for --" << chromeos::switches::kDbusUnstubClients
441 << " cannot be parsed: " << unstub_clients
;
442 VLOG(1) << "DBusThreadManager initialized for mixed runtime environment";
443 CreateGlobalInstance(unstub_client_mask
);
447 bool DBusThreadManager::IsInitialized() {
448 return g_dbus_thread_manager
!= NULL
;
452 void DBusThreadManager::Shutdown() {
453 // Ensure that we only shutdown DBusThreadManager once.
454 CHECK(g_dbus_thread_manager
);
455 DBusThreadManager
* dbus_thread_manager
= g_dbus_thread_manager
;
456 g_dbus_thread_manager
= NULL
;
457 g_using_dbus_thread_manager_for_testing
= false;
458 delete dbus_thread_manager
;
459 VLOG(1) << "DBusThreadManager Shutdown completed";
463 DBusThreadManager
* DBusThreadManager::Get() {
464 CHECK(g_dbus_thread_manager
)
465 << "DBusThreadManager::Get() called before Initialize()";
466 return g_dbus_thread_manager
;
469 DBusThreadManagerSetter::DBusThreadManagerSetter() {
472 DBusThreadManagerSetter::~DBusThreadManagerSetter() {
475 void DBusThreadManagerSetter::SetAmplifierClient(
476 scoped_ptr
<AmplifierClient
> client
) {
477 DBusThreadManager::Get()->client_bundle_
->amplifier_client_
= client
.Pass();
480 void DBusThreadManagerSetter::SetAudioDspClient(
481 scoped_ptr
<AudioDspClient
> client
) {
482 DBusThreadManager::Get()->client_bundle_
->audio_dsp_client_
= client
.Pass();
485 void DBusThreadManagerSetter::SetBluetoothAdapterClient(
486 scoped_ptr
<BluetoothAdapterClient
> client
) {
487 DBusThreadManager::Get()->client_bundle_
->bluetooth_adapter_client_
=
491 void DBusThreadManagerSetter::SetBluetoothAgentManagerClient(
492 scoped_ptr
<BluetoothAgentManagerClient
> client
) {
493 DBusThreadManager::Get()->client_bundle_
->bluetooth_agent_manager_client_
=
497 void DBusThreadManagerSetter::SetBluetoothDeviceClient(
498 scoped_ptr
<BluetoothDeviceClient
> client
) {
499 DBusThreadManager::Get()->client_bundle_
->bluetooth_device_client_
=
503 void DBusThreadManagerSetter::SetBluetoothGattCharacteristicClient(
504 scoped_ptr
<BluetoothGattCharacteristicClient
> client
) {
505 DBusThreadManager::Get()->client_bundle_
->
506 bluetooth_gatt_characteristic_client_
= client
.Pass();
509 void DBusThreadManagerSetter::SetBluetoothGattDescriptorClient(
510 scoped_ptr
<BluetoothGattDescriptorClient
> client
) {
511 DBusThreadManager::Get()->client_bundle_
->bluetooth_gatt_descriptor_client_
=
515 void DBusThreadManagerSetter::SetBluetoothGattManagerClient(
516 scoped_ptr
<BluetoothGattManagerClient
> client
) {
517 DBusThreadManager::Get()->client_bundle_
->bluetooth_gatt_manager_client_
=
521 void DBusThreadManagerSetter::SetBluetoothGattServiceClient(
522 scoped_ptr
<BluetoothGattServiceClient
> client
) {
523 DBusThreadManager::Get()->client_bundle_
->bluetooth_gatt_service_client_
=
527 void DBusThreadManagerSetter::SetBluetoothInputClient(
528 scoped_ptr
<BluetoothInputClient
> client
) {
529 DBusThreadManager::Get()->client_bundle_
->bluetooth_input_client_
=
533 void DBusThreadManagerSetter::SetBluetoothMediaClient(
534 scoped_ptr
<BluetoothMediaClient
> client
) {
535 DBusThreadManager::Get()->client_bundle_
->bluetooth_media_client_
=
539 void DBusThreadManagerSetter::SetBluetoothMediaTransportClient(
540 scoped_ptr
<BluetoothMediaTransportClient
> client
) {
541 DBusThreadManager::Get()->client_bundle_
->bluetooth_media_transport_client_
=
545 void DBusThreadManagerSetter::SetBluetoothProfileManagerClient(
546 scoped_ptr
<BluetoothProfileManagerClient
> client
) {
547 DBusThreadManager::Get()->client_bundle_
->bluetooth_profile_manager_client_
=
551 void DBusThreadManagerSetter::SetCrasAudioClient(
552 scoped_ptr
<CrasAudioClient
> client
) {
553 DBusThreadManager::Get()->client_bundle_
->cras_audio_client_
= client
.Pass();
556 void DBusThreadManagerSetter::SetCrosDisksClient(
557 scoped_ptr
<CrosDisksClient
> client
) {
558 DBusThreadManager::Get()->client_bundle_
->cros_disks_client_
= client
.Pass();
561 void DBusThreadManagerSetter::SetCryptohomeClient(
562 scoped_ptr
<CryptohomeClient
> client
) {
563 DBusThreadManager::Get()->client_bundle_
->cryptohome_client_
= client
.Pass();
566 void DBusThreadManagerSetter::SetDebugDaemonClient(
567 scoped_ptr
<DebugDaemonClient
> client
) {
568 DBusThreadManager::Get()->client_bundle_
->debug_daemon_client_
=
572 void DBusThreadManagerSetter::SetEasyUnlockClient(
573 scoped_ptr
<EasyUnlockClient
> client
) {
574 DBusThreadManager::Get()->client_bundle_
->easy_unlock_client_
= client
.Pass();
577 void DBusThreadManagerSetter::SetLeadershipDaemonManagerClient(
578 scoped_ptr
<LeadershipDaemonManagerClient
> client
) {
579 DBusThreadManager::Get()->client_bundle_
->leadership_daemon_manager_client_
=
583 void DBusThreadManagerSetter::SetLorgnetteManagerClient(
584 scoped_ptr
<LorgnetteManagerClient
> client
) {
585 DBusThreadManager::Get()->client_bundle_
->lorgnette_manager_client_
=
589 void DBusThreadManagerSetter::SetMetronomeClient(
590 scoped_ptr
<MetronomeClient
> client
) {
591 DBusThreadManager::Get()->client_bundle_
->metronome_client_
= client
.Pass();
594 void DBusThreadManagerSetter::SetShillDeviceClient(
595 scoped_ptr
<ShillDeviceClient
> client
) {
596 DBusThreadManager::Get()->client_bundle_
->shill_device_client_
=
600 void DBusThreadManagerSetter::SetShillIPConfigClient(
601 scoped_ptr
<ShillIPConfigClient
> client
) {
602 DBusThreadManager::Get()->client_bundle_
->shill_ipconfig_client_
=
606 void DBusThreadManagerSetter::SetShillManagerClient(
607 scoped_ptr
<ShillManagerClient
> client
) {
608 DBusThreadManager::Get()->client_bundle_
->shill_manager_client_
=
612 void DBusThreadManagerSetter::SetShillServiceClient(
613 scoped_ptr
<ShillServiceClient
> client
) {
614 DBusThreadManager::Get()->client_bundle_
->shill_service_client_
=
618 void DBusThreadManagerSetter::SetShillProfileClient(
619 scoped_ptr
<ShillProfileClient
> client
) {
620 DBusThreadManager::Get()->client_bundle_
->shill_profile_client_
=
624 void DBusThreadManagerSetter::SetShillThirdPartyVpnDriverClient(
625 scoped_ptr
<ShillThirdPartyVpnDriverClient
> client
) {
626 DBusThreadManager::Get()
627 ->client_bundle_
->shill_third_party_vpn_driver_client_
= client
.Pass();
630 void DBusThreadManagerSetter::SetGsmSMSClient(
631 scoped_ptr
<GsmSMSClient
> client
) {
632 DBusThreadManager::Get()->client_bundle_
->gsm_sms_client_
= client
.Pass();
635 void DBusThreadManagerSetter::SetImageBurnerClient(
636 scoped_ptr
<ImageBurnerClient
> client
) {
637 DBusThreadManager::Get()->client_bundle_
->image_burner_client_
=
641 void DBusThreadManagerSetter::SetIntrospectableClient(
642 scoped_ptr
<IntrospectableClient
> client
) {
643 DBusThreadManager::Get()->client_bundle_
->introspectable_client_
=
647 void DBusThreadManagerSetter::SetModemMessagingClient(
648 scoped_ptr
<ModemMessagingClient
> client
) {
649 DBusThreadManager::Get()->client_bundle_
->modem_messaging_client_
=
653 void DBusThreadManagerSetter::SetNfcAdapterClient(
654 scoped_ptr
<NfcAdapterClient
> client
) {
655 DBusThreadManager::Get()->client_bundle_
->nfc_adapter_client_
= client
.Pass();
658 void DBusThreadManagerSetter::SetNfcDeviceClient(
659 scoped_ptr
<NfcDeviceClient
> client
) {
660 DBusThreadManager::Get()->client_bundle_
->nfc_device_client_
= client
.Pass();
663 void DBusThreadManagerSetter::SetNfcManagerClient(
664 scoped_ptr
<NfcManagerClient
> client
) {
665 DBusThreadManager::Get()->client_bundle_
->nfc_manager_client_
= client
.Pass();
668 void DBusThreadManagerSetter::SetNfcRecordClient(
669 scoped_ptr
<NfcRecordClient
> client
) {
670 DBusThreadManager::Get()->client_bundle_
->nfc_record_client_
= client
.Pass();
673 void DBusThreadManagerSetter::SetNfcTagClient(
674 scoped_ptr
<NfcTagClient
> client
) {
675 DBusThreadManager::Get()->client_bundle_
->nfc_tag_client_
= client
.Pass();
678 void DBusThreadManagerSetter::SetPeerDaemonManagerClient(
679 scoped_ptr
<PeerDaemonManagerClient
> client
) {
680 DBusThreadManager::Get()->client_bundle_
->peer_daemon_manager_client_
=
684 void DBusThreadManagerSetter::SetPermissionBrokerClient(
685 scoped_ptr
<PermissionBrokerClient
> client
) {
686 DBusThreadManager::Get()->client_bundle_
->permission_broker_client_
=
690 void DBusThreadManagerSetter::SetPrivetDaemonManagerClient(
691 scoped_ptr
<PrivetDaemonManagerClient
> client
) {
692 DBusThreadManager::Get()->client_bundle_
->privet_daemon_manager_client_
=
696 void DBusThreadManagerSetter::SetPowerManagerClient(
697 scoped_ptr
<PowerManagerClient
> client
) {
698 DBusThreadManager::Get()->client_bundle_
->power_manager_client_
=
702 void DBusThreadManagerSetter::SetSessionManagerClient(
703 scoped_ptr
<SessionManagerClient
> client
) {
704 DBusThreadManager::Get()->client_bundle_
->session_manager_client_
=
708 void DBusThreadManagerSetter::SetSMSClient(scoped_ptr
<SMSClient
> client
) {
709 DBusThreadManager::Get()->client_bundle_
->sms_client_
= client
.Pass();
712 void DBusThreadManagerSetter::SetSystemClockClient(
713 scoped_ptr
<SystemClockClient
> client
) {
714 DBusThreadManager::Get()->client_bundle_
->system_clock_client_
=
718 void DBusThreadManagerSetter::SetUpdateEngineClient(
719 scoped_ptr
<UpdateEngineClient
> client
) {
720 DBusThreadManager::Get()->client_bundle_
->update_engine_client_
=
724 } // namespace chromeos