Remove ExtensionPrefs::SetDidExtensionEscalatePermissions.
[chromium-blink-merge.git] / chromeos / dbus / dbus_thread_manager.cc
blobaafb25d7171131de9b708a98b32b17308cc4c75c
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/leadership_daemon_manager_client.h"
36 #include "chromeos/dbus/lorgnette_manager_client.h"
37 #include "chromeos/dbus/metronome_client.h"
38 #include "chromeos/dbus/modem_messaging_client.h"
39 #include "chromeos/dbus/nfc_adapter_client.h"
40 #include "chromeos/dbus/nfc_device_client.h"
41 #include "chromeos/dbus/nfc_manager_client.h"
42 #include "chromeos/dbus/nfc_record_client.h"
43 #include "chromeos/dbus/nfc_tag_client.h"
44 #include "chromeos/dbus/peer_daemon_manager_client.h"
45 #include "chromeos/dbus/permission_broker_client.h"
46 #include "chromeos/dbus/power_manager_client.h"
47 #include "chromeos/dbus/privet_daemon_manager_client.h"
48 #include "chromeos/dbus/session_manager_client.h"
49 #include "chromeos/dbus/shill_device_client.h"
50 #include "chromeos/dbus/shill_ipconfig_client.h"
51 #include "chromeos/dbus/shill_manager_client.h"
52 #include "chromeos/dbus/shill_profile_client.h"
53 #include "chromeos/dbus/shill_service_client.h"
54 #include "chromeos/dbus/shill_third_party_vpn_driver_client.h"
55 #include "chromeos/dbus/sms_client.h"
56 #include "chromeos/dbus/system_clock_client.h"
57 #include "chromeos/dbus/update_engine_client.h"
58 #include "dbus/bus.h"
59 #include "dbus/dbus_statistics.h"
61 namespace chromeos {
63 static DBusThreadManager* g_dbus_thread_manager = NULL;
64 static bool g_using_dbus_thread_manager_for_testing = false;
66 DBusThreadManager::DBusThreadManager(scoped_ptr<DBusClientBundle> client_bundle)
67 : client_bundle_(client_bundle.Pass()) {
68 dbus::statistics::Initialize();
70 if (client_bundle_->IsUsingAnyRealClient()) {
71 // At least one real DBusClient is used.
72 // Create the D-Bus thread.
73 base::Thread::Options thread_options;
74 thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
75 dbus_thread_.reset(new base::Thread("D-Bus thread"));
76 dbus_thread_->StartWithOptions(thread_options);
78 // Create the connection to the system bus.
79 dbus::Bus::Options system_bus_options;
80 system_bus_options.bus_type = dbus::Bus::SYSTEM;
81 system_bus_options.connection_type = dbus::Bus::PRIVATE;
82 system_bus_options.dbus_task_runner = dbus_thread_->message_loop_proxy();
83 system_bus_ = new dbus::Bus(system_bus_options);
87 DBusThreadManager::~DBusThreadManager() {
88 // Delete all D-Bus clients before shutting down the system bus.
89 client_bundle_.reset();
91 // Shut down the bus. During the browser shutdown, it's ok to shut down
92 // the bus synchronously.
93 if (system_bus_.get())
94 system_bus_->ShutdownOnDBusThreadAndBlock();
96 // Stop the D-Bus thread.
97 if (dbus_thread_)
98 dbus_thread_->Stop();
100 dbus::statistics::Shutdown();
102 if (!g_dbus_thread_manager)
103 return; // Called form Shutdown() or local test instance.
105 // There should never be both a global instance and a local instance.
106 CHECK(this == g_dbus_thread_manager);
107 if (g_using_dbus_thread_manager_for_testing) {
108 g_dbus_thread_manager = NULL;
109 g_using_dbus_thread_manager_for_testing = false;
110 VLOG(1) << "DBusThreadManager destroyed";
111 } else {
112 LOG(FATAL) << "~DBusThreadManager() called outside of Shutdown()";
116 dbus::Bus* DBusThreadManager::GetSystemBus() {
117 return system_bus_.get();
120 AmplifierClient* DBusThreadManager::GetAmplifierClient() {
121 return client_bundle_->amplifier_client();
124 ApManagerClient* DBusThreadManager::GetApManagerClient() {
125 return client_bundle_->ap_manager_client();
128 AudioDspClient* DBusThreadManager::GetAudioDspClient() {
129 return client_bundle_->audio_dsp_client();
132 BluetoothAdapterClient* DBusThreadManager::GetBluetoothAdapterClient() {
133 return client_bundle_->bluetooth_adapter_client();
136 BluetoothLEAdvertisingManagerClient*
137 DBusThreadManager::GetBluetoothLEAdvertisingManagerClient() {
138 return client_bundle_->bluetooth_le_advertising_manager_client();
141 BluetoothAgentManagerClient*
142 DBusThreadManager::GetBluetoothAgentManagerClient() {
143 return client_bundle_->bluetooth_agent_manager_client();
146 BluetoothDeviceClient* DBusThreadManager::GetBluetoothDeviceClient() {
147 return client_bundle_->bluetooth_device_client();
150 BluetoothGattCharacteristicClient*
151 DBusThreadManager::GetBluetoothGattCharacteristicClient() {
152 return client_bundle_->bluetooth_gatt_characteristic_client();
155 BluetoothGattDescriptorClient*
156 DBusThreadManager::GetBluetoothGattDescriptorClient() {
157 return client_bundle_->bluetooth_gatt_descriptor_client();
160 BluetoothGattManagerClient*
161 DBusThreadManager::GetBluetoothGattManagerClient() {
162 return client_bundle_->bluetooth_gatt_manager_client();
165 BluetoothGattServiceClient*
166 DBusThreadManager::GetBluetoothGattServiceClient() {
167 return client_bundle_->bluetooth_gatt_service_client();
170 BluetoothInputClient* DBusThreadManager::GetBluetoothInputClient() {
171 return client_bundle_->bluetooth_input_client();
174 BluetoothMediaClient* DBusThreadManager::GetBluetoothMediaClient() {
175 return client_bundle_->bluetooth_media_client();
178 BluetoothMediaTransportClient*
179 DBusThreadManager::GetBluetoothMediaTransportClient() {
180 return client_bundle_->bluetooth_media_transport_client();
183 BluetoothProfileManagerClient*
184 DBusThreadManager::GetBluetoothProfileManagerClient() {
185 return client_bundle_->bluetooth_profile_manager_client();
188 CrasAudioClient* DBusThreadManager::GetCrasAudioClient() {
189 return client_bundle_->cras_audio_client();
192 CrosDisksClient* DBusThreadManager::GetCrosDisksClient() {
193 return client_bundle_->cros_disks_client();
196 CryptohomeClient* DBusThreadManager::GetCryptohomeClient() {
197 return client_bundle_->cryptohome_client();
200 DebugDaemonClient* DBusThreadManager::GetDebugDaemonClient() {
201 return client_bundle_->debug_daemon_client();
204 EasyUnlockClient* DBusThreadManager::GetEasyUnlockClient() {
205 return client_bundle_->easy_unlock_client();
208 LeadershipDaemonManagerClient*
209 DBusThreadManager::GetLeadershipDaemonManagerClient() {
210 return client_bundle_->leadership_daemon_manager_client();
213 LorgnetteManagerClient*
214 DBusThreadManager::GetLorgnetteManagerClient() {
215 return client_bundle_->lorgnette_manager_client();
218 MetronomeClient* DBusThreadManager::GetMetronomeClient() {
219 return client_bundle_->metronome_client();
222 ShillDeviceClient*
223 DBusThreadManager::GetShillDeviceClient() {
224 return client_bundle_->shill_device_client();
227 ShillIPConfigClient*
228 DBusThreadManager::GetShillIPConfigClient() {
229 return client_bundle_->shill_ipconfig_client();
232 ShillManagerClient*
233 DBusThreadManager::GetShillManagerClient() {
234 return client_bundle_->shill_manager_client();
237 ShillServiceClient*
238 DBusThreadManager::GetShillServiceClient() {
239 return client_bundle_->shill_service_client();
242 ShillProfileClient*
243 DBusThreadManager::GetShillProfileClient() {
244 return client_bundle_->shill_profile_client();
247 ShillThirdPartyVpnDriverClient*
248 DBusThreadManager::GetShillThirdPartyVpnDriverClient() {
249 return client_bundle_->shill_third_party_vpn_driver_client();
252 GsmSMSClient* DBusThreadManager::GetGsmSMSClient() {
253 return client_bundle_->gsm_sms_client();
256 ImageBurnerClient* DBusThreadManager::GetImageBurnerClient() {
257 return client_bundle_->image_burner_client();
260 IntrospectableClient* DBusThreadManager::GetIntrospectableClient() {
261 return client_bundle_->introspectable_client();
264 ModemMessagingClient* DBusThreadManager::GetModemMessagingClient() {
265 return client_bundle_->modem_messaging_client();
268 NfcAdapterClient* DBusThreadManager::GetNfcAdapterClient() {
269 return client_bundle_->nfc_adapter_client();
272 NfcDeviceClient* DBusThreadManager::GetNfcDeviceClient() {
273 return client_bundle_->nfc_device_client();
276 NfcManagerClient* DBusThreadManager::GetNfcManagerClient() {
277 return client_bundle_->nfc_manager_client();
280 NfcRecordClient* DBusThreadManager::GetNfcRecordClient() {
281 return client_bundle_->nfc_record_client();
284 NfcTagClient* DBusThreadManager::GetNfcTagClient() {
285 return client_bundle_->nfc_tag_client();
288 PeerDaemonManagerClient* DBusThreadManager::GetPeerDaemonManagerClient() {
289 return client_bundle_->peer_daemon_manager_client();
292 PermissionBrokerClient* DBusThreadManager::GetPermissionBrokerClient() {
293 return client_bundle_->permission_broker_client();
296 PowerManagerClient* DBusThreadManager::GetPowerManagerClient() {
297 return client_bundle_->power_manager_client();
300 PrivetDaemonManagerClient* DBusThreadManager::GetPrivetDaemonManagerClient() {
301 return client_bundle_->privet_daemon_manager_client();
304 SessionManagerClient* DBusThreadManager::GetSessionManagerClient() {
305 return client_bundle_->session_manager_client();
308 SMSClient* DBusThreadManager::GetSMSClient() {
309 return client_bundle_->sms_client();
312 SystemClockClient* DBusThreadManager::GetSystemClockClient() {
313 return client_bundle_->system_clock_client();
316 UpdateEngineClient* DBusThreadManager::GetUpdateEngineClient() {
317 return client_bundle_->update_engine_client();
320 void DBusThreadManager::InitializeClients() {
321 GetAmplifierClient()->Init(GetSystemBus());
322 GetApManagerClient()->Init(GetSystemBus());
323 GetAudioDspClient()->Init(GetSystemBus());
324 GetBluetoothAdapterClient()->Init(GetSystemBus());
325 GetBluetoothAgentManagerClient()->Init(GetSystemBus());
326 GetBluetoothDeviceClient()->Init(GetSystemBus());
327 GetBluetoothGattCharacteristicClient()->Init(GetSystemBus());
328 GetBluetoothGattDescriptorClient()->Init(GetSystemBus());
329 GetBluetoothGattManagerClient()->Init(GetSystemBus());
330 GetBluetoothGattServiceClient()->Init(GetSystemBus());
331 GetBluetoothInputClient()->Init(GetSystemBus());
332 GetBluetoothLEAdvertisingManagerClient()->Init(GetSystemBus());
333 GetBluetoothMediaClient()->Init(GetSystemBus());
334 GetBluetoothMediaTransportClient()->Init(GetSystemBus());
335 GetBluetoothProfileManagerClient()->Init(GetSystemBus());
336 GetCrasAudioClient()->Init(GetSystemBus());
337 GetCrosDisksClient()->Init(GetSystemBus());
338 GetCryptohomeClient()->Init(GetSystemBus());
339 GetDebugDaemonClient()->Init(GetSystemBus());
340 GetEasyUnlockClient()->Init(GetSystemBus());
341 GetGsmSMSClient()->Init(GetSystemBus());
342 GetImageBurnerClient()->Init(GetSystemBus());
343 GetIntrospectableClient()->Init(GetSystemBus());
344 GetLeadershipDaemonManagerClient()->Init(GetSystemBus());
345 GetLorgnetteManagerClient()->Init(GetSystemBus());
346 GetMetronomeClient()->Init(GetSystemBus());
347 GetModemMessagingClient()->Init(GetSystemBus());
348 GetPermissionBrokerClient()->Init(GetSystemBus());
349 GetPeerDaemonManagerClient()->Init(GetSystemBus());
350 GetPrivetDaemonManagerClient()->Init(GetSystemBus());
351 GetPowerManagerClient()->Init(GetSystemBus());
352 GetSessionManagerClient()->Init(GetSystemBus());
353 GetShillDeviceClient()->Init(GetSystemBus());
354 GetShillIPConfigClient()->Init(GetSystemBus());
355 GetShillManagerClient()->Init(GetSystemBus());
356 GetShillServiceClient()->Init(GetSystemBus());
357 GetShillProfileClient()->Init(GetSystemBus());
358 GetShillThirdPartyVpnDriverClient()->Init(GetSystemBus());
359 GetSMSClient()->Init(GetSystemBus());
360 GetSystemClockClient()->Init(GetSystemBus());
361 GetUpdateEngineClient()->Init(GetSystemBus());
363 // Initialize the NFC clients in the correct order. The order of
364 // initialization matters due to dependencies that exist between the
365 // client objects.
366 GetNfcManagerClient()->Init(GetSystemBus());
367 GetNfcAdapterClient()->Init(GetSystemBus());
368 GetNfcDeviceClient()->Init(GetSystemBus());
369 GetNfcTagClient()->Init(GetSystemBus());
370 GetNfcRecordClient()->Init(GetSystemBus());
372 // This must be called after the list of clients so they've each had a
373 // chance to register with their object g_dbus_thread_managers.
374 if (GetSystemBus())
375 GetSystemBus()->GetManagedObjects();
377 client_bundle_->SetupDefaultEnvironment();
380 bool DBusThreadManager::IsUsingStub(DBusClientBundle::DBusClientType client) {
381 return client_bundle_->IsUsingStub(client);
384 // static
385 void DBusThreadManager::Initialize() {
386 // If we initialize DBusThreadManager twice we may also be shutting it down
387 // early; do not allow that.
388 if (g_using_dbus_thread_manager_for_testing)
389 return;
391 CHECK(!g_dbus_thread_manager);
392 bool use_dbus_stub = !base::SysInfo::IsRunningOnChromeOS() ||
393 base::CommandLine::ForCurrentProcess()->HasSwitch(
394 chromeos::switches::kDbusStub);
395 bool force_unstub_clients = base::CommandLine::ForCurrentProcess()->HasSwitch(
396 chromeos::switches::kDbusUnstubClients);
397 // Determine whether we use stub or real client implementations.
398 if (force_unstub_clients) {
399 InitializeWithPartialStub(
400 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
401 chromeos::switches::kDbusUnstubClients));
402 } else if (use_dbus_stub) {
403 InitializeWithStubs();
404 } else {
405 InitializeWithRealClients();
409 // static
410 scoped_ptr<DBusThreadManagerSetter> DBusThreadManager::GetSetterForTesting() {
411 if (!g_using_dbus_thread_manager_for_testing) {
412 g_using_dbus_thread_manager_for_testing = true;
413 InitializeWithStubs();
416 return make_scoped_ptr(new DBusThreadManagerSetter());
419 // static
420 void DBusThreadManager::CreateGlobalInstance(
421 DBusClientBundle::DBusClientTypeMask unstub_client_mask) {
422 CHECK(!g_dbus_thread_manager);
423 g_dbus_thread_manager = new DBusThreadManager(
424 make_scoped_ptr(new DBusClientBundle(unstub_client_mask)));
425 g_dbus_thread_manager->InitializeClients();
428 // static
429 void DBusThreadManager::InitializeWithRealClients() {
430 CreateGlobalInstance(~static_cast<DBusClientBundle::DBusClientTypeMask>(0));
431 VLOG(1) << "DBusThreadManager initialized for Chrome OS";
434 // static
435 void DBusThreadManager::InitializeWithStubs() {
436 CreateGlobalInstance(0 /* unstub_client_mask */);
437 VLOG(1) << "DBusThreadManager created for testing";
440 // static
441 void DBusThreadManager::InitializeWithPartialStub(
442 const std::string& unstub_clients) {
443 DBusClientBundle::DBusClientTypeMask unstub_client_mask =
444 DBusClientBundle::ParseUnstubList(unstub_clients);
445 // We should have something parsed correctly here.
446 LOG_IF(FATAL, unstub_client_mask == 0)
447 << "Switch values for --" << chromeos::switches::kDbusUnstubClients
448 << " cannot be parsed: " << unstub_clients;
449 VLOG(1) << "DBusThreadManager initialized for mixed runtime environment";
450 CreateGlobalInstance(unstub_client_mask);
453 // static
454 bool DBusThreadManager::IsInitialized() {
455 return g_dbus_thread_manager != NULL;
458 // static
459 void DBusThreadManager::Shutdown() {
460 // Ensure that we only shutdown DBusThreadManager once.
461 CHECK(g_dbus_thread_manager);
462 DBusThreadManager* dbus_thread_manager = g_dbus_thread_manager;
463 g_dbus_thread_manager = NULL;
464 g_using_dbus_thread_manager_for_testing = false;
465 delete dbus_thread_manager;
466 VLOG(1) << "DBusThreadManager Shutdown completed";
469 // static
470 DBusThreadManager* DBusThreadManager::Get() {
471 CHECK(g_dbus_thread_manager)
472 << "DBusThreadManager::Get() called before Initialize()";
473 return g_dbus_thread_manager;
476 DBusThreadManagerSetter::DBusThreadManagerSetter() {
479 DBusThreadManagerSetter::~DBusThreadManagerSetter() {
482 void DBusThreadManagerSetter::SetAmplifierClient(
483 scoped_ptr<AmplifierClient> client) {
484 DBusThreadManager::Get()->client_bundle_->amplifier_client_ = client.Pass();
487 void DBusThreadManagerSetter::SetAudioDspClient(
488 scoped_ptr<AudioDspClient> client) {
489 DBusThreadManager::Get()->client_bundle_->audio_dsp_client_ = client.Pass();
492 void DBusThreadManagerSetter::SetBluetoothAdapterClient(
493 scoped_ptr<BluetoothAdapterClient> client) {
494 DBusThreadManager::Get()->client_bundle_->bluetooth_adapter_client_ =
495 client.Pass();
498 void DBusThreadManagerSetter::SetBluetoothLEAdvertisingManagerClient(
499 scoped_ptr<BluetoothLEAdvertisingManagerClient> client) {
500 DBusThreadManager::Get()->client_bundle_->
501 bluetooth_le_advertising_manager_client_ = client.Pass();
504 void DBusThreadManagerSetter::SetBluetoothAgentManagerClient(
505 scoped_ptr<BluetoothAgentManagerClient> client) {
506 DBusThreadManager::Get()->client_bundle_->bluetooth_agent_manager_client_ =
507 client.Pass();
510 void DBusThreadManagerSetter::SetBluetoothDeviceClient(
511 scoped_ptr<BluetoothDeviceClient> client) {
512 DBusThreadManager::Get()->client_bundle_->bluetooth_device_client_ =
513 client.Pass();
516 void DBusThreadManagerSetter::SetBluetoothGattCharacteristicClient(
517 scoped_ptr<BluetoothGattCharacteristicClient> client) {
518 DBusThreadManager::Get()->client_bundle_->
519 bluetooth_gatt_characteristic_client_ = client.Pass();
522 void DBusThreadManagerSetter::SetBluetoothGattDescriptorClient(
523 scoped_ptr<BluetoothGattDescriptorClient> client) {
524 DBusThreadManager::Get()->client_bundle_->bluetooth_gatt_descriptor_client_ =
525 client.Pass();
528 void DBusThreadManagerSetter::SetBluetoothGattManagerClient(
529 scoped_ptr<BluetoothGattManagerClient> client) {
530 DBusThreadManager::Get()->client_bundle_->bluetooth_gatt_manager_client_ =
531 client.Pass();
534 void DBusThreadManagerSetter::SetBluetoothGattServiceClient(
535 scoped_ptr<BluetoothGattServiceClient> client) {
536 DBusThreadManager::Get()->client_bundle_->bluetooth_gatt_service_client_ =
537 client.Pass();
540 void DBusThreadManagerSetter::SetBluetoothInputClient(
541 scoped_ptr<BluetoothInputClient> client) {
542 DBusThreadManager::Get()->client_bundle_->bluetooth_input_client_ =
543 client.Pass();
546 void DBusThreadManagerSetter::SetBluetoothMediaClient(
547 scoped_ptr<BluetoothMediaClient> client) {
548 DBusThreadManager::Get()->client_bundle_->bluetooth_media_client_ =
549 client.Pass();
552 void DBusThreadManagerSetter::SetBluetoothMediaTransportClient(
553 scoped_ptr<BluetoothMediaTransportClient> client) {
554 DBusThreadManager::Get()->client_bundle_->bluetooth_media_transport_client_ =
555 client.Pass();
558 void DBusThreadManagerSetter::SetBluetoothProfileManagerClient(
559 scoped_ptr<BluetoothProfileManagerClient> client) {
560 DBusThreadManager::Get()->client_bundle_->bluetooth_profile_manager_client_ =
561 client.Pass();
564 void DBusThreadManagerSetter::SetCrasAudioClient(
565 scoped_ptr<CrasAudioClient> client) {
566 DBusThreadManager::Get()->client_bundle_->cras_audio_client_ = client.Pass();
569 void DBusThreadManagerSetter::SetCrosDisksClient(
570 scoped_ptr<CrosDisksClient> client) {
571 DBusThreadManager::Get()->client_bundle_->cros_disks_client_ = client.Pass();
574 void DBusThreadManagerSetter::SetCryptohomeClient(
575 scoped_ptr<CryptohomeClient> client) {
576 DBusThreadManager::Get()->client_bundle_->cryptohome_client_ = client.Pass();
579 void DBusThreadManagerSetter::SetDebugDaemonClient(
580 scoped_ptr<DebugDaemonClient> client) {
581 DBusThreadManager::Get()->client_bundle_->debug_daemon_client_ =
582 client.Pass();
585 void DBusThreadManagerSetter::SetEasyUnlockClient(
586 scoped_ptr<EasyUnlockClient> client) {
587 DBusThreadManager::Get()->client_bundle_->easy_unlock_client_ = client.Pass();
590 void DBusThreadManagerSetter::SetLeadershipDaemonManagerClient(
591 scoped_ptr<LeadershipDaemonManagerClient> client) {
592 DBusThreadManager::Get()->client_bundle_->leadership_daemon_manager_client_ =
593 client.Pass();
596 void DBusThreadManagerSetter::SetLorgnetteManagerClient(
597 scoped_ptr<LorgnetteManagerClient> client) {
598 DBusThreadManager::Get()->client_bundle_->lorgnette_manager_client_ =
599 client.Pass();
602 void DBusThreadManagerSetter::SetMetronomeClient(
603 scoped_ptr<MetronomeClient> client) {
604 DBusThreadManager::Get()->client_bundle_->metronome_client_ = client.Pass();
607 void DBusThreadManagerSetter::SetShillDeviceClient(
608 scoped_ptr<ShillDeviceClient> client) {
609 DBusThreadManager::Get()->client_bundle_->shill_device_client_ =
610 client.Pass();
613 void DBusThreadManagerSetter::SetShillIPConfigClient(
614 scoped_ptr<ShillIPConfigClient> client) {
615 DBusThreadManager::Get()->client_bundle_->shill_ipconfig_client_ =
616 client.Pass();
619 void DBusThreadManagerSetter::SetShillManagerClient(
620 scoped_ptr<ShillManagerClient> client) {
621 DBusThreadManager::Get()->client_bundle_->shill_manager_client_ =
622 client.Pass();
625 void DBusThreadManagerSetter::SetShillServiceClient(
626 scoped_ptr<ShillServiceClient> client) {
627 DBusThreadManager::Get()->client_bundle_->shill_service_client_ =
628 client.Pass();
631 void DBusThreadManagerSetter::SetShillProfileClient(
632 scoped_ptr<ShillProfileClient> client) {
633 DBusThreadManager::Get()->client_bundle_->shill_profile_client_ =
634 client.Pass();
637 void DBusThreadManagerSetter::SetShillThirdPartyVpnDriverClient(
638 scoped_ptr<ShillThirdPartyVpnDriverClient> client) {
639 DBusThreadManager::Get()
640 ->client_bundle_->shill_third_party_vpn_driver_client_ = client.Pass();
643 void DBusThreadManagerSetter::SetGsmSMSClient(
644 scoped_ptr<GsmSMSClient> client) {
645 DBusThreadManager::Get()->client_bundle_->gsm_sms_client_ = client.Pass();
648 void DBusThreadManagerSetter::SetImageBurnerClient(
649 scoped_ptr<ImageBurnerClient> client) {
650 DBusThreadManager::Get()->client_bundle_->image_burner_client_ =
651 client.Pass();
654 void DBusThreadManagerSetter::SetIntrospectableClient(
655 scoped_ptr<IntrospectableClient> client) {
656 DBusThreadManager::Get()->client_bundle_->introspectable_client_ =
657 client.Pass();
660 void DBusThreadManagerSetter::SetModemMessagingClient(
661 scoped_ptr<ModemMessagingClient> client) {
662 DBusThreadManager::Get()->client_bundle_->modem_messaging_client_ =
663 client.Pass();
666 void DBusThreadManagerSetter::SetNfcAdapterClient(
667 scoped_ptr<NfcAdapterClient> client) {
668 DBusThreadManager::Get()->client_bundle_->nfc_adapter_client_ = client.Pass();
671 void DBusThreadManagerSetter::SetNfcDeviceClient(
672 scoped_ptr<NfcDeviceClient> client) {
673 DBusThreadManager::Get()->client_bundle_->nfc_device_client_ = client.Pass();
676 void DBusThreadManagerSetter::SetNfcManagerClient(
677 scoped_ptr<NfcManagerClient> client) {
678 DBusThreadManager::Get()->client_bundle_->nfc_manager_client_ = client.Pass();
681 void DBusThreadManagerSetter::SetNfcRecordClient(
682 scoped_ptr<NfcRecordClient> client) {
683 DBusThreadManager::Get()->client_bundle_->nfc_record_client_ = client.Pass();
686 void DBusThreadManagerSetter::SetNfcTagClient(
687 scoped_ptr<NfcTagClient> client) {
688 DBusThreadManager::Get()->client_bundle_->nfc_tag_client_ = client.Pass();
691 void DBusThreadManagerSetter::SetPeerDaemonManagerClient(
692 scoped_ptr<PeerDaemonManagerClient> client) {
693 DBusThreadManager::Get()->client_bundle_->peer_daemon_manager_client_ =
694 client.Pass();
697 void DBusThreadManagerSetter::SetPermissionBrokerClient(
698 scoped_ptr<PermissionBrokerClient> client) {
699 DBusThreadManager::Get()->client_bundle_->permission_broker_client_ =
700 client.Pass();
703 void DBusThreadManagerSetter::SetPrivetDaemonManagerClient(
704 scoped_ptr<PrivetDaemonManagerClient> client) {
705 DBusThreadManager::Get()->client_bundle_->privet_daemon_manager_client_ =
706 client.Pass();
709 void DBusThreadManagerSetter::SetPowerManagerClient(
710 scoped_ptr<PowerManagerClient> client) {
711 DBusThreadManager::Get()->client_bundle_->power_manager_client_ =
712 client.Pass();
715 void DBusThreadManagerSetter::SetSessionManagerClient(
716 scoped_ptr<SessionManagerClient> client) {
717 DBusThreadManager::Get()->client_bundle_->session_manager_client_ =
718 client.Pass();
721 void DBusThreadManagerSetter::SetSMSClient(scoped_ptr<SMSClient> client) {
722 DBusThreadManager::Get()->client_bundle_->sms_client_ = client.Pass();
725 void DBusThreadManagerSetter::SetSystemClockClient(
726 scoped_ptr<SystemClockClient> client) {
727 DBusThreadManager::Get()->client_bundle_->system_clock_client_ =
728 client.Pass();
731 void DBusThreadManagerSetter::SetUpdateEngineClient(
732 scoped_ptr<UpdateEngineClient> client) {
733 DBusThreadManager::Get()->client_bundle_->update_engine_client_ =
734 client.Pass();
737 } // namespace chromeos