Rewrite AndroidSyncSettings to be significantly simpler.
[chromium-blink-merge.git] / chromeos / dbus / dbus_thread_manager.cc
blob62f48f1d3909f0a06cafff1ad7dd610aef5d6f4b
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/bluetooth_adapter_client.h"
12 #include "chromeos/dbus/bluetooth_agent_manager_client.h"
13 #include "chromeos/dbus/bluetooth_device_client.h"
14 #include "chromeos/dbus/bluetooth_gatt_characteristic_client.h"
15 #include "chromeos/dbus/bluetooth_gatt_descriptor_client.h"
16 #include "chromeos/dbus/bluetooth_gatt_manager_client.h"
17 #include "chromeos/dbus/bluetooth_gatt_service_client.h"
18 #include "chromeos/dbus/bluetooth_input_client.h"
19 #include "chromeos/dbus/bluetooth_media_client.h"
20 #include "chromeos/dbus/bluetooth_media_transport_client.h"
21 #include "chromeos/dbus/bluetooth_profile_manager_client.h"
22 #include "chromeos/dbus/cras_audio_client.h"
23 #include "chromeos/dbus/cros_disks_client.h"
24 #include "chromeos/dbus/cryptohome_client.h"
25 #include "chromeos/dbus/dbus_client.h"
26 #include "chromeos/dbus/debug_daemon_client.h"
27 #include "chromeos/dbus/easy_unlock_client.h"
28 #include "chromeos/dbus/gsm_sms_client.h"
29 #include "chromeos/dbus/image_burner_client.h"
30 #include "chromeos/dbus/introspectable_client.h"
31 #include "chromeos/dbus/leadership_daemon_manager_client.h"
32 #include "chromeos/dbus/lorgnette_manager_client.h"
33 #include "chromeos/dbus/modem_messaging_client.h"
34 #include "chromeos/dbus/nfc_adapter_client.h"
35 #include "chromeos/dbus/nfc_device_client.h"
36 #include "chromeos/dbus/nfc_manager_client.h"
37 #include "chromeos/dbus/nfc_record_client.h"
38 #include "chromeos/dbus/nfc_tag_client.h"
39 #include "chromeos/dbus/peer_daemon_manager_client.h"
40 #include "chromeos/dbus/permission_broker_client.h"
41 #include "chromeos/dbus/power_manager_client.h"
42 #include "chromeos/dbus/session_manager_client.h"
43 #include "chromeos/dbus/shill_device_client.h"
44 #include "chromeos/dbus/shill_ipconfig_client.h"
45 #include "chromeos/dbus/shill_manager_client.h"
46 #include "chromeos/dbus/shill_profile_client.h"
47 #include "chromeos/dbus/shill_service_client.h"
48 #include "chromeos/dbus/shill_third_party_vpn_driver_client.h"
49 #include "chromeos/dbus/sms_client.h"
50 #include "chromeos/dbus/system_clock_client.h"
51 #include "chromeos/dbus/update_engine_client.h"
52 #include "dbus/bus.h"
53 #include "dbus/dbus_statistics.h"
55 namespace chromeos {
57 static DBusThreadManager* g_dbus_thread_manager = NULL;
58 static bool g_using_dbus_thread_manager_for_testing = false;
60 DBusThreadManager::DBusThreadManager(scoped_ptr<DBusClientBundle> client_bundle)
61 : client_bundle_(client_bundle.Pass()) {
62 dbus::statistics::Initialize();
64 if (client_bundle_->IsUsingAnyRealClient()) {
65 // At least one real DBusClient is used.
66 // Create the D-Bus thread.
67 base::Thread::Options thread_options;
68 thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
69 dbus_thread_.reset(new base::Thread("D-Bus thread"));
70 dbus_thread_->StartWithOptions(thread_options);
72 // Create the connection to the system bus.
73 dbus::Bus::Options system_bus_options;
74 system_bus_options.bus_type = dbus::Bus::SYSTEM;
75 system_bus_options.connection_type = dbus::Bus::PRIVATE;
76 system_bus_options.dbus_task_runner = dbus_thread_->message_loop_proxy();
77 system_bus_ = new dbus::Bus(system_bus_options);
81 DBusThreadManager::~DBusThreadManager() {
82 // Delete all D-Bus clients before shutting down the system bus.
83 client_bundle_.reset();
85 // Shut down the bus. During the browser shutdown, it's ok to shut down
86 // the bus synchronously.
87 if (system_bus_.get())
88 system_bus_->ShutdownOnDBusThreadAndBlock();
90 // Stop the D-Bus thread.
91 if (dbus_thread_)
92 dbus_thread_->Stop();
94 dbus::statistics::Shutdown();
96 if (!g_dbus_thread_manager)
97 return; // Called form Shutdown() or local test instance.
99 // There should never be both a global instance and a local instance.
100 CHECK(this == g_dbus_thread_manager);
101 if (g_using_dbus_thread_manager_for_testing) {
102 g_dbus_thread_manager = NULL;
103 g_using_dbus_thread_manager_for_testing = false;
104 VLOG(1) << "DBusThreadManager destroyed";
105 } else {
106 LOG(FATAL) << "~DBusThreadManager() called outside of Shutdown()";
110 dbus::Bus* DBusThreadManager::GetSystemBus() {
111 return system_bus_.get();
114 BluetoothAdapterClient* DBusThreadManager::GetBluetoothAdapterClient() {
115 return client_bundle_->bluetooth_adapter_client();
118 BluetoothAgentManagerClient*
119 DBusThreadManager::GetBluetoothAgentManagerClient() {
120 return client_bundle_->bluetooth_agent_manager_client();
123 BluetoothDeviceClient* DBusThreadManager::GetBluetoothDeviceClient() {
124 return client_bundle_->bluetooth_device_client();
127 BluetoothGattCharacteristicClient*
128 DBusThreadManager::GetBluetoothGattCharacteristicClient() {
129 return client_bundle_->bluetooth_gatt_characteristic_client();
132 BluetoothGattDescriptorClient*
133 DBusThreadManager::GetBluetoothGattDescriptorClient() {
134 return client_bundle_->bluetooth_gatt_descriptor_client();
137 BluetoothGattManagerClient*
138 DBusThreadManager::GetBluetoothGattManagerClient() {
139 return client_bundle_->bluetooth_gatt_manager_client();
142 BluetoothGattServiceClient*
143 DBusThreadManager::GetBluetoothGattServiceClient() {
144 return client_bundle_->bluetooth_gatt_service_client();
147 BluetoothInputClient* DBusThreadManager::GetBluetoothInputClient() {
148 return client_bundle_->bluetooth_input_client();
151 BluetoothMediaClient* DBusThreadManager::GetBluetoothMediaClient() {
152 return client_bundle_->bluetooth_media_client();
155 BluetoothMediaTransportClient*
156 DBusThreadManager::GetBluetoothMediaTransportClient() {
157 return client_bundle_->bluetooth_media_transport_client();
160 BluetoothProfileManagerClient*
161 DBusThreadManager::GetBluetoothProfileManagerClient() {
162 return client_bundle_->bluetooth_profile_manager_client();
165 CrasAudioClient* DBusThreadManager::GetCrasAudioClient() {
166 return client_bundle_->cras_audio_client();
169 CrosDisksClient* DBusThreadManager::GetCrosDisksClient() {
170 return client_bundle_->cros_disks_client();
173 CryptohomeClient* DBusThreadManager::GetCryptohomeClient() {
174 return client_bundle_->cryptohome_client();
177 DebugDaemonClient* DBusThreadManager::GetDebugDaemonClient() {
178 return client_bundle_->debug_daemon_client();
181 EasyUnlockClient* DBusThreadManager::GetEasyUnlockClient() {
182 return client_bundle_->easy_unlock_client();
185 LeadershipDaemonManagerClient*
186 DBusThreadManager::GetLeadershipDaemonManagerClient() {
187 return client_bundle_->leadership_daemon_manager_client();
190 LorgnetteManagerClient*
191 DBusThreadManager::GetLorgnetteManagerClient() {
192 return client_bundle_->lorgnette_manager_client();
195 ShillDeviceClient*
196 DBusThreadManager::GetShillDeviceClient() {
197 return client_bundle_->shill_device_client();
200 ShillIPConfigClient*
201 DBusThreadManager::GetShillIPConfigClient() {
202 return client_bundle_->shill_ipconfig_client();
205 ShillManagerClient*
206 DBusThreadManager::GetShillManagerClient() {
207 return client_bundle_->shill_manager_client();
210 ShillServiceClient*
211 DBusThreadManager::GetShillServiceClient() {
212 return client_bundle_->shill_service_client();
215 ShillProfileClient*
216 DBusThreadManager::GetShillProfileClient() {
217 return client_bundle_->shill_profile_client();
220 ShillThirdPartyVpnDriverClient*
221 DBusThreadManager::GetShillThirdPartyVpnDriverClient() {
222 return client_bundle_->shill_third_party_vpn_driver_client();
225 GsmSMSClient* DBusThreadManager::GetGsmSMSClient() {
226 return client_bundle_->gsm_sms_client();
229 ImageBurnerClient* DBusThreadManager::GetImageBurnerClient() {
230 return client_bundle_->image_burner_client();
233 IntrospectableClient* DBusThreadManager::GetIntrospectableClient() {
234 return client_bundle_->introspectable_client();
237 ModemMessagingClient* DBusThreadManager::GetModemMessagingClient() {
238 return client_bundle_->modem_messaging_client();
241 NfcAdapterClient* DBusThreadManager::GetNfcAdapterClient() {
242 return client_bundle_->nfc_adapter_client();
245 NfcDeviceClient* DBusThreadManager::GetNfcDeviceClient() {
246 return client_bundle_->nfc_device_client();
249 NfcManagerClient* DBusThreadManager::GetNfcManagerClient() {
250 return client_bundle_->nfc_manager_client();
253 NfcRecordClient* DBusThreadManager::GetNfcRecordClient() {
254 return client_bundle_->nfc_record_client();
257 NfcTagClient* DBusThreadManager::GetNfcTagClient() {
258 return client_bundle_->nfc_tag_client();
261 PeerDaemonManagerClient* DBusThreadManager::GetPeerDaemonManagerClient() {
262 return client_bundle_->peer_daemon_manager_client();
265 PermissionBrokerClient* DBusThreadManager::GetPermissionBrokerClient() {
266 return client_bundle_->permission_broker_client();
269 PowerManagerClient* DBusThreadManager::GetPowerManagerClient() {
270 return client_bundle_->power_manager_client();
273 SessionManagerClient* DBusThreadManager::GetSessionManagerClient() {
274 return client_bundle_->session_manager_client();
277 SMSClient* DBusThreadManager::GetSMSClient() {
278 return client_bundle_->sms_client();
281 SystemClockClient* DBusThreadManager::GetSystemClockClient() {
282 return client_bundle_->system_clock_client();
285 UpdateEngineClient* DBusThreadManager::GetUpdateEngineClient() {
286 return client_bundle_->update_engine_client();
289 void DBusThreadManager::InitializeClients() {
290 GetBluetoothAdapterClient()->Init(GetSystemBus());
291 GetBluetoothAgentManagerClient()->Init(GetSystemBus());
292 GetBluetoothDeviceClient()->Init(GetSystemBus());
293 GetBluetoothGattCharacteristicClient()->Init(GetSystemBus());
294 GetBluetoothGattDescriptorClient()->Init(GetSystemBus());
295 GetBluetoothGattManagerClient()->Init(GetSystemBus());
296 GetBluetoothGattServiceClient()->Init(GetSystemBus());
297 GetBluetoothInputClient()->Init(GetSystemBus());
298 GetBluetoothMediaClient()->Init(GetSystemBus());
299 GetBluetoothMediaTransportClient()->Init(GetSystemBus());
300 GetBluetoothProfileManagerClient()->Init(GetSystemBus());
301 GetCrasAudioClient()->Init(GetSystemBus());
302 GetCrosDisksClient()->Init(GetSystemBus());
303 GetCryptohomeClient()->Init(GetSystemBus());
304 GetDebugDaemonClient()->Init(GetSystemBus());
305 GetEasyUnlockClient()->Init(GetSystemBus());
306 GetGsmSMSClient()->Init(GetSystemBus());
307 GetImageBurnerClient()->Init(GetSystemBus());
308 GetIntrospectableClient()->Init(GetSystemBus());
309 GetLeadershipDaemonManagerClient()->Init(GetSystemBus());
310 GetLorgnetteManagerClient()->Init(GetSystemBus());
311 GetModemMessagingClient()->Init(GetSystemBus());
312 GetPermissionBrokerClient()->Init(GetSystemBus());
313 GetPeerDaemonManagerClient()->Init(GetSystemBus());
314 GetPowerManagerClient()->Init(GetSystemBus());
315 GetSessionManagerClient()->Init(GetSystemBus());
316 GetShillDeviceClient()->Init(GetSystemBus());
317 GetShillIPConfigClient()->Init(GetSystemBus());
318 GetShillManagerClient()->Init(GetSystemBus());
319 GetShillServiceClient()->Init(GetSystemBus());
320 GetShillProfileClient()->Init(GetSystemBus());
321 GetShillThirdPartyVpnDriverClient()->Init(GetSystemBus());
322 GetSMSClient()->Init(GetSystemBus());
323 GetSystemClockClient()->Init(GetSystemBus());
324 GetUpdateEngineClient()->Init(GetSystemBus());
326 // Initialize the NFC clients in the correct order. The order of
327 // initialization matters due to dependencies that exist between the
328 // client objects.
329 GetNfcManagerClient()->Init(GetSystemBus());
330 GetNfcAdapterClient()->Init(GetSystemBus());
331 GetNfcDeviceClient()->Init(GetSystemBus());
332 GetNfcTagClient()->Init(GetSystemBus());
333 GetNfcRecordClient()->Init(GetSystemBus());
335 // This must be called after the list of clients so they've each had a
336 // chance to register with their object g_dbus_thread_managers.
337 if (GetSystemBus())
338 GetSystemBus()->GetManagedObjects();
340 client_bundle_->SetupDefaultEnvironment();
343 bool DBusThreadManager::IsUsingStub(DBusClientBundle::DBusClientType client) {
344 return client_bundle_->IsUsingStub(client);
347 // static
348 void DBusThreadManager::Initialize() {
349 // If we initialize DBusThreadManager twice we may also be shutting it down
350 // early; do not allow that.
351 if (g_using_dbus_thread_manager_for_testing)
352 return;
354 CHECK(!g_dbus_thread_manager);
355 bool use_dbus_stub = !base::SysInfo::IsRunningOnChromeOS() ||
356 base::CommandLine::ForCurrentProcess()->HasSwitch(
357 chromeos::switches::kDbusStub);
358 bool force_unstub_clients = base::CommandLine::ForCurrentProcess()->HasSwitch(
359 chromeos::switches::kDbusUnstubClients);
360 // Determine whether we use stub or real client implementations.
361 if (force_unstub_clients) {
362 InitializeWithPartialStub(
363 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
364 chromeos::switches::kDbusUnstubClients));
365 } else if (use_dbus_stub) {
366 InitializeWithStubs();
367 } else {
368 InitializeWithRealClients();
372 // static
373 scoped_ptr<DBusThreadManagerSetter> DBusThreadManager::GetSetterForTesting() {
374 if (!g_using_dbus_thread_manager_for_testing) {
375 g_using_dbus_thread_manager_for_testing = true;
376 InitializeWithStubs();
379 return make_scoped_ptr(new DBusThreadManagerSetter());
382 // static
383 void DBusThreadManager::CreateGlobalInstance(
384 DBusClientBundle::DBusClientTypeMask unstub_client_mask) {
385 CHECK(!g_dbus_thread_manager);
386 g_dbus_thread_manager = new DBusThreadManager(
387 make_scoped_ptr(new DBusClientBundle(unstub_client_mask)));
388 g_dbus_thread_manager->InitializeClients();
391 // static
392 void DBusThreadManager::InitializeWithRealClients() {
393 CreateGlobalInstance(~static_cast<DBusClientBundle::DBusClientTypeMask>(0));
394 VLOG(1) << "DBusThreadManager initialized for Chrome OS";
397 // static
398 void DBusThreadManager::InitializeWithStubs() {
399 CreateGlobalInstance(0 /* unstub_client_mask */);
400 VLOG(1) << "DBusThreadManager created for testing";
403 // static
404 void DBusThreadManager::InitializeWithPartialStub(
405 const std::string& unstub_clients) {
406 DBusClientBundle::DBusClientTypeMask unstub_client_mask =
407 DBusClientBundle::ParseUnstubList(unstub_clients);
408 // We should have something parsed correctly here.
409 LOG_IF(FATAL, unstub_client_mask == 0)
410 << "Switch values for --" << chromeos::switches::kDbusUnstubClients
411 << " cannot be parsed: " << unstub_clients;
412 VLOG(1) << "DBusThreadManager initialized for mixed runtime environment";
413 CreateGlobalInstance(unstub_client_mask);
416 // static
417 bool DBusThreadManager::IsInitialized() {
418 return g_dbus_thread_manager != NULL;
421 // static
422 void DBusThreadManager::Shutdown() {
423 // Ensure that we only shutdown DBusThreadManager once.
424 CHECK(g_dbus_thread_manager);
425 DBusThreadManager* dbus_thread_manager = g_dbus_thread_manager;
426 g_dbus_thread_manager = NULL;
427 g_using_dbus_thread_manager_for_testing = false;
428 delete dbus_thread_manager;
429 VLOG(1) << "DBusThreadManager Shutdown completed";
432 // static
433 DBusThreadManager* DBusThreadManager::Get() {
434 CHECK(g_dbus_thread_manager)
435 << "DBusThreadManager::Get() called before Initialize()";
436 return g_dbus_thread_manager;
439 DBusThreadManagerSetter::DBusThreadManagerSetter() {
442 DBusThreadManagerSetter::~DBusThreadManagerSetter() {
445 void DBusThreadManagerSetter::SetBluetoothAdapterClient(
446 scoped_ptr<BluetoothAdapterClient> client) {
447 DBusThreadManager::Get()->client_bundle_->bluetooth_adapter_client_ =
448 client.Pass();
451 void DBusThreadManagerSetter::SetBluetoothAgentManagerClient(
452 scoped_ptr<BluetoothAgentManagerClient> client) {
453 DBusThreadManager::Get()->client_bundle_->bluetooth_agent_manager_client_ =
454 client.Pass();
457 void DBusThreadManagerSetter::SetBluetoothDeviceClient(
458 scoped_ptr<BluetoothDeviceClient> client) {
459 DBusThreadManager::Get()->client_bundle_->bluetooth_device_client_ =
460 client.Pass();
463 void DBusThreadManagerSetter::SetBluetoothGattCharacteristicClient(
464 scoped_ptr<BluetoothGattCharacteristicClient> client) {
465 DBusThreadManager::Get()->client_bundle_->
466 bluetooth_gatt_characteristic_client_ = client.Pass();
469 void DBusThreadManagerSetter::SetBluetoothGattDescriptorClient(
470 scoped_ptr<BluetoothGattDescriptorClient> client) {
471 DBusThreadManager::Get()->client_bundle_->bluetooth_gatt_descriptor_client_ =
472 client.Pass();
475 void DBusThreadManagerSetter::SetBluetoothGattManagerClient(
476 scoped_ptr<BluetoothGattManagerClient> client) {
477 DBusThreadManager::Get()->client_bundle_->bluetooth_gatt_manager_client_ =
478 client.Pass();
481 void DBusThreadManagerSetter::SetBluetoothGattServiceClient(
482 scoped_ptr<BluetoothGattServiceClient> client) {
483 DBusThreadManager::Get()->client_bundle_->bluetooth_gatt_service_client_ =
484 client.Pass();
487 void DBusThreadManagerSetter::SetBluetoothInputClient(
488 scoped_ptr<BluetoothInputClient> client) {
489 DBusThreadManager::Get()->client_bundle_->bluetooth_input_client_ =
490 client.Pass();
493 void DBusThreadManagerSetter::SetBluetoothMediaClient(
494 scoped_ptr<BluetoothMediaClient> client) {
495 DBusThreadManager::Get()->client_bundle_->bluetooth_media_client_ =
496 client.Pass();
499 void DBusThreadManagerSetter::SetBluetoothMediaTransportClient(
500 scoped_ptr<BluetoothMediaTransportClient> client) {
501 DBusThreadManager::Get()->client_bundle_->bluetooth_media_transport_client_ =
502 client.Pass();
505 void DBusThreadManagerSetter::SetBluetoothProfileManagerClient(
506 scoped_ptr<BluetoothProfileManagerClient> client) {
507 DBusThreadManager::Get()->client_bundle_->bluetooth_profile_manager_client_ =
508 client.Pass();
511 void DBusThreadManagerSetter::SetCrasAudioClient(
512 scoped_ptr<CrasAudioClient> client) {
513 DBusThreadManager::Get()->client_bundle_->cras_audio_client_ = client.Pass();
516 void DBusThreadManagerSetter::SetCrosDisksClient(
517 scoped_ptr<CrosDisksClient> client) {
518 DBusThreadManager::Get()->client_bundle_->cros_disks_client_ = client.Pass();
521 void DBusThreadManagerSetter::SetCryptohomeClient(
522 scoped_ptr<CryptohomeClient> client) {
523 DBusThreadManager::Get()->client_bundle_->cryptohome_client_ = client.Pass();
526 void DBusThreadManagerSetter::SetDebugDaemonClient(
527 scoped_ptr<DebugDaemonClient> client) {
528 DBusThreadManager::Get()->client_bundle_->debug_daemon_client_ =
529 client.Pass();
532 void DBusThreadManagerSetter::SetEasyUnlockClient(
533 scoped_ptr<EasyUnlockClient> client) {
534 DBusThreadManager::Get()->client_bundle_->easy_unlock_client_ = client.Pass();
537 void DBusThreadManagerSetter::SetLeadershipDaemonManagerClient(
538 scoped_ptr<LeadershipDaemonManagerClient> client) {
539 DBusThreadManager::Get()->client_bundle_->leadership_daemon_manager_client_ =
540 client.Pass();
543 void DBusThreadManagerSetter::SetLorgnetteManagerClient(
544 scoped_ptr<LorgnetteManagerClient> client) {
545 DBusThreadManager::Get()->client_bundle_->lorgnette_manager_client_ =
546 client.Pass();
549 void DBusThreadManagerSetter::SetShillDeviceClient(
550 scoped_ptr<ShillDeviceClient> client) {
551 DBusThreadManager::Get()->client_bundle_->shill_device_client_ =
552 client.Pass();
555 void DBusThreadManagerSetter::SetShillIPConfigClient(
556 scoped_ptr<ShillIPConfigClient> client) {
557 DBusThreadManager::Get()->client_bundle_->shill_ipconfig_client_ =
558 client.Pass();
561 void DBusThreadManagerSetter::SetShillManagerClient(
562 scoped_ptr<ShillManagerClient> client) {
563 DBusThreadManager::Get()->client_bundle_->shill_manager_client_ =
564 client.Pass();
567 void DBusThreadManagerSetter::SetShillServiceClient(
568 scoped_ptr<ShillServiceClient> client) {
569 DBusThreadManager::Get()->client_bundle_->shill_service_client_ =
570 client.Pass();
573 void DBusThreadManagerSetter::SetShillProfileClient(
574 scoped_ptr<ShillProfileClient> client) {
575 DBusThreadManager::Get()->client_bundle_->shill_profile_client_ =
576 client.Pass();
579 void DBusThreadManagerSetter::SetGsmSMSClient(
580 scoped_ptr<GsmSMSClient> client) {
581 DBusThreadManager::Get()->client_bundle_->gsm_sms_client_ = client.Pass();
584 void DBusThreadManagerSetter::SetImageBurnerClient(
585 scoped_ptr<ImageBurnerClient> client) {
586 DBusThreadManager::Get()->client_bundle_->image_burner_client_ =
587 client.Pass();
590 void DBusThreadManagerSetter::SetIntrospectableClient(
591 scoped_ptr<IntrospectableClient> client) {
592 DBusThreadManager::Get()->client_bundle_->introspectable_client_ =
593 client.Pass();
596 void DBusThreadManagerSetter::SetModemMessagingClient(
597 scoped_ptr<ModemMessagingClient> client) {
598 DBusThreadManager::Get()->client_bundle_->modem_messaging_client_ =
599 client.Pass();
602 void DBusThreadManagerSetter::SetNfcAdapterClient(
603 scoped_ptr<NfcAdapterClient> client) {
604 DBusThreadManager::Get()->client_bundle_->nfc_adapter_client_ = client.Pass();
607 void DBusThreadManagerSetter::SetNfcDeviceClient(
608 scoped_ptr<NfcDeviceClient> client) {
609 DBusThreadManager::Get()->client_bundle_->nfc_device_client_ = client.Pass();
612 void DBusThreadManagerSetter::SetNfcManagerClient(
613 scoped_ptr<NfcManagerClient> client) {
614 DBusThreadManager::Get()->client_bundle_->nfc_manager_client_ = client.Pass();
617 void DBusThreadManagerSetter::SetNfcRecordClient(
618 scoped_ptr<NfcRecordClient> client) {
619 DBusThreadManager::Get()->client_bundle_->nfc_record_client_ = client.Pass();
622 void DBusThreadManagerSetter::SetNfcTagClient(
623 scoped_ptr<NfcTagClient> client) {
624 DBusThreadManager::Get()->client_bundle_->nfc_tag_client_ = client.Pass();
627 void DBusThreadManagerSetter::SetPeerDaemonManagerClient(
628 scoped_ptr<PeerDaemonManagerClient> client) {
629 DBusThreadManager::Get()->client_bundle_->peer_daemon_manager_client_ =
630 client.Pass();
633 void DBusThreadManagerSetter::SetPermissionBrokerClient(
634 scoped_ptr<PermissionBrokerClient> client) {
635 DBusThreadManager::Get()->client_bundle_->permission_broker_client_ =
636 client.Pass();
639 void DBusThreadManagerSetter::SetPowerManagerClient(
640 scoped_ptr<PowerManagerClient> client) {
641 DBusThreadManager::Get()->client_bundle_->power_manager_client_ =
642 client.Pass();
645 void DBusThreadManagerSetter::SetSessionManagerClient(
646 scoped_ptr<SessionManagerClient> client) {
647 DBusThreadManager::Get()->client_bundle_->session_manager_client_ =
648 client.Pass();
651 void DBusThreadManagerSetter::SetSMSClient(scoped_ptr<SMSClient> client) {
652 DBusThreadManager::Get()->client_bundle_->sms_client_ = client.Pass();
655 void DBusThreadManagerSetter::SetSystemClockClient(
656 scoped_ptr<SystemClockClient> client) {
657 DBusThreadManager::Get()->client_bundle_->system_clock_client_ =
658 client.Pass();
661 void DBusThreadManagerSetter::SetUpdateEngineClient(
662 scoped_ptr<UpdateEngineClient> client) {
663 DBusThreadManager::Get()->client_bundle_->update_engine_client_ =
664 client.Pass();
667 } // namespace chromeos