Revert of Revert of Fix text clipping in CompositorFrameTime Display (patchset #1...
[chromium-blink-merge.git] / chromeos / dbus / dbus_thread_manager.cc
blobc4741e57aee28da1684f1cd5eaf0d3f845378a75
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/ap_manager_client.h"
12 #include "chromeos/dbus/bluetooth_adapter_client.h"
13 #include "chromeos/dbus/bluetooth_agent_manager_client.h"
14 #include "chromeos/dbus/bluetooth_device_client.h"
15 #include "chromeos/dbus/bluetooth_gatt_characteristic_client.h"
16 #include "chromeos/dbus/bluetooth_gatt_descriptor_client.h"
17 #include "chromeos/dbus/bluetooth_gatt_manager_client.h"
18 #include "chromeos/dbus/bluetooth_gatt_service_client.h"
19 #include "chromeos/dbus/bluetooth_input_client.h"
20 #include "chromeos/dbus/bluetooth_media_client.h"
21 #include "chromeos/dbus/bluetooth_media_transport_client.h"
22 #include "chromeos/dbus/bluetooth_profile_manager_client.h"
23 #include "chromeos/dbus/cras_audio_client.h"
24 #include "chromeos/dbus/cros_disks_client.h"
25 #include "chromeos/dbus/cryptohome_client.h"
26 #include "chromeos/dbus/dbus_client.h"
27 #include "chromeos/dbus/debug_daemon_client.h"
28 #include "chromeos/dbus/easy_unlock_client.h"
29 #include "chromeos/dbus/gsm_sms_client.h"
30 #include "chromeos/dbus/image_burner_client.h"
31 #include "chromeos/dbus/introspectable_client.h"
32 #include "chromeos/dbus/leadership_daemon_manager_client.h"
33 #include "chromeos/dbus/lorgnette_manager_client.h"
34 #include "chromeos/dbus/metronome_client.h"
35 #include "chromeos/dbus/modem_messaging_client.h"
36 #include "chromeos/dbus/nfc_adapter_client.h"
37 #include "chromeos/dbus/nfc_device_client.h"
38 #include "chromeos/dbus/nfc_manager_client.h"
39 #include "chromeos/dbus/nfc_record_client.h"
40 #include "chromeos/dbus/nfc_tag_client.h"
41 #include "chromeos/dbus/peer_daemon_manager_client.h"
42 #include "chromeos/dbus/permission_broker_client.h"
43 #include "chromeos/dbus/power_manager_client.h"
44 #include "chromeos/dbus/privet_daemon_manager_client.h"
45 #include "chromeos/dbus/session_manager_client.h"
46 #include "chromeos/dbus/shill_device_client.h"
47 #include "chromeos/dbus/shill_ipconfig_client.h"
48 #include "chromeos/dbus/shill_manager_client.h"
49 #include "chromeos/dbus/shill_profile_client.h"
50 #include "chromeos/dbus/shill_service_client.h"
51 #include "chromeos/dbus/shill_third_party_vpn_driver_client.h"
52 #include "chromeos/dbus/sms_client.h"
53 #include "chromeos/dbus/system_clock_client.h"
54 #include "chromeos/dbus/update_engine_client.h"
55 #include "dbus/bus.h"
56 #include "dbus/dbus_statistics.h"
58 namespace chromeos {
60 static DBusThreadManager* g_dbus_thread_manager = NULL;
61 static bool g_using_dbus_thread_manager_for_testing = false;
63 DBusThreadManager::DBusThreadManager(scoped_ptr<DBusClientBundle> client_bundle)
64 : client_bundle_(client_bundle.Pass()) {
65 dbus::statistics::Initialize();
67 if (client_bundle_->IsUsingAnyRealClient()) {
68 // At least one real DBusClient is used.
69 // Create the D-Bus thread.
70 base::Thread::Options thread_options;
71 thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
72 dbus_thread_.reset(new base::Thread("D-Bus thread"));
73 dbus_thread_->StartWithOptions(thread_options);
75 // Create the connection to the system bus.
76 dbus::Bus::Options system_bus_options;
77 system_bus_options.bus_type = dbus::Bus::SYSTEM;
78 system_bus_options.connection_type = dbus::Bus::PRIVATE;
79 system_bus_options.dbus_task_runner = dbus_thread_->message_loop_proxy();
80 system_bus_ = new dbus::Bus(system_bus_options);
84 DBusThreadManager::~DBusThreadManager() {
85 // Delete all D-Bus clients before shutting down the system bus.
86 client_bundle_.reset();
88 // Shut down the bus. During the browser shutdown, it's ok to shut down
89 // the bus synchronously.
90 if (system_bus_.get())
91 system_bus_->ShutdownOnDBusThreadAndBlock();
93 // Stop the D-Bus thread.
94 if (dbus_thread_)
95 dbus_thread_->Stop();
97 dbus::statistics::Shutdown();
99 if (!g_dbus_thread_manager)
100 return; // Called form Shutdown() or local test instance.
102 // There should never be both a global instance and a local instance.
103 CHECK(this == g_dbus_thread_manager);
104 if (g_using_dbus_thread_manager_for_testing) {
105 g_dbus_thread_manager = NULL;
106 g_using_dbus_thread_manager_for_testing = false;
107 VLOG(1) << "DBusThreadManager destroyed";
108 } else {
109 LOG(FATAL) << "~DBusThreadManager() called outside of Shutdown()";
113 dbus::Bus* DBusThreadManager::GetSystemBus() {
114 return system_bus_.get();
117 ApManagerClient* DBusThreadManager::GetApManagerClient() {
118 return client_bundle_->ap_manager_client();
121 BluetoothAdapterClient* DBusThreadManager::GetBluetoothAdapterClient() {
122 return client_bundle_->bluetooth_adapter_client();
125 BluetoothAgentManagerClient*
126 DBusThreadManager::GetBluetoothAgentManagerClient() {
127 return client_bundle_->bluetooth_agent_manager_client();
130 BluetoothDeviceClient* DBusThreadManager::GetBluetoothDeviceClient() {
131 return client_bundle_->bluetooth_device_client();
134 BluetoothGattCharacteristicClient*
135 DBusThreadManager::GetBluetoothGattCharacteristicClient() {
136 return client_bundle_->bluetooth_gatt_characteristic_client();
139 BluetoothGattDescriptorClient*
140 DBusThreadManager::GetBluetoothGattDescriptorClient() {
141 return client_bundle_->bluetooth_gatt_descriptor_client();
144 BluetoothGattManagerClient*
145 DBusThreadManager::GetBluetoothGattManagerClient() {
146 return client_bundle_->bluetooth_gatt_manager_client();
149 BluetoothGattServiceClient*
150 DBusThreadManager::GetBluetoothGattServiceClient() {
151 return client_bundle_->bluetooth_gatt_service_client();
154 BluetoothInputClient* DBusThreadManager::GetBluetoothInputClient() {
155 return client_bundle_->bluetooth_input_client();
158 BluetoothMediaClient* DBusThreadManager::GetBluetoothMediaClient() {
159 return client_bundle_->bluetooth_media_client();
162 BluetoothMediaTransportClient*
163 DBusThreadManager::GetBluetoothMediaTransportClient() {
164 return client_bundle_->bluetooth_media_transport_client();
167 BluetoothProfileManagerClient*
168 DBusThreadManager::GetBluetoothProfileManagerClient() {
169 return client_bundle_->bluetooth_profile_manager_client();
172 CrasAudioClient* DBusThreadManager::GetCrasAudioClient() {
173 return client_bundle_->cras_audio_client();
176 CrosDisksClient* DBusThreadManager::GetCrosDisksClient() {
177 return client_bundle_->cros_disks_client();
180 CryptohomeClient* DBusThreadManager::GetCryptohomeClient() {
181 return client_bundle_->cryptohome_client();
184 DebugDaemonClient* DBusThreadManager::GetDebugDaemonClient() {
185 return client_bundle_->debug_daemon_client();
188 EasyUnlockClient* DBusThreadManager::GetEasyUnlockClient() {
189 return client_bundle_->easy_unlock_client();
192 LeadershipDaemonManagerClient*
193 DBusThreadManager::GetLeadershipDaemonManagerClient() {
194 return client_bundle_->leadership_daemon_manager_client();
197 LorgnetteManagerClient*
198 DBusThreadManager::GetLorgnetteManagerClient() {
199 return client_bundle_->lorgnette_manager_client();
202 MetronomeClient* DBusThreadManager::GetMetronomeClient() {
203 return client_bundle_->metronome_client();
206 ShillDeviceClient*
207 DBusThreadManager::GetShillDeviceClient() {
208 return client_bundle_->shill_device_client();
211 ShillIPConfigClient*
212 DBusThreadManager::GetShillIPConfigClient() {
213 return client_bundle_->shill_ipconfig_client();
216 ShillManagerClient*
217 DBusThreadManager::GetShillManagerClient() {
218 return client_bundle_->shill_manager_client();
221 ShillServiceClient*
222 DBusThreadManager::GetShillServiceClient() {
223 return client_bundle_->shill_service_client();
226 ShillProfileClient*
227 DBusThreadManager::GetShillProfileClient() {
228 return client_bundle_->shill_profile_client();
231 ShillThirdPartyVpnDriverClient*
232 DBusThreadManager::GetShillThirdPartyVpnDriverClient() {
233 return client_bundle_->shill_third_party_vpn_driver_client();
236 GsmSMSClient* DBusThreadManager::GetGsmSMSClient() {
237 return client_bundle_->gsm_sms_client();
240 ImageBurnerClient* DBusThreadManager::GetImageBurnerClient() {
241 return client_bundle_->image_burner_client();
244 IntrospectableClient* DBusThreadManager::GetIntrospectableClient() {
245 return client_bundle_->introspectable_client();
248 ModemMessagingClient* DBusThreadManager::GetModemMessagingClient() {
249 return client_bundle_->modem_messaging_client();
252 NfcAdapterClient* DBusThreadManager::GetNfcAdapterClient() {
253 return client_bundle_->nfc_adapter_client();
256 NfcDeviceClient* DBusThreadManager::GetNfcDeviceClient() {
257 return client_bundle_->nfc_device_client();
260 NfcManagerClient* DBusThreadManager::GetNfcManagerClient() {
261 return client_bundle_->nfc_manager_client();
264 NfcRecordClient* DBusThreadManager::GetNfcRecordClient() {
265 return client_bundle_->nfc_record_client();
268 NfcTagClient* DBusThreadManager::GetNfcTagClient() {
269 return client_bundle_->nfc_tag_client();
272 PeerDaemonManagerClient* DBusThreadManager::GetPeerDaemonManagerClient() {
273 return client_bundle_->peer_daemon_manager_client();
276 PermissionBrokerClient* DBusThreadManager::GetPermissionBrokerClient() {
277 return client_bundle_->permission_broker_client();
280 PowerManagerClient* DBusThreadManager::GetPowerManagerClient() {
281 return client_bundle_->power_manager_client();
284 PrivetDaemonManagerClient* DBusThreadManager::GetPrivetDaemonManagerClient() {
285 return client_bundle_->privet_daemon_manager_client();
288 SessionManagerClient* DBusThreadManager::GetSessionManagerClient() {
289 return client_bundle_->session_manager_client();
292 SMSClient* DBusThreadManager::GetSMSClient() {
293 return client_bundle_->sms_client();
296 SystemClockClient* DBusThreadManager::GetSystemClockClient() {
297 return client_bundle_->system_clock_client();
300 UpdateEngineClient* DBusThreadManager::GetUpdateEngineClient() {
301 return client_bundle_->update_engine_client();
304 void DBusThreadManager::InitializeClients() {
305 GetApManagerClient()->Init(GetSystemBus());
306 GetBluetoothAdapterClient()->Init(GetSystemBus());
307 GetBluetoothAgentManagerClient()->Init(GetSystemBus());
308 GetBluetoothDeviceClient()->Init(GetSystemBus());
309 GetBluetoothGattCharacteristicClient()->Init(GetSystemBus());
310 GetBluetoothGattDescriptorClient()->Init(GetSystemBus());
311 GetBluetoothGattManagerClient()->Init(GetSystemBus());
312 GetBluetoothGattServiceClient()->Init(GetSystemBus());
313 GetBluetoothInputClient()->Init(GetSystemBus());
314 GetBluetoothMediaClient()->Init(GetSystemBus());
315 GetBluetoothMediaTransportClient()->Init(GetSystemBus());
316 GetBluetoothProfileManagerClient()->Init(GetSystemBus());
317 GetCrasAudioClient()->Init(GetSystemBus());
318 GetCrosDisksClient()->Init(GetSystemBus());
319 GetCryptohomeClient()->Init(GetSystemBus());
320 GetDebugDaemonClient()->Init(GetSystemBus());
321 GetEasyUnlockClient()->Init(GetSystemBus());
322 GetGsmSMSClient()->Init(GetSystemBus());
323 GetImageBurnerClient()->Init(GetSystemBus());
324 GetIntrospectableClient()->Init(GetSystemBus());
325 GetLeadershipDaemonManagerClient()->Init(GetSystemBus());
326 GetLorgnetteManagerClient()->Init(GetSystemBus());
327 GetMetronomeClient()->Init(GetSystemBus());
328 GetModemMessagingClient()->Init(GetSystemBus());
329 GetPermissionBrokerClient()->Init(GetSystemBus());
330 GetPeerDaemonManagerClient()->Init(GetSystemBus());
331 GetPrivetDaemonManagerClient()->Init(GetSystemBus());
332 GetPowerManagerClient()->Init(GetSystemBus());
333 GetSessionManagerClient()->Init(GetSystemBus());
334 GetShillDeviceClient()->Init(GetSystemBus());
335 GetShillIPConfigClient()->Init(GetSystemBus());
336 GetShillManagerClient()->Init(GetSystemBus());
337 GetShillServiceClient()->Init(GetSystemBus());
338 GetShillProfileClient()->Init(GetSystemBus());
339 GetShillThirdPartyVpnDriverClient()->Init(GetSystemBus());
340 GetSMSClient()->Init(GetSystemBus());
341 GetSystemClockClient()->Init(GetSystemBus());
342 GetUpdateEngineClient()->Init(GetSystemBus());
344 // Initialize the NFC clients in the correct order. The order of
345 // initialization matters due to dependencies that exist between the
346 // client objects.
347 GetNfcManagerClient()->Init(GetSystemBus());
348 GetNfcAdapterClient()->Init(GetSystemBus());
349 GetNfcDeviceClient()->Init(GetSystemBus());
350 GetNfcTagClient()->Init(GetSystemBus());
351 GetNfcRecordClient()->Init(GetSystemBus());
353 // This must be called after the list of clients so they've each had a
354 // chance to register with their object g_dbus_thread_managers.
355 if (GetSystemBus())
356 GetSystemBus()->GetManagedObjects();
358 client_bundle_->SetupDefaultEnvironment();
361 bool DBusThreadManager::IsUsingStub(DBusClientBundle::DBusClientType client) {
362 return client_bundle_->IsUsingStub(client);
365 // static
366 void DBusThreadManager::Initialize() {
367 // If we initialize DBusThreadManager twice we may also be shutting it down
368 // early; do not allow that.
369 if (g_using_dbus_thread_manager_for_testing)
370 return;
372 CHECK(!g_dbus_thread_manager);
373 bool use_dbus_stub = !base::SysInfo::IsRunningOnChromeOS() ||
374 base::CommandLine::ForCurrentProcess()->HasSwitch(
375 chromeos::switches::kDbusStub);
376 bool force_unstub_clients = base::CommandLine::ForCurrentProcess()->HasSwitch(
377 chromeos::switches::kDbusUnstubClients);
378 // Determine whether we use stub or real client implementations.
379 if (force_unstub_clients) {
380 InitializeWithPartialStub(
381 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
382 chromeos::switches::kDbusUnstubClients));
383 } else if (use_dbus_stub) {
384 InitializeWithStubs();
385 } else {
386 InitializeWithRealClients();
390 // static
391 scoped_ptr<DBusThreadManagerSetter> DBusThreadManager::GetSetterForTesting() {
392 if (!g_using_dbus_thread_manager_for_testing) {
393 g_using_dbus_thread_manager_for_testing = true;
394 InitializeWithStubs();
397 return make_scoped_ptr(new DBusThreadManagerSetter());
400 // static
401 void DBusThreadManager::CreateGlobalInstance(
402 DBusClientBundle::DBusClientTypeMask unstub_client_mask) {
403 CHECK(!g_dbus_thread_manager);
404 g_dbus_thread_manager = new DBusThreadManager(
405 make_scoped_ptr(new DBusClientBundle(unstub_client_mask)));
406 g_dbus_thread_manager->InitializeClients();
409 // static
410 void DBusThreadManager::InitializeWithRealClients() {
411 CreateGlobalInstance(~static_cast<DBusClientBundle::DBusClientTypeMask>(0));
412 VLOG(1) << "DBusThreadManager initialized for Chrome OS";
415 // static
416 void DBusThreadManager::InitializeWithStubs() {
417 CreateGlobalInstance(0 /* unstub_client_mask */);
418 VLOG(1) << "DBusThreadManager created for testing";
421 // static
422 void DBusThreadManager::InitializeWithPartialStub(
423 const std::string& unstub_clients) {
424 DBusClientBundle::DBusClientTypeMask unstub_client_mask =
425 DBusClientBundle::ParseUnstubList(unstub_clients);
426 // We should have something parsed correctly here.
427 LOG_IF(FATAL, unstub_client_mask == 0)
428 << "Switch values for --" << chromeos::switches::kDbusUnstubClients
429 << " cannot be parsed: " << unstub_clients;
430 VLOG(1) << "DBusThreadManager initialized for mixed runtime environment";
431 CreateGlobalInstance(unstub_client_mask);
434 // static
435 bool DBusThreadManager::IsInitialized() {
436 return g_dbus_thread_manager != NULL;
439 // static
440 void DBusThreadManager::Shutdown() {
441 // Ensure that we only shutdown DBusThreadManager once.
442 CHECK(g_dbus_thread_manager);
443 DBusThreadManager* dbus_thread_manager = g_dbus_thread_manager;
444 g_dbus_thread_manager = NULL;
445 g_using_dbus_thread_manager_for_testing = false;
446 delete dbus_thread_manager;
447 VLOG(1) << "DBusThreadManager Shutdown completed";
450 // static
451 DBusThreadManager* DBusThreadManager::Get() {
452 CHECK(g_dbus_thread_manager)
453 << "DBusThreadManager::Get() called before Initialize()";
454 return g_dbus_thread_manager;
457 DBusThreadManagerSetter::DBusThreadManagerSetter() {
460 DBusThreadManagerSetter::~DBusThreadManagerSetter() {
463 void DBusThreadManagerSetter::SetBluetoothAdapterClient(
464 scoped_ptr<BluetoothAdapterClient> client) {
465 DBusThreadManager::Get()->client_bundle_->bluetooth_adapter_client_ =
466 client.Pass();
469 void DBusThreadManagerSetter::SetBluetoothAgentManagerClient(
470 scoped_ptr<BluetoothAgentManagerClient> client) {
471 DBusThreadManager::Get()->client_bundle_->bluetooth_agent_manager_client_ =
472 client.Pass();
475 void DBusThreadManagerSetter::SetBluetoothDeviceClient(
476 scoped_ptr<BluetoothDeviceClient> client) {
477 DBusThreadManager::Get()->client_bundle_->bluetooth_device_client_ =
478 client.Pass();
481 void DBusThreadManagerSetter::SetBluetoothGattCharacteristicClient(
482 scoped_ptr<BluetoothGattCharacteristicClient> client) {
483 DBusThreadManager::Get()->client_bundle_->
484 bluetooth_gatt_characteristic_client_ = client.Pass();
487 void DBusThreadManagerSetter::SetBluetoothGattDescriptorClient(
488 scoped_ptr<BluetoothGattDescriptorClient> client) {
489 DBusThreadManager::Get()->client_bundle_->bluetooth_gatt_descriptor_client_ =
490 client.Pass();
493 void DBusThreadManagerSetter::SetBluetoothGattManagerClient(
494 scoped_ptr<BluetoothGattManagerClient> client) {
495 DBusThreadManager::Get()->client_bundle_->bluetooth_gatt_manager_client_ =
496 client.Pass();
499 void DBusThreadManagerSetter::SetBluetoothGattServiceClient(
500 scoped_ptr<BluetoothGattServiceClient> client) {
501 DBusThreadManager::Get()->client_bundle_->bluetooth_gatt_service_client_ =
502 client.Pass();
505 void DBusThreadManagerSetter::SetBluetoothInputClient(
506 scoped_ptr<BluetoothInputClient> client) {
507 DBusThreadManager::Get()->client_bundle_->bluetooth_input_client_ =
508 client.Pass();
511 void DBusThreadManagerSetter::SetBluetoothMediaClient(
512 scoped_ptr<BluetoothMediaClient> client) {
513 DBusThreadManager::Get()->client_bundle_->bluetooth_media_client_ =
514 client.Pass();
517 void DBusThreadManagerSetter::SetBluetoothMediaTransportClient(
518 scoped_ptr<BluetoothMediaTransportClient> client) {
519 DBusThreadManager::Get()->client_bundle_->bluetooth_media_transport_client_ =
520 client.Pass();
523 void DBusThreadManagerSetter::SetBluetoothProfileManagerClient(
524 scoped_ptr<BluetoothProfileManagerClient> client) {
525 DBusThreadManager::Get()->client_bundle_->bluetooth_profile_manager_client_ =
526 client.Pass();
529 void DBusThreadManagerSetter::SetCrasAudioClient(
530 scoped_ptr<CrasAudioClient> client) {
531 DBusThreadManager::Get()->client_bundle_->cras_audio_client_ = client.Pass();
534 void DBusThreadManagerSetter::SetCrosDisksClient(
535 scoped_ptr<CrosDisksClient> client) {
536 DBusThreadManager::Get()->client_bundle_->cros_disks_client_ = client.Pass();
539 void DBusThreadManagerSetter::SetCryptohomeClient(
540 scoped_ptr<CryptohomeClient> client) {
541 DBusThreadManager::Get()->client_bundle_->cryptohome_client_ = client.Pass();
544 void DBusThreadManagerSetter::SetDebugDaemonClient(
545 scoped_ptr<DebugDaemonClient> client) {
546 DBusThreadManager::Get()->client_bundle_->debug_daemon_client_ =
547 client.Pass();
550 void DBusThreadManagerSetter::SetEasyUnlockClient(
551 scoped_ptr<EasyUnlockClient> client) {
552 DBusThreadManager::Get()->client_bundle_->easy_unlock_client_ = client.Pass();
555 void DBusThreadManagerSetter::SetLeadershipDaemonManagerClient(
556 scoped_ptr<LeadershipDaemonManagerClient> client) {
557 DBusThreadManager::Get()->client_bundle_->leadership_daemon_manager_client_ =
558 client.Pass();
561 void DBusThreadManagerSetter::SetLorgnetteManagerClient(
562 scoped_ptr<LorgnetteManagerClient> client) {
563 DBusThreadManager::Get()->client_bundle_->lorgnette_manager_client_ =
564 client.Pass();
567 void DBusThreadManagerSetter::SetMetronomeClient(
568 scoped_ptr<MetronomeClient> client) {
569 DBusThreadManager::Get()->client_bundle_->metronome_client_ = client.Pass();
572 void DBusThreadManagerSetter::SetShillDeviceClient(
573 scoped_ptr<ShillDeviceClient> client) {
574 DBusThreadManager::Get()->client_bundle_->shill_device_client_ =
575 client.Pass();
578 void DBusThreadManagerSetter::SetShillIPConfigClient(
579 scoped_ptr<ShillIPConfigClient> client) {
580 DBusThreadManager::Get()->client_bundle_->shill_ipconfig_client_ =
581 client.Pass();
584 void DBusThreadManagerSetter::SetShillManagerClient(
585 scoped_ptr<ShillManagerClient> client) {
586 DBusThreadManager::Get()->client_bundle_->shill_manager_client_ =
587 client.Pass();
590 void DBusThreadManagerSetter::SetShillServiceClient(
591 scoped_ptr<ShillServiceClient> client) {
592 DBusThreadManager::Get()->client_bundle_->shill_service_client_ =
593 client.Pass();
596 void DBusThreadManagerSetter::SetShillProfileClient(
597 scoped_ptr<ShillProfileClient> client) {
598 DBusThreadManager::Get()->client_bundle_->shill_profile_client_ =
599 client.Pass();
602 void DBusThreadManagerSetter::SetShillThirdPartyVpnDriverClient(
603 scoped_ptr<ShillThirdPartyVpnDriverClient> client) {
604 DBusThreadManager::Get()
605 ->client_bundle_->shill_third_party_vpn_driver_client_ = client.Pass();
608 void DBusThreadManagerSetter::SetGsmSMSClient(
609 scoped_ptr<GsmSMSClient> client) {
610 DBusThreadManager::Get()->client_bundle_->gsm_sms_client_ = client.Pass();
613 void DBusThreadManagerSetter::SetImageBurnerClient(
614 scoped_ptr<ImageBurnerClient> client) {
615 DBusThreadManager::Get()->client_bundle_->image_burner_client_ =
616 client.Pass();
619 void DBusThreadManagerSetter::SetIntrospectableClient(
620 scoped_ptr<IntrospectableClient> client) {
621 DBusThreadManager::Get()->client_bundle_->introspectable_client_ =
622 client.Pass();
625 void DBusThreadManagerSetter::SetModemMessagingClient(
626 scoped_ptr<ModemMessagingClient> client) {
627 DBusThreadManager::Get()->client_bundle_->modem_messaging_client_ =
628 client.Pass();
631 void DBusThreadManagerSetter::SetNfcAdapterClient(
632 scoped_ptr<NfcAdapterClient> client) {
633 DBusThreadManager::Get()->client_bundle_->nfc_adapter_client_ = client.Pass();
636 void DBusThreadManagerSetter::SetNfcDeviceClient(
637 scoped_ptr<NfcDeviceClient> client) {
638 DBusThreadManager::Get()->client_bundle_->nfc_device_client_ = client.Pass();
641 void DBusThreadManagerSetter::SetNfcManagerClient(
642 scoped_ptr<NfcManagerClient> client) {
643 DBusThreadManager::Get()->client_bundle_->nfc_manager_client_ = client.Pass();
646 void DBusThreadManagerSetter::SetNfcRecordClient(
647 scoped_ptr<NfcRecordClient> client) {
648 DBusThreadManager::Get()->client_bundle_->nfc_record_client_ = client.Pass();
651 void DBusThreadManagerSetter::SetNfcTagClient(
652 scoped_ptr<NfcTagClient> client) {
653 DBusThreadManager::Get()->client_bundle_->nfc_tag_client_ = client.Pass();
656 void DBusThreadManagerSetter::SetPeerDaemonManagerClient(
657 scoped_ptr<PeerDaemonManagerClient> client) {
658 DBusThreadManager::Get()->client_bundle_->peer_daemon_manager_client_ =
659 client.Pass();
662 void DBusThreadManagerSetter::SetPermissionBrokerClient(
663 scoped_ptr<PermissionBrokerClient> client) {
664 DBusThreadManager::Get()->client_bundle_->permission_broker_client_ =
665 client.Pass();
668 void DBusThreadManagerSetter::SetPrivetDaemonManagerClient(
669 scoped_ptr<PrivetDaemonManagerClient> client) {
670 DBusThreadManager::Get()->client_bundle_->privet_daemon_manager_client_ =
671 client.Pass();
674 void DBusThreadManagerSetter::SetPowerManagerClient(
675 scoped_ptr<PowerManagerClient> client) {
676 DBusThreadManager::Get()->client_bundle_->power_manager_client_ =
677 client.Pass();
680 void DBusThreadManagerSetter::SetSessionManagerClient(
681 scoped_ptr<SessionManagerClient> client) {
682 DBusThreadManager::Get()->client_bundle_->session_manager_client_ =
683 client.Pass();
686 void DBusThreadManagerSetter::SetSMSClient(scoped_ptr<SMSClient> client) {
687 DBusThreadManager::Get()->client_bundle_->sms_client_ = client.Pass();
690 void DBusThreadManagerSetter::SetSystemClockClient(
691 scoped_ptr<SystemClockClient> client) {
692 DBusThreadManager::Get()->client_bundle_->system_clock_client_ =
693 client.Pass();
696 void DBusThreadManagerSetter::SetUpdateEngineClient(
697 scoped_ptr<UpdateEngineClient> client) {
698 DBusThreadManager::Get()->client_bundle_->update_engine_client_ =
699 client.Pass();
702 } // namespace chromeos