Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chromeos / dbus / dbus_thread_manager.cc
blobfb525b5f2d0a75ae5309d5b1bfc47d0b9bb5663d
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_le_advertising_manager_client.h"
23 #include "chromeos/dbus/bluetooth_media_client.h"
24 #include "chromeos/dbus/bluetooth_media_transport_client.h"
25 #include "chromeos/dbus/bluetooth_profile_manager_client.h"
26 #include "chromeos/dbus/cras_audio_client.h"
27 #include "chromeos/dbus/cros_disks_client.h"
28 #include "chromeos/dbus/cryptohome_client.h"
29 #include "chromeos/dbus/dbus_client.h"
30 #include "chromeos/dbus/debug_daemon_client.h"
31 #include "chromeos/dbus/easy_unlock_client.h"
32 #include "chromeos/dbus/gsm_sms_client.h"
33 #include "chromeos/dbus/image_burner_client.h"
34 #include "chromeos/dbus/introspectable_client.h"
35 #include "chromeos/dbus/lorgnette_manager_client.h"
36 #include "chromeos/dbus/modem_messaging_client.h"
37 #include "chromeos/dbus/nfc_adapter_client.h"
38 #include "chromeos/dbus/nfc_device_client.h"
39 #include "chromeos/dbus/nfc_manager_client.h"
40 #include "chromeos/dbus/nfc_record_client.h"
41 #include "chromeos/dbus/nfc_tag_client.h"
42 #include "chromeos/dbus/peer_daemon_manager_client.h"
43 #include "chromeos/dbus/permission_broker_client.h"
44 #include "chromeos/dbus/power_manager_client.h"
45 #include "chromeos/dbus/privet_daemon_manager_client.h"
46 #include "chromeos/dbus/session_manager_client.h"
47 #include "chromeos/dbus/shill_device_client.h"
48 #include "chromeos/dbus/shill_ipconfig_client.h"
49 #include "chromeos/dbus/shill_manager_client.h"
50 #include "chromeos/dbus/shill_profile_client.h"
51 #include "chromeos/dbus/shill_service_client.h"
52 #include "chromeos/dbus/shill_third_party_vpn_driver_client.h"
53 #include "chromeos/dbus/sms_client.h"
54 #include "chromeos/dbus/system_clock_client.h"
55 #include "chromeos/dbus/update_engine_client.h"
56 #include "dbus/bus.h"
57 #include "dbus/dbus_statistics.h"
59 namespace chromeos {
61 static DBusThreadManager* g_dbus_thread_manager = NULL;
62 static bool g_using_dbus_thread_manager_for_testing = false;
64 DBusThreadManager::DBusThreadManager(scoped_ptr<DBusClientBundle> client_bundle)
65 : client_bundle_(client_bundle.Pass()) {
66 dbus::statistics::Initialize();
68 if (client_bundle_->IsUsingAnyRealClient()) {
69 // At least one real DBusClient is used.
70 // Create the D-Bus thread.
71 base::Thread::Options thread_options;
72 thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
73 dbus_thread_.reset(new base::Thread("D-Bus thread"));
74 dbus_thread_->StartWithOptions(thread_options);
76 // Create the connection to the system bus.
77 dbus::Bus::Options system_bus_options;
78 system_bus_options.bus_type = dbus::Bus::SYSTEM;
79 system_bus_options.connection_type = dbus::Bus::PRIVATE;
80 system_bus_options.dbus_task_runner = dbus_thread_->task_runner();
81 system_bus_ = new dbus::Bus(system_bus_options);
85 DBusThreadManager::~DBusThreadManager() {
86 // Delete all D-Bus clients before shutting down the system bus.
87 client_bundle_.reset();
89 // Shut down the bus. During the browser shutdown, it's ok to shut down
90 // the bus synchronously.
91 if (system_bus_.get())
92 system_bus_->ShutdownOnDBusThreadAndBlock();
94 // Stop the D-Bus thread.
95 if (dbus_thread_)
96 dbus_thread_->Stop();
98 dbus::statistics::Shutdown();
100 if (!g_dbus_thread_manager)
101 return; // Called form Shutdown() or local test instance.
103 // There should never be both a global instance and a local instance.
104 CHECK(this == g_dbus_thread_manager);
105 if (g_using_dbus_thread_manager_for_testing) {
106 g_dbus_thread_manager = NULL;
107 g_using_dbus_thread_manager_for_testing = false;
108 VLOG(1) << "DBusThreadManager destroyed";
109 } else {
110 LOG(FATAL) << "~DBusThreadManager() called outside of Shutdown()";
114 dbus::Bus* DBusThreadManager::GetSystemBus() {
115 return system_bus_.get();
118 AmplifierClient* DBusThreadManager::GetAmplifierClient() {
119 return client_bundle_->amplifier_client();
122 ApManagerClient* DBusThreadManager::GetApManagerClient() {
123 return client_bundle_->ap_manager_client();
126 AudioDspClient* DBusThreadManager::GetAudioDspClient() {
127 return client_bundle_->audio_dsp_client();
130 BluetoothAdapterClient* DBusThreadManager::GetBluetoothAdapterClient() {
131 return client_bundle_->bluetooth_adapter_client();
134 BluetoothLEAdvertisingManagerClient*
135 DBusThreadManager::GetBluetoothLEAdvertisingManagerClient() {
136 return client_bundle_->bluetooth_le_advertising_manager_client();
139 BluetoothAgentManagerClient*
140 DBusThreadManager::GetBluetoothAgentManagerClient() {
141 return client_bundle_->bluetooth_agent_manager_client();
144 BluetoothDeviceClient* DBusThreadManager::GetBluetoothDeviceClient() {
145 return client_bundle_->bluetooth_device_client();
148 BluetoothGattCharacteristicClient*
149 DBusThreadManager::GetBluetoothGattCharacteristicClient() {
150 return client_bundle_->bluetooth_gatt_characteristic_client();
153 BluetoothGattDescriptorClient*
154 DBusThreadManager::GetBluetoothGattDescriptorClient() {
155 return client_bundle_->bluetooth_gatt_descriptor_client();
158 BluetoothGattManagerClient*
159 DBusThreadManager::GetBluetoothGattManagerClient() {
160 return client_bundle_->bluetooth_gatt_manager_client();
163 BluetoothGattServiceClient*
164 DBusThreadManager::GetBluetoothGattServiceClient() {
165 return client_bundle_->bluetooth_gatt_service_client();
168 BluetoothInputClient* DBusThreadManager::GetBluetoothInputClient() {
169 return client_bundle_->bluetooth_input_client();
172 BluetoothMediaClient* DBusThreadManager::GetBluetoothMediaClient() {
173 return client_bundle_->bluetooth_media_client();
176 BluetoothMediaTransportClient*
177 DBusThreadManager::GetBluetoothMediaTransportClient() {
178 return client_bundle_->bluetooth_media_transport_client();
181 BluetoothProfileManagerClient*
182 DBusThreadManager::GetBluetoothProfileManagerClient() {
183 return client_bundle_->bluetooth_profile_manager_client();
186 CrasAudioClient* DBusThreadManager::GetCrasAudioClient() {
187 return client_bundle_->cras_audio_client();
190 CrosDisksClient* DBusThreadManager::GetCrosDisksClient() {
191 return client_bundle_->cros_disks_client();
194 CryptohomeClient* DBusThreadManager::GetCryptohomeClient() {
195 return client_bundle_->cryptohome_client();
198 DebugDaemonClient* DBusThreadManager::GetDebugDaemonClient() {
199 return client_bundle_->debug_daemon_client();
202 EasyUnlockClient* DBusThreadManager::GetEasyUnlockClient() {
203 return client_bundle_->easy_unlock_client();
206 LorgnetteManagerClient*
207 DBusThreadManager::GetLorgnetteManagerClient() {
208 return client_bundle_->lorgnette_manager_client();
211 ShillDeviceClient*
212 DBusThreadManager::GetShillDeviceClient() {
213 return client_bundle_->shill_device_client();
216 ShillIPConfigClient*
217 DBusThreadManager::GetShillIPConfigClient() {
218 return client_bundle_->shill_ipconfig_client();
221 ShillManagerClient*
222 DBusThreadManager::GetShillManagerClient() {
223 return client_bundle_->shill_manager_client();
226 ShillServiceClient*
227 DBusThreadManager::GetShillServiceClient() {
228 return client_bundle_->shill_service_client();
231 ShillProfileClient*
232 DBusThreadManager::GetShillProfileClient() {
233 return client_bundle_->shill_profile_client();
236 ShillThirdPartyVpnDriverClient*
237 DBusThreadManager::GetShillThirdPartyVpnDriverClient() {
238 return client_bundle_->shill_third_party_vpn_driver_client();
241 GsmSMSClient* DBusThreadManager::GetGsmSMSClient() {
242 return client_bundle_->gsm_sms_client();
245 ImageBurnerClient* DBusThreadManager::GetImageBurnerClient() {
246 return client_bundle_->image_burner_client();
249 IntrospectableClient* DBusThreadManager::GetIntrospectableClient() {
250 return client_bundle_->introspectable_client();
253 ModemMessagingClient* DBusThreadManager::GetModemMessagingClient() {
254 return client_bundle_->modem_messaging_client();
257 NfcAdapterClient* DBusThreadManager::GetNfcAdapterClient() {
258 return client_bundle_->nfc_adapter_client();
261 NfcDeviceClient* DBusThreadManager::GetNfcDeviceClient() {
262 return client_bundle_->nfc_device_client();
265 NfcManagerClient* DBusThreadManager::GetNfcManagerClient() {
266 return client_bundle_->nfc_manager_client();
269 NfcRecordClient* DBusThreadManager::GetNfcRecordClient() {
270 return client_bundle_->nfc_record_client();
273 NfcTagClient* DBusThreadManager::GetNfcTagClient() {
274 return client_bundle_->nfc_tag_client();
277 PeerDaemonManagerClient* DBusThreadManager::GetPeerDaemonManagerClient() {
278 return client_bundle_->peer_daemon_manager_client();
281 PermissionBrokerClient* DBusThreadManager::GetPermissionBrokerClient() {
282 return client_bundle_->permission_broker_client();
285 PowerManagerClient* DBusThreadManager::GetPowerManagerClient() {
286 return client_bundle_->power_manager_client();
289 PrivetDaemonManagerClient* DBusThreadManager::GetPrivetDaemonManagerClient() {
290 return client_bundle_->privet_daemon_manager_client();
293 SessionManagerClient* DBusThreadManager::GetSessionManagerClient() {
294 return client_bundle_->session_manager_client();
297 SMSClient* DBusThreadManager::GetSMSClient() {
298 return client_bundle_->sms_client();
301 SystemClockClient* DBusThreadManager::GetSystemClockClient() {
302 return client_bundle_->system_clock_client();
305 UpdateEngineClient* DBusThreadManager::GetUpdateEngineClient() {
306 return client_bundle_->update_engine_client();
309 void DBusThreadManager::InitializeClients() {
310 GetAmplifierClient()->Init(GetSystemBus());
311 GetApManagerClient()->Init(GetSystemBus());
312 GetAudioDspClient()->Init(GetSystemBus());
313 GetBluetoothAdapterClient()->Init(GetSystemBus());
314 GetBluetoothAgentManagerClient()->Init(GetSystemBus());
315 GetBluetoothDeviceClient()->Init(GetSystemBus());
316 GetBluetoothGattCharacteristicClient()->Init(GetSystemBus());
317 GetBluetoothGattDescriptorClient()->Init(GetSystemBus());
318 GetBluetoothGattManagerClient()->Init(GetSystemBus());
319 GetBluetoothGattServiceClient()->Init(GetSystemBus());
320 GetBluetoothInputClient()->Init(GetSystemBus());
321 GetBluetoothLEAdvertisingManagerClient()->Init(GetSystemBus());
322 GetBluetoothMediaClient()->Init(GetSystemBus());
323 GetBluetoothMediaTransportClient()->Init(GetSystemBus());
324 GetBluetoothProfileManagerClient()->Init(GetSystemBus());
325 GetCrasAudioClient()->Init(GetSystemBus());
326 GetCrosDisksClient()->Init(GetSystemBus());
327 GetCryptohomeClient()->Init(GetSystemBus());
328 GetDebugDaemonClient()->Init(GetSystemBus());
329 GetEasyUnlockClient()->Init(GetSystemBus());
330 GetGsmSMSClient()->Init(GetSystemBus());
331 GetImageBurnerClient()->Init(GetSystemBus());
332 GetIntrospectableClient()->Init(GetSystemBus());
333 GetLorgnetteManagerClient()->Init(GetSystemBus());
334 GetModemMessagingClient()->Init(GetSystemBus());
335 GetPermissionBrokerClient()->Init(GetSystemBus());
336 GetPeerDaemonManagerClient()->Init(GetSystemBus());
337 GetPrivetDaemonManagerClient()->Init(GetSystemBus());
338 GetPowerManagerClient()->Init(GetSystemBus());
339 GetSessionManagerClient()->Init(GetSystemBus());
340 GetShillDeviceClient()->Init(GetSystemBus());
341 GetShillIPConfigClient()->Init(GetSystemBus());
342 GetShillManagerClient()->Init(GetSystemBus());
343 GetShillServiceClient()->Init(GetSystemBus());
344 GetShillProfileClient()->Init(GetSystemBus());
345 GetShillThirdPartyVpnDriverClient()->Init(GetSystemBus());
346 GetSMSClient()->Init(GetSystemBus());
347 GetSystemClockClient()->Init(GetSystemBus());
348 GetUpdateEngineClient()->Init(GetSystemBus());
350 // Initialize the NFC clients in the correct order. The order of
351 // initialization matters due to dependencies that exist between the
352 // client objects.
353 GetNfcManagerClient()->Init(GetSystemBus());
354 GetNfcAdapterClient()->Init(GetSystemBus());
355 GetNfcDeviceClient()->Init(GetSystemBus());
356 GetNfcTagClient()->Init(GetSystemBus());
357 GetNfcRecordClient()->Init(GetSystemBus());
359 // This must be called after the list of clients so they've each had a
360 // chance to register with their object g_dbus_thread_managers.
361 if (GetSystemBus())
362 GetSystemBus()->GetManagedObjects();
364 client_bundle_->SetupDefaultEnvironment();
367 bool DBusThreadManager::IsUsingStub(DBusClientBundle::DBusClientType client) {
368 return client_bundle_->IsUsingStub(client);
371 // static
372 void DBusThreadManager::Initialize() {
373 // If we initialize DBusThreadManager twice we may also be shutting it down
374 // early; do not allow that.
375 if (g_using_dbus_thread_manager_for_testing)
376 return;
378 CHECK(!g_dbus_thread_manager);
379 bool use_dbus_stub = !base::SysInfo::IsRunningOnChromeOS() ||
380 base::CommandLine::ForCurrentProcess()->HasSwitch(
381 chromeos::switches::kDbusStub);
382 bool force_unstub_clients = base::CommandLine::ForCurrentProcess()->HasSwitch(
383 chromeos::switches::kDbusUnstubClients);
384 // Determine whether we use stub or real client implementations.
385 if (force_unstub_clients) {
386 InitializeWithPartialStub(
387 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
388 chromeos::switches::kDbusUnstubClients));
389 } else if (use_dbus_stub) {
390 InitializeWithStubs();
391 } else {
392 InitializeWithRealClients();
396 // static
397 scoped_ptr<DBusThreadManagerSetter> DBusThreadManager::GetSetterForTesting() {
398 if (!g_using_dbus_thread_manager_for_testing) {
399 g_using_dbus_thread_manager_for_testing = true;
400 InitializeWithStubs();
403 return make_scoped_ptr(new DBusThreadManagerSetter());
406 // static
407 void DBusThreadManager::CreateGlobalInstance(
408 DBusClientBundle::DBusClientTypeMask unstub_client_mask) {
409 CHECK(!g_dbus_thread_manager);
410 g_dbus_thread_manager = new DBusThreadManager(
411 make_scoped_ptr(new DBusClientBundle(unstub_client_mask)));
412 g_dbus_thread_manager->InitializeClients();
415 // static
416 void DBusThreadManager::InitializeWithRealClients() {
417 CreateGlobalInstance(~static_cast<DBusClientBundle::DBusClientTypeMask>(0));
418 VLOG(1) << "DBusThreadManager initialized for Chrome OS";
421 // static
422 void DBusThreadManager::InitializeWithStubs() {
423 CreateGlobalInstance(0 /* unstub_client_mask */);
424 VLOG(1) << "DBusThreadManager created for testing";
427 // static
428 void DBusThreadManager::InitializeWithPartialStub(
429 const std::string& unstub_clients) {
430 DBusClientBundle::DBusClientTypeMask unstub_client_mask =
431 DBusClientBundle::ParseUnstubList(unstub_clients);
432 // We should have something parsed correctly here.
433 LOG_IF(FATAL, unstub_client_mask == 0)
434 << "Switch values for --" << chromeos::switches::kDbusUnstubClients
435 << " cannot be parsed: " << unstub_clients;
436 VLOG(1) << "DBusThreadManager initialized for mixed runtime environment";
437 CreateGlobalInstance(unstub_client_mask);
440 // static
441 bool DBusThreadManager::IsInitialized() {
442 return g_dbus_thread_manager != NULL;
445 // static
446 void DBusThreadManager::Shutdown() {
447 // Ensure that we only shutdown DBusThreadManager once.
448 CHECK(g_dbus_thread_manager);
449 DBusThreadManager* dbus_thread_manager = g_dbus_thread_manager;
450 g_dbus_thread_manager = NULL;
451 g_using_dbus_thread_manager_for_testing = false;
452 delete dbus_thread_manager;
453 VLOG(1) << "DBusThreadManager Shutdown completed";
456 // static
457 DBusThreadManager* DBusThreadManager::Get() {
458 CHECK(g_dbus_thread_manager)
459 << "DBusThreadManager::Get() called before Initialize()";
460 return g_dbus_thread_manager;
463 DBusThreadManagerSetter::DBusThreadManagerSetter() {
466 DBusThreadManagerSetter::~DBusThreadManagerSetter() {
469 void DBusThreadManagerSetter::SetAmplifierClient(
470 scoped_ptr<AmplifierClient> client) {
471 DBusThreadManager::Get()->client_bundle_->amplifier_client_ = client.Pass();
474 void DBusThreadManagerSetter::SetAudioDspClient(
475 scoped_ptr<AudioDspClient> client) {
476 DBusThreadManager::Get()->client_bundle_->audio_dsp_client_ = client.Pass();
479 void DBusThreadManagerSetter::SetBluetoothAdapterClient(
480 scoped_ptr<BluetoothAdapterClient> client) {
481 DBusThreadManager::Get()->client_bundle_->bluetooth_adapter_client_ =
482 client.Pass();
485 void DBusThreadManagerSetter::SetBluetoothLEAdvertisingManagerClient(
486 scoped_ptr<BluetoothLEAdvertisingManagerClient> client) {
487 DBusThreadManager::Get()->client_bundle_->
488 bluetooth_le_advertising_manager_client_ = client.Pass();
491 void DBusThreadManagerSetter::SetBluetoothAgentManagerClient(
492 scoped_ptr<BluetoothAgentManagerClient> client) {
493 DBusThreadManager::Get()->client_bundle_->bluetooth_agent_manager_client_ =
494 client.Pass();
497 void DBusThreadManagerSetter::SetBluetoothDeviceClient(
498 scoped_ptr<BluetoothDeviceClient> client) {
499 DBusThreadManager::Get()->client_bundle_->bluetooth_device_client_ =
500 client.Pass();
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_ =
512 client.Pass();
515 void DBusThreadManagerSetter::SetBluetoothGattManagerClient(
516 scoped_ptr<BluetoothGattManagerClient> client) {
517 DBusThreadManager::Get()->client_bundle_->bluetooth_gatt_manager_client_ =
518 client.Pass();
521 void DBusThreadManagerSetter::SetBluetoothGattServiceClient(
522 scoped_ptr<BluetoothGattServiceClient> client) {
523 DBusThreadManager::Get()->client_bundle_->bluetooth_gatt_service_client_ =
524 client.Pass();
527 void DBusThreadManagerSetter::SetBluetoothInputClient(
528 scoped_ptr<BluetoothInputClient> client) {
529 DBusThreadManager::Get()->client_bundle_->bluetooth_input_client_ =
530 client.Pass();
533 void DBusThreadManagerSetter::SetBluetoothMediaClient(
534 scoped_ptr<BluetoothMediaClient> client) {
535 DBusThreadManager::Get()->client_bundle_->bluetooth_media_client_ =
536 client.Pass();
539 void DBusThreadManagerSetter::SetBluetoothMediaTransportClient(
540 scoped_ptr<BluetoothMediaTransportClient> client) {
541 DBusThreadManager::Get()->client_bundle_->bluetooth_media_transport_client_ =
542 client.Pass();
545 void DBusThreadManagerSetter::SetBluetoothProfileManagerClient(
546 scoped_ptr<BluetoothProfileManagerClient> client) {
547 DBusThreadManager::Get()->client_bundle_->bluetooth_profile_manager_client_ =
548 client.Pass();
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_ =
569 client.Pass();
572 void DBusThreadManagerSetter::SetEasyUnlockClient(
573 scoped_ptr<EasyUnlockClient> client) {
574 DBusThreadManager::Get()->client_bundle_->easy_unlock_client_ = client.Pass();
577 void DBusThreadManagerSetter::SetLorgnetteManagerClient(
578 scoped_ptr<LorgnetteManagerClient> client) {
579 DBusThreadManager::Get()->client_bundle_->lorgnette_manager_client_ =
580 client.Pass();
583 void DBusThreadManagerSetter::SetShillDeviceClient(
584 scoped_ptr<ShillDeviceClient> client) {
585 DBusThreadManager::Get()->client_bundle_->shill_device_client_ =
586 client.Pass();
589 void DBusThreadManagerSetter::SetShillIPConfigClient(
590 scoped_ptr<ShillIPConfigClient> client) {
591 DBusThreadManager::Get()->client_bundle_->shill_ipconfig_client_ =
592 client.Pass();
595 void DBusThreadManagerSetter::SetShillManagerClient(
596 scoped_ptr<ShillManagerClient> client) {
597 DBusThreadManager::Get()->client_bundle_->shill_manager_client_ =
598 client.Pass();
601 void DBusThreadManagerSetter::SetShillServiceClient(
602 scoped_ptr<ShillServiceClient> client) {
603 DBusThreadManager::Get()->client_bundle_->shill_service_client_ =
604 client.Pass();
607 void DBusThreadManagerSetter::SetShillProfileClient(
608 scoped_ptr<ShillProfileClient> client) {
609 DBusThreadManager::Get()->client_bundle_->shill_profile_client_ =
610 client.Pass();
613 void DBusThreadManagerSetter::SetShillThirdPartyVpnDriverClient(
614 scoped_ptr<ShillThirdPartyVpnDriverClient> client) {
615 DBusThreadManager::Get()
616 ->client_bundle_->shill_third_party_vpn_driver_client_ = client.Pass();
619 void DBusThreadManagerSetter::SetGsmSMSClient(
620 scoped_ptr<GsmSMSClient> client) {
621 DBusThreadManager::Get()->client_bundle_->gsm_sms_client_ = client.Pass();
624 void DBusThreadManagerSetter::SetImageBurnerClient(
625 scoped_ptr<ImageBurnerClient> client) {
626 DBusThreadManager::Get()->client_bundle_->image_burner_client_ =
627 client.Pass();
630 void DBusThreadManagerSetter::SetIntrospectableClient(
631 scoped_ptr<IntrospectableClient> client) {
632 DBusThreadManager::Get()->client_bundle_->introspectable_client_ =
633 client.Pass();
636 void DBusThreadManagerSetter::SetModemMessagingClient(
637 scoped_ptr<ModemMessagingClient> client) {
638 DBusThreadManager::Get()->client_bundle_->modem_messaging_client_ =
639 client.Pass();
642 void DBusThreadManagerSetter::SetNfcAdapterClient(
643 scoped_ptr<NfcAdapterClient> client) {
644 DBusThreadManager::Get()->client_bundle_->nfc_adapter_client_ = client.Pass();
647 void DBusThreadManagerSetter::SetNfcDeviceClient(
648 scoped_ptr<NfcDeviceClient> client) {
649 DBusThreadManager::Get()->client_bundle_->nfc_device_client_ = client.Pass();
652 void DBusThreadManagerSetter::SetNfcManagerClient(
653 scoped_ptr<NfcManagerClient> client) {
654 DBusThreadManager::Get()->client_bundle_->nfc_manager_client_ = client.Pass();
657 void DBusThreadManagerSetter::SetNfcRecordClient(
658 scoped_ptr<NfcRecordClient> client) {
659 DBusThreadManager::Get()->client_bundle_->nfc_record_client_ = client.Pass();
662 void DBusThreadManagerSetter::SetNfcTagClient(
663 scoped_ptr<NfcTagClient> client) {
664 DBusThreadManager::Get()->client_bundle_->nfc_tag_client_ = client.Pass();
667 void DBusThreadManagerSetter::SetPeerDaemonManagerClient(
668 scoped_ptr<PeerDaemonManagerClient> client) {
669 DBusThreadManager::Get()->client_bundle_->peer_daemon_manager_client_ =
670 client.Pass();
673 void DBusThreadManagerSetter::SetPermissionBrokerClient(
674 scoped_ptr<PermissionBrokerClient> client) {
675 DBusThreadManager::Get()->client_bundle_->permission_broker_client_ =
676 client.Pass();
679 void DBusThreadManagerSetter::SetPrivetDaemonManagerClient(
680 scoped_ptr<PrivetDaemonManagerClient> client) {
681 DBusThreadManager::Get()->client_bundle_->privet_daemon_manager_client_ =
682 client.Pass();
685 void DBusThreadManagerSetter::SetPowerManagerClient(
686 scoped_ptr<PowerManagerClient> client) {
687 DBusThreadManager::Get()->client_bundle_->power_manager_client_ =
688 client.Pass();
691 void DBusThreadManagerSetter::SetSessionManagerClient(
692 scoped_ptr<SessionManagerClient> client) {
693 DBusThreadManager::Get()->client_bundle_->session_manager_client_ =
694 client.Pass();
697 void DBusThreadManagerSetter::SetSMSClient(scoped_ptr<SMSClient> client) {
698 DBusThreadManager::Get()->client_bundle_->sms_client_ = client.Pass();
701 void DBusThreadManagerSetter::SetSystemClockClient(
702 scoped_ptr<SystemClockClient> client) {
703 DBusThreadManager::Get()->client_bundle_->system_clock_client_ =
704 client.Pass();
707 void DBusThreadManagerSetter::SetUpdateEngineClient(
708 scoped_ptr<UpdateEngineClient> client) {
709 DBusThreadManager::Get()->client_bundle_->update_engine_client_ =
710 client.Pass();
713 } // namespace chromeos