Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(630)

Side by Side Diff: chromeos/dbus/dbus_thread_manager.cc

Issue 1347193004: Refactor DBusThreadManager to split away BT clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos/dbus/dbus_thread_manager.h ('k') | chromeos/dbus/fake_bluetooth_adapter_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/dbus/dbus_thread_manager.h" 5 #include "chromeos/dbus/dbus_thread_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/sys_info.h" 8 #include "base/sys_info.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "chromeos/chromeos_switches.h" 10 #include "chromeos/chromeos_switches.h"
11 #include "chromeos/dbus/amplifier_client.h" 11 #include "chromeos/dbus/amplifier_client.h"
12 #include "chromeos/dbus/ap_manager_client.h" 12 #include "chromeos/dbus/ap_manager_client.h"
13 #include "chromeos/dbus/audio_dsp_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" 14 #include "chromeos/dbus/cras_audio_client.h"
27 #include "chromeos/dbus/cros_disks_client.h" 15 #include "chromeos/dbus/cros_disks_client.h"
28 #include "chromeos/dbus/cryptohome_client.h" 16 #include "chromeos/dbus/cryptohome_client.h"
29 #include "chromeos/dbus/dbus_client.h" 17 #include "chromeos/dbus/dbus_client.h"
30 #include "chromeos/dbus/debug_daemon_client.h" 18 #include "chromeos/dbus/debug_daemon_client.h"
31 #include "chromeos/dbus/easy_unlock_client.h" 19 #include "chromeos/dbus/easy_unlock_client.h"
32 #include "chromeos/dbus/gsm_sms_client.h" 20 #include "chromeos/dbus/gsm_sms_client.h"
33 #include "chromeos/dbus/image_burner_client.h" 21 #include "chromeos/dbus/image_burner_client.h"
34 #include "chromeos/dbus/introspectable_client.h" 22 #include "chromeos/dbus/introspectable_client.h"
35 #include "chromeos/dbus/lorgnette_manager_client.h" 23 #include "chromeos/dbus/lorgnette_manager_client.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 108 }
121 109
122 ApManagerClient* DBusThreadManager::GetApManagerClient() { 110 ApManagerClient* DBusThreadManager::GetApManagerClient() {
123 return client_bundle_->ap_manager_client(); 111 return client_bundle_->ap_manager_client();
124 } 112 }
125 113
126 AudioDspClient* DBusThreadManager::GetAudioDspClient() { 114 AudioDspClient* DBusThreadManager::GetAudioDspClient() {
127 return client_bundle_->audio_dsp_client(); 115 return client_bundle_->audio_dsp_client();
128 } 116 }
129 117
130 BluetoothAdapterClient* DBusThreadManager::GetBluetoothAdapterClient() {
131 return client_bundle_->bluetooth_adapter_client();
132 }
133
134 BluetoothLEAdvertisingManagerClient*
135 DBusThreadManager::GetBluetoothLEAdvertisingManagerClient() {
136 return client_bundle_->bluetooth_le_advertising_manager_client();
137 }
138
139 BluetoothAgentManagerClient*
140 DBusThreadManager::GetBluetoothAgentManagerClient() {
141 return client_bundle_->bluetooth_agent_manager_client();
142 }
143
144 BluetoothDeviceClient* DBusThreadManager::GetBluetoothDeviceClient() {
145 return client_bundle_->bluetooth_device_client();
146 }
147
148 BluetoothGattCharacteristicClient*
149 DBusThreadManager::GetBluetoothGattCharacteristicClient() {
150 return client_bundle_->bluetooth_gatt_characteristic_client();
151 }
152
153 BluetoothGattDescriptorClient*
154 DBusThreadManager::GetBluetoothGattDescriptorClient() {
155 return client_bundle_->bluetooth_gatt_descriptor_client();
156 }
157
158 BluetoothGattManagerClient*
159 DBusThreadManager::GetBluetoothGattManagerClient() {
160 return client_bundle_->bluetooth_gatt_manager_client();
161 }
162
163 BluetoothGattServiceClient*
164 DBusThreadManager::GetBluetoothGattServiceClient() {
165 return client_bundle_->bluetooth_gatt_service_client();
166 }
167
168 BluetoothInputClient* DBusThreadManager::GetBluetoothInputClient() {
169 return client_bundle_->bluetooth_input_client();
170 }
171
172 BluetoothMediaClient* DBusThreadManager::GetBluetoothMediaClient() {
173 return client_bundle_->bluetooth_media_client();
174 }
175
176 BluetoothMediaTransportClient*
177 DBusThreadManager::GetBluetoothMediaTransportClient() {
178 return client_bundle_->bluetooth_media_transport_client();
179 }
180
181 BluetoothProfileManagerClient*
182 DBusThreadManager::GetBluetoothProfileManagerClient() {
183 return client_bundle_->bluetooth_profile_manager_client();
184 }
185
186 CrasAudioClient* DBusThreadManager::GetCrasAudioClient() { 118 CrasAudioClient* DBusThreadManager::GetCrasAudioClient() {
187 return client_bundle_->cras_audio_client(); 119 return client_bundle_->cras_audio_client();
188 } 120 }
189 121
190 CrosDisksClient* DBusThreadManager::GetCrosDisksClient() { 122 CrosDisksClient* DBusThreadManager::GetCrosDisksClient() {
191 return client_bundle_->cros_disks_client(); 123 return client_bundle_->cros_disks_client();
192 } 124 }
193 125
194 CryptohomeClient* DBusThreadManager::GetCryptohomeClient() { 126 CryptohomeClient* DBusThreadManager::GetCryptohomeClient() {
195 return client_bundle_->cryptohome_client(); 127 return client_bundle_->cryptohome_client();
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 } 235 }
304 236
305 UpdateEngineClient* DBusThreadManager::GetUpdateEngineClient() { 237 UpdateEngineClient* DBusThreadManager::GetUpdateEngineClient() {
306 return client_bundle_->update_engine_client(); 238 return client_bundle_->update_engine_client();
307 } 239 }
308 240
309 void DBusThreadManager::InitializeClients() { 241 void DBusThreadManager::InitializeClients() {
310 GetAmplifierClient()->Init(GetSystemBus()); 242 GetAmplifierClient()->Init(GetSystemBus());
311 GetApManagerClient()->Init(GetSystemBus()); 243 GetApManagerClient()->Init(GetSystemBus());
312 GetAudioDspClient()->Init(GetSystemBus()); 244 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()); 245 GetCrasAudioClient()->Init(GetSystemBus());
326 GetCrosDisksClient()->Init(GetSystemBus()); 246 GetCrosDisksClient()->Init(GetSystemBus());
327 GetCryptohomeClient()->Init(GetSystemBus()); 247 GetCryptohomeClient()->Init(GetSystemBus());
328 GetDebugDaemonClient()->Init(GetSystemBus()); 248 GetDebugDaemonClient()->Init(GetSystemBus());
329 GetEasyUnlockClient()->Init(GetSystemBus()); 249 GetEasyUnlockClient()->Init(GetSystemBus());
330 GetGsmSMSClient()->Init(GetSystemBus()); 250 GetGsmSMSClient()->Init(GetSystemBus());
331 GetImageBurnerClient()->Init(GetSystemBus()); 251 GetImageBurnerClient()->Init(GetSystemBus());
332 GetIntrospectableClient()->Init(GetSystemBus()); 252 GetIntrospectableClient()->Init(GetSystemBus());
333 GetLorgnetteManagerClient()->Init(GetSystemBus()); 253 GetLorgnetteManagerClient()->Init(GetSystemBus());
334 GetModemMessagingClient()->Init(GetSystemBus()); 254 GetModemMessagingClient()->Init(GetSystemBus());
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 void DBusThreadManagerSetter::SetAmplifierClient( 389 void DBusThreadManagerSetter::SetAmplifierClient(
470 scoped_ptr<AmplifierClient> client) { 390 scoped_ptr<AmplifierClient> client) {
471 DBusThreadManager::Get()->client_bundle_->amplifier_client_ = client.Pass(); 391 DBusThreadManager::Get()->client_bundle_->amplifier_client_ = client.Pass();
472 } 392 }
473 393
474 void DBusThreadManagerSetter::SetAudioDspClient( 394 void DBusThreadManagerSetter::SetAudioDspClient(
475 scoped_ptr<AudioDspClient> client) { 395 scoped_ptr<AudioDspClient> client) {
476 DBusThreadManager::Get()->client_bundle_->audio_dsp_client_ = client.Pass(); 396 DBusThreadManager::Get()->client_bundle_->audio_dsp_client_ = client.Pass();
477 } 397 }
478 398
479 void DBusThreadManagerSetter::SetBluetoothAdapterClient(
480 scoped_ptr<BluetoothAdapterClient> client) {
481 DBusThreadManager::Get()->client_bundle_->bluetooth_adapter_client_ =
482 client.Pass();
483 }
484
485 void DBusThreadManagerSetter::SetBluetoothLEAdvertisingManagerClient(
486 scoped_ptr<BluetoothLEAdvertisingManagerClient> client) {
487 DBusThreadManager::Get()->client_bundle_->
488 bluetooth_le_advertising_manager_client_ = client.Pass();
489 }
490
491 void DBusThreadManagerSetter::SetBluetoothAgentManagerClient(
492 scoped_ptr<BluetoothAgentManagerClient> client) {
493 DBusThreadManager::Get()->client_bundle_->bluetooth_agent_manager_client_ =
494 client.Pass();
495 }
496
497 void DBusThreadManagerSetter::SetBluetoothDeviceClient(
498 scoped_ptr<BluetoothDeviceClient> client) {
499 DBusThreadManager::Get()->client_bundle_->bluetooth_device_client_ =
500 client.Pass();
501 }
502
503 void DBusThreadManagerSetter::SetBluetoothGattCharacteristicClient(
504 scoped_ptr<BluetoothGattCharacteristicClient> client) {
505 DBusThreadManager::Get()->client_bundle_->
506 bluetooth_gatt_characteristic_client_ = client.Pass();
507 }
508
509 void DBusThreadManagerSetter::SetBluetoothGattDescriptorClient(
510 scoped_ptr<BluetoothGattDescriptorClient> client) {
511 DBusThreadManager::Get()->client_bundle_->bluetooth_gatt_descriptor_client_ =
512 client.Pass();
513 }
514
515 void DBusThreadManagerSetter::SetBluetoothGattManagerClient(
516 scoped_ptr<BluetoothGattManagerClient> client) {
517 DBusThreadManager::Get()->client_bundle_->bluetooth_gatt_manager_client_ =
518 client.Pass();
519 }
520
521 void DBusThreadManagerSetter::SetBluetoothGattServiceClient(
522 scoped_ptr<BluetoothGattServiceClient> client) {
523 DBusThreadManager::Get()->client_bundle_->bluetooth_gatt_service_client_ =
524 client.Pass();
525 }
526
527 void DBusThreadManagerSetter::SetBluetoothInputClient(
528 scoped_ptr<BluetoothInputClient> client) {
529 DBusThreadManager::Get()->client_bundle_->bluetooth_input_client_ =
530 client.Pass();
531 }
532
533 void DBusThreadManagerSetter::SetBluetoothMediaClient(
534 scoped_ptr<BluetoothMediaClient> client) {
535 DBusThreadManager::Get()->client_bundle_->bluetooth_media_client_ =
536 client.Pass();
537 }
538
539 void DBusThreadManagerSetter::SetBluetoothMediaTransportClient(
540 scoped_ptr<BluetoothMediaTransportClient> client) {
541 DBusThreadManager::Get()->client_bundle_->bluetooth_media_transport_client_ =
542 client.Pass();
543 }
544
545 void DBusThreadManagerSetter::SetBluetoothProfileManagerClient(
546 scoped_ptr<BluetoothProfileManagerClient> client) {
547 DBusThreadManager::Get()->client_bundle_->bluetooth_profile_manager_client_ =
548 client.Pass();
549 }
550
551 void DBusThreadManagerSetter::SetCrasAudioClient( 399 void DBusThreadManagerSetter::SetCrasAudioClient(
552 scoped_ptr<CrasAudioClient> client) { 400 scoped_ptr<CrasAudioClient> client) {
553 DBusThreadManager::Get()->client_bundle_->cras_audio_client_ = client.Pass(); 401 DBusThreadManager::Get()->client_bundle_->cras_audio_client_ = client.Pass();
554 } 402 }
555 403
556 void DBusThreadManagerSetter::SetCrosDisksClient( 404 void DBusThreadManagerSetter::SetCrosDisksClient(
557 scoped_ptr<CrosDisksClient> client) { 405 scoped_ptr<CrosDisksClient> client) {
558 DBusThreadManager::Get()->client_bundle_->cros_disks_client_ = client.Pass(); 406 DBusThreadManager::Get()->client_bundle_->cros_disks_client_ = client.Pass();
559 } 407 }
560 408
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 client.Pass(); 552 client.Pass();
705 } 553 }
706 554
707 void DBusThreadManagerSetter::SetUpdateEngineClient( 555 void DBusThreadManagerSetter::SetUpdateEngineClient(
708 scoped_ptr<UpdateEngineClient> client) { 556 scoped_ptr<UpdateEngineClient> client) {
709 DBusThreadManager::Get()->client_bundle_->update_engine_client_ = 557 DBusThreadManager::Get()->client_bundle_->update_engine_client_ =
710 client.Pass(); 558 client.Pass();
711 } 559 }
712 560
713 } // namespace chromeos 561 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/dbus_thread_manager.h ('k') | chromeos/dbus/fake_bluetooth_adapter_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698