| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_client_bundle.h" | 5 #include "chromeos/dbus/dbus_client_bundle.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "chromeos/chromeos_switches.h" | 10 #include "chromeos/chromeos_switches.h" |
| 11 #include "chromeos/dbus/bluetooth_adapter_client.h" | 11 #include "chromeos/dbus/bluetooth_adapter_client.h" |
| 12 #include "chromeos/dbus/bluetooth_agent_manager_client.h" | 12 #include "chromeos/dbus/bluetooth_agent_manager_client.h" |
| 13 #include "chromeos/dbus/bluetooth_device_client.h" | 13 #include "chromeos/dbus/bluetooth_device_client.h" |
| 14 #include "chromeos/dbus/bluetooth_gatt_characteristic_client.h" | 14 #include "chromeos/dbus/bluetooth_gatt_characteristic_client.h" |
| 15 #include "chromeos/dbus/bluetooth_gatt_descriptor_client.h" | 15 #include "chromeos/dbus/bluetooth_gatt_descriptor_client.h" |
| 16 #include "chromeos/dbus/bluetooth_gatt_manager_client.h" | 16 #include "chromeos/dbus/bluetooth_gatt_manager_client.h" |
| 17 #include "chromeos/dbus/bluetooth_gatt_service_client.h" | 17 #include "chromeos/dbus/bluetooth_gatt_service_client.h" |
| 18 #include "chromeos/dbus/bluetooth_input_client.h" | 18 #include "chromeos/dbus/bluetooth_input_client.h" |
| 19 #include "chromeos/dbus/bluetooth_profile_manager_client.h" | 19 #include "chromeos/dbus/bluetooth_profile_manager_client.h" |
| 20 #include "chromeos/dbus/cras_audio_client.h" | 20 #include "chromeos/dbus/cras_audio_client.h" |
| 21 #include "chromeos/dbus/cras_audio_client_stub_impl.h" | 21 #include "chromeos/dbus/cras_audio_client_stub_impl.h" |
| 22 #include "chromeos/dbus/cros_disks_client.h" | 22 #include "chromeos/dbus/cros_disks_client.h" |
| 23 #include "chromeos/dbus/cryptohome_client.h" | 23 #include "chromeos/dbus/cryptohome_client.h" |
| 24 #include "chromeos/dbus/dbus_thread_manager.h" | |
| 25 #include "chromeos/dbus/debug_daemon_client.h" | 24 #include "chromeos/dbus/debug_daemon_client.h" |
| 26 #include "chromeos/dbus/easy_unlock_client.h" | 25 #include "chromeos/dbus/easy_unlock_client.h" |
| 27 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" | 26 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" |
| 28 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h" | 27 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h" |
| 29 #include "chromeos/dbus/fake_bluetooth_device_client.h" | 28 #include "chromeos/dbus/fake_bluetooth_device_client.h" |
| 30 #include "chromeos/dbus/fake_bluetooth_gatt_characteristic_client.h" | 29 #include "chromeos/dbus/fake_bluetooth_gatt_characteristic_client.h" |
| 31 #include "chromeos/dbus/fake_bluetooth_gatt_descriptor_client.h" | 30 #include "chromeos/dbus/fake_bluetooth_gatt_descriptor_client.h" |
| 32 #include "chromeos/dbus/fake_bluetooth_gatt_manager_client.h" | 31 #include "chromeos/dbus/fake_bluetooth_gatt_manager_client.h" |
| 33 #include "chromeos/dbus/fake_bluetooth_gatt_service_client.h" | 32 #include "chromeos/dbus/fake_bluetooth_gatt_service_client.h" |
| 34 #include "chromeos/dbus/fake_bluetooth_input_client.h" | 33 #include "chromeos/dbus/fake_bluetooth_input_client.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 { "modem_messaging", DBusClientBundle::MODEM_MESSAGING }, | 99 { "modem_messaging", DBusClientBundle::MODEM_MESSAGING }, |
| 101 { "nfc", DBusClientBundle::NFC }, | 100 { "nfc", DBusClientBundle::NFC }, |
| 102 { "permission_broker", DBusClientBundle::PERMISSION_BROKER }, | 101 { "permission_broker", DBusClientBundle::PERMISSION_BROKER }, |
| 103 { "power_manager", DBusClientBundle::POWER_MANAGER }, | 102 { "power_manager", DBusClientBundle::POWER_MANAGER }, |
| 104 { "session_manager", DBusClientBundle::SESSION_MANAGER }, | 103 { "session_manager", DBusClientBundle::SESSION_MANAGER }, |
| 105 { "sms", DBusClientBundle::SMS }, | 104 { "sms", DBusClientBundle::SMS }, |
| 106 { "system_clock", DBusClientBundle::SYSTEM_CLOCK }, | 105 { "system_clock", DBusClientBundle::SYSTEM_CLOCK }, |
| 107 { "update_engine", DBusClientBundle::UPDATE_ENGINE }, | 106 { "update_engine", DBusClientBundle::UPDATE_ENGINE }, |
| 108 }; | 107 }; |
| 109 | 108 |
| 110 // Parses single command line param value for dbus subsystem and returns its | 109 // Parses single command line param value for dbus subsystem. If successful, |
| 111 // enum representation. DBusClientType::UNKWNOWN is returned if |client_type| | 110 // returns its enum representation. Otherwise returns NO_CLIENT. |
| 112 // does not match any known dbus client. | |
| 113 DBusClientBundle::DBusClientType GetDBusClientType( | 111 DBusClientBundle::DBusClientType GetDBusClientType( |
| 114 const std::string& client_type) { | 112 const std::string& client_type_name) { |
| 115 for (size_t i = 0; i < arraysize(client_type_map); i++) { | 113 for (size_t i = 0; i < arraysize(client_type_map); i++) { |
| 116 if (LowerCaseEqualsASCII(client_type, client_type_map[i].param_name)) | 114 if (LowerCaseEqualsASCII(client_type_name, client_type_map[i].param_name)) |
| 117 return client_type_map[i].client_type; | 115 return client_type_map[i].client_type; |
| 118 } | 116 } |
| 119 return DBusClientBundle::NO_CLIENTS; | 117 return DBusClientBundle::NO_CLIENT; |
| 120 } | 118 } |
| 121 | 119 |
| 122 } // namespace | 120 } // namespace |
| 123 | 121 |
| 124 DBusClientBundle::DBusClientBundle() { | 122 DBusClientBundle::DBusClientBundle(DBusClientTypeMask unstub_client_mask) |
| 125 if (!DBusThreadManager::IsUsingStub(BLUETOOTH)) { | 123 : unstub_client_mask_(unstub_client_mask) { |
| 124 if (!IsUsingStub(BLUETOOTH)) { |
| 126 bluetooth_adapter_client_.reset(BluetoothAdapterClient::Create()); | 125 bluetooth_adapter_client_.reset(BluetoothAdapterClient::Create()); |
| 127 bluetooth_agent_manager_client_.reset( | 126 bluetooth_agent_manager_client_.reset( |
| 128 BluetoothAgentManagerClient::Create()); | 127 BluetoothAgentManagerClient::Create()); |
| 129 bluetooth_device_client_.reset(BluetoothDeviceClient::Create()); | 128 bluetooth_device_client_.reset(BluetoothDeviceClient::Create()); |
| 130 bluetooth_input_client_.reset(BluetoothInputClient::Create()); | 129 bluetooth_input_client_.reset(BluetoothInputClient::Create()); |
| 131 bluetooth_profile_manager_client_.reset( | 130 bluetooth_profile_manager_client_.reset( |
| 132 BluetoothProfileManagerClient::Create()); | 131 BluetoothProfileManagerClient::Create()); |
| 133 bluetooth_gatt_characteristic_client_.reset( | 132 bluetooth_gatt_characteristic_client_.reset( |
| 134 BluetoothGattCharacteristicClient::Create()); | 133 BluetoothGattCharacteristicClient::Create()); |
| 135 bluetooth_gatt_descriptor_client_.reset( | 134 bluetooth_gatt_descriptor_client_.reset( |
| (...skipping 10 matching lines...) Expand all Loading... |
| 146 bluetooth_profile_manager_client_.reset( | 145 bluetooth_profile_manager_client_.reset( |
| 147 new FakeBluetoothProfileManagerClient); | 146 new FakeBluetoothProfileManagerClient); |
| 148 bluetooth_gatt_characteristic_client_.reset( | 147 bluetooth_gatt_characteristic_client_.reset( |
| 149 new FakeBluetoothGattCharacteristicClient); | 148 new FakeBluetoothGattCharacteristicClient); |
| 150 bluetooth_gatt_descriptor_client_.reset( | 149 bluetooth_gatt_descriptor_client_.reset( |
| 151 new FakeBluetoothGattDescriptorClient); | 150 new FakeBluetoothGattDescriptorClient); |
| 152 bluetooth_gatt_manager_client_.reset(new FakeBluetoothGattManagerClient); | 151 bluetooth_gatt_manager_client_.reset(new FakeBluetoothGattManagerClient); |
| 153 bluetooth_gatt_service_client_.reset(new FakeBluetoothGattServiceClient); | 152 bluetooth_gatt_service_client_.reset(new FakeBluetoothGattServiceClient); |
| 154 } | 153 } |
| 155 | 154 |
| 156 if (!DBusThreadManager::IsUsingStub(CRAS)) | 155 if (!IsUsingStub(CRAS)) |
| 157 cras_audio_client_.reset(CrasAudioClient::Create()); | 156 cras_audio_client_.reset(CrasAudioClient::Create()); |
| 158 else | 157 else |
| 159 cras_audio_client_.reset(new CrasAudioClientStubImpl); | 158 cras_audio_client_.reset(new CrasAudioClientStubImpl); |
| 160 | 159 |
| 161 cros_disks_client_.reset(CrosDisksClient::Create( | 160 cros_disks_client_.reset(CrosDisksClient::Create( |
| 162 DBusThreadManager::IsUsingStub(CROS_DISKS) ? | 161 IsUsingStub(CROS_DISKS) ? STUB_DBUS_CLIENT_IMPLEMENTATION |
| 163 STUB_DBUS_CLIENT_IMPLEMENTATION : | 162 : REAL_DBUS_CLIENT_IMPLEMENTATION)); |
| 164 REAL_DBUS_CLIENT_IMPLEMENTATION)); | |
| 165 | 163 |
| 166 if (!DBusThreadManager::IsUsingStub(CRYPTOHOME)) | 164 if (!IsUsingStub(CRYPTOHOME)) |
| 167 cryptohome_client_.reset(CryptohomeClient::Create()); | 165 cryptohome_client_.reset(CryptohomeClient::Create()); |
| 168 else | 166 else |
| 169 cryptohome_client_.reset(new FakeCryptohomeClient); | 167 cryptohome_client_.reset(new FakeCryptohomeClient); |
| 170 | 168 |
| 171 if (!DBusThreadManager::IsUsingStub(DEBUG_DAEMON)) | 169 if (!IsUsingStub(DEBUG_DAEMON)) |
| 172 debug_daemon_client_.reset(DebugDaemonClient::Create()); | 170 debug_daemon_client_.reset(DebugDaemonClient::Create()); |
| 173 else | 171 else |
| 174 debug_daemon_client_.reset(new FakeDebugDaemonClient); | 172 debug_daemon_client_.reset(new FakeDebugDaemonClient); |
| 175 | 173 |
| 176 if (!DBusThreadManager::IsUsingStub(EASY_UNLOCK)) | 174 if (!IsUsingStub(EASY_UNLOCK)) |
| 177 easy_unlock_client_.reset(EasyUnlockClient::Create()); | 175 easy_unlock_client_.reset(EasyUnlockClient::Create()); |
| 178 else | 176 else |
| 179 easy_unlock_client_.reset(new FakeEasyUnlockClient); | 177 easy_unlock_client_.reset(new FakeEasyUnlockClient); |
| 180 | 178 |
| 181 if (!DBusThreadManager::IsUsingStub(LORGNETTE_MANAGER)) | 179 if (!IsUsingStub(LORGNETTE_MANAGER)) |
| 182 lorgnette_manager_client_.reset(LorgnetteManagerClient::Create()); | 180 lorgnette_manager_client_.reset(LorgnetteManagerClient::Create()); |
| 183 else | 181 else |
| 184 lorgnette_manager_client_.reset(new FakeLorgnetteManagerClient); | 182 lorgnette_manager_client_.reset(new FakeLorgnetteManagerClient); |
| 185 | 183 |
| 186 if (!DBusThreadManager::IsUsingStub(SHILL)) { | 184 if (!IsUsingStub(SHILL)) { |
| 187 shill_manager_client_.reset(ShillManagerClient::Create()); | 185 shill_manager_client_.reset(ShillManagerClient::Create()); |
| 188 shill_device_client_.reset(ShillDeviceClient::Create()); | 186 shill_device_client_.reset(ShillDeviceClient::Create()); |
| 189 shill_ipconfig_client_.reset(ShillIPConfigClient::Create()); | 187 shill_ipconfig_client_.reset(ShillIPConfigClient::Create()); |
| 190 shill_service_client_.reset(ShillServiceClient::Create()); | 188 shill_service_client_.reset(ShillServiceClient::Create()); |
| 191 shill_profile_client_.reset(ShillProfileClient::Create()); | 189 shill_profile_client_.reset(ShillProfileClient::Create()); |
| 192 } else { | 190 } else { |
| 193 shill_manager_client_.reset(new FakeShillManagerClient); | 191 shill_manager_client_.reset(new FakeShillManagerClient); |
| 194 shill_device_client_.reset(new FakeShillDeviceClient); | 192 shill_device_client_.reset(new FakeShillDeviceClient); |
| 195 shill_ipconfig_client_.reset(new FakeShillIPConfigClient); | 193 shill_ipconfig_client_.reset(new FakeShillIPConfigClient); |
| 196 shill_service_client_.reset(new FakeShillServiceClient); | 194 shill_service_client_.reset(new FakeShillServiceClient); |
| 197 shill_profile_client_.reset(new FakeShillProfileClient); | 195 shill_profile_client_.reset(new FakeShillProfileClient); |
| 198 } | 196 } |
| 199 | 197 |
| 200 if (!DBusThreadManager::IsUsingStub(GSM_SMS)) { | 198 if (!IsUsingStub(GSM_SMS)) { |
| 201 gsm_sms_client_.reset(GsmSMSClient::Create()); | 199 gsm_sms_client_.reset(GsmSMSClient::Create()); |
| 202 } else { | 200 } else { |
| 203 FakeGsmSMSClient* gsm_sms_client = new FakeGsmSMSClient(); | 201 FakeGsmSMSClient* gsm_sms_client = new FakeGsmSMSClient(); |
| 204 gsm_sms_client->set_sms_test_message_switch_present( | 202 gsm_sms_client->set_sms_test_message_switch_present( |
| 205 CommandLine::ForCurrentProcess()->HasSwitch( | 203 CommandLine::ForCurrentProcess()->HasSwitch( |
| 206 chromeos::switches::kSmsTestMessages)); | 204 chromeos::switches::kSmsTestMessages)); |
| 207 gsm_sms_client_.reset(gsm_sms_client); | 205 gsm_sms_client_.reset(gsm_sms_client); |
| 208 } | 206 } |
| 209 | 207 |
| 210 if (!DBusThreadManager::IsUsingStub(IMAGE_BURNER)) | 208 if (!IsUsingStub(IMAGE_BURNER)) |
| 211 image_burner_client_.reset(ImageBurnerClient::Create()); | 209 image_burner_client_.reset(ImageBurnerClient::Create()); |
| 212 else | 210 else |
| 213 image_burner_client_.reset(new FakeImageBurnerClient); | 211 image_burner_client_.reset(new FakeImageBurnerClient); |
| 214 | 212 |
| 215 if (!DBusThreadManager::IsUsingStub(INTROSPECTABLE)) | 213 if (!IsUsingStub(INTROSPECTABLE)) |
| 216 introspectable_client_.reset(IntrospectableClient::Create()); | 214 introspectable_client_.reset(IntrospectableClient::Create()); |
| 217 else | 215 else |
| 218 introspectable_client_.reset(new FakeIntrospectableClient); | 216 introspectable_client_.reset(new FakeIntrospectableClient); |
| 219 | 217 |
| 220 if (!DBusThreadManager::IsUsingStub(MODEM_MESSAGING)) | 218 if (!IsUsingStub(MODEM_MESSAGING)) |
| 221 modem_messaging_client_.reset(ModemMessagingClient::Create()); | 219 modem_messaging_client_.reset(ModemMessagingClient::Create()); |
| 222 else | 220 else |
| 223 modem_messaging_client_.reset(new FakeModemMessagingClient); | 221 modem_messaging_client_.reset(new FakeModemMessagingClient); |
| 224 | 222 |
| 225 // Create the NFC clients in the correct order based on their dependencies. | 223 // Create the NFC clients in the correct order based on their dependencies. |
| 226 if (!DBusThreadManager::IsUsingStub(NFC)) { | 224 if (!IsUsingStub(NFC)) { |
| 227 nfc_manager_client_.reset(NfcManagerClient::Create()); | 225 nfc_manager_client_.reset(NfcManagerClient::Create()); |
| 228 nfc_adapter_client_.reset( | 226 nfc_adapter_client_.reset( |
| 229 NfcAdapterClient::Create(nfc_manager_client_.get())); | 227 NfcAdapterClient::Create(nfc_manager_client_.get())); |
| 230 nfc_device_client_.reset( | 228 nfc_device_client_.reset( |
| 231 NfcDeviceClient::Create(nfc_adapter_client_.get())); | 229 NfcDeviceClient::Create(nfc_adapter_client_.get())); |
| 232 nfc_tag_client_.reset(NfcTagClient::Create(nfc_adapter_client_.get())); | 230 nfc_tag_client_.reset(NfcTagClient::Create(nfc_adapter_client_.get())); |
| 233 nfc_record_client_.reset(NfcRecordClient::Create(nfc_device_client_.get(), | 231 nfc_record_client_.reset(NfcRecordClient::Create(nfc_device_client_.get(), |
| 234 nfc_tag_client_.get())); | 232 nfc_tag_client_.get())); |
| 235 } else { | 233 } else { |
| 236 nfc_manager_client_.reset(new FakeNfcManagerClient); | 234 nfc_manager_client_.reset(new FakeNfcManagerClient); |
| 237 nfc_adapter_client_.reset(new FakeNfcAdapterClient); | 235 nfc_adapter_client_.reset(new FakeNfcAdapterClient); |
| 238 nfc_device_client_.reset(new FakeNfcDeviceClient); | 236 nfc_device_client_.reset(new FakeNfcDeviceClient); |
| 239 nfc_tag_client_.reset(new FakeNfcTagClient); | 237 nfc_tag_client_.reset(new FakeNfcTagClient); |
| 240 nfc_record_client_.reset(new FakeNfcRecordClient); | 238 nfc_record_client_.reset(new FakeNfcRecordClient); |
| 241 } | 239 } |
| 242 | 240 |
| 243 if (!DBusThreadManager::IsUsingStub(PERMISSION_BROKER)) | 241 if (!IsUsingStub(PERMISSION_BROKER)) |
| 244 permission_broker_client_.reset(PermissionBrokerClient::Create()); | 242 permission_broker_client_.reset(PermissionBrokerClient::Create()); |
| 245 else | 243 else |
| 246 permission_broker_client_.reset(new FakePermissionBrokerClient); | 244 permission_broker_client_.reset(new FakePermissionBrokerClient); |
| 247 | 245 |
| 248 power_manager_client_.reset(PowerManagerClient::Create( | 246 power_manager_client_.reset(PowerManagerClient::Create( |
| 249 DBusThreadManager::IsUsingStub(POWER_MANAGER) ? | 247 IsUsingStub(POWER_MANAGER) ? STUB_DBUS_CLIENT_IMPLEMENTATION |
| 250 STUB_DBUS_CLIENT_IMPLEMENTATION : | 248 : REAL_DBUS_CLIENT_IMPLEMENTATION)); |
| 251 REAL_DBUS_CLIENT_IMPLEMENTATION)); | |
| 252 | 249 |
| 253 session_manager_client_.reset(SessionManagerClient::Create( | 250 session_manager_client_.reset(SessionManagerClient::Create( |
| 254 DBusThreadManager::IsUsingStub(SESSION_MANAGER) ? | 251 IsUsingStub(SESSION_MANAGER) ? STUB_DBUS_CLIENT_IMPLEMENTATION |
| 255 STUB_DBUS_CLIENT_IMPLEMENTATION : | 252 : REAL_DBUS_CLIENT_IMPLEMENTATION)); |
| 256 REAL_DBUS_CLIENT_IMPLEMENTATION)); | |
| 257 | 253 |
| 258 if (!DBusThreadManager::IsUsingStub(SMS)) | 254 if (!IsUsingStub(SMS)) |
| 259 sms_client_.reset(SMSClient::Create()); | 255 sms_client_.reset(SMSClient::Create()); |
| 260 else | 256 else |
| 261 sms_client_.reset(new FakeSMSClient); | 257 sms_client_.reset(new FakeSMSClient); |
| 262 | 258 |
| 263 if (!DBusThreadManager::IsUsingStub(SYSTEM_CLOCK)) | 259 if (!IsUsingStub(SYSTEM_CLOCK)) |
| 264 system_clock_client_.reset(SystemClockClient::Create()); | 260 system_clock_client_.reset(SystemClockClient::Create()); |
| 265 else | 261 else |
| 266 system_clock_client_.reset(new FakeSystemClockClient); | 262 system_clock_client_.reset(new FakeSystemClockClient); |
| 267 | 263 |
| 268 update_engine_client_.reset(UpdateEngineClient::Create( | 264 update_engine_client_.reset(UpdateEngineClient::Create( |
| 269 DBusThreadManager::IsUsingStub(UPDATE_ENGINE) ? | 265 IsUsingStub(UPDATE_ENGINE) ? STUB_DBUS_CLIENT_IMPLEMENTATION |
| 270 STUB_DBUS_CLIENT_IMPLEMENTATION : | 266 : REAL_DBUS_CLIENT_IMPLEMENTATION)); |
| 271 REAL_DBUS_CLIENT_IMPLEMENTATION)); | |
| 272 } | 267 } |
| 273 | 268 |
| 274 DBusClientBundle::~DBusClientBundle() { | 269 DBusClientBundle::~DBusClientBundle() { |
| 275 } | 270 } |
| 276 | 271 |
| 272 bool DBusClientBundle::IsUsingStub(DBusClientType client) { |
| 273 return !(unstub_client_mask_ & client); |
| 274 } |
| 275 |
| 276 bool DBusClientBundle::IsUsingAnyRealClient() { |
| 277 // 'Using any real client' is equivalent to 'Unstubbed any client'. |
| 278 return unstub_client_mask_ != 0; |
| 279 } |
| 280 |
| 277 void DBusClientBundle::SetupDefaultEnvironment() { | 281 void DBusClientBundle::SetupDefaultEnvironment() { |
| 278 ShillManagerClient::TestInterface* manager = | 282 ShillManagerClient::TestInterface* manager = |
| 279 shill_manager_client_->GetTestInterface(); | 283 shill_manager_client_->GetTestInterface(); |
| 280 if (manager) | 284 if (manager) |
| 281 manager->SetupDefaultEnvironment(); | 285 manager->SetupDefaultEnvironment(); |
| 282 } | 286 } |
| 283 | 287 |
| 284 // static | 288 // static |
| 285 DBusClientBundle::DBusClientTypeMask DBusClientBundle::ParseUnstubList( | 289 DBusClientBundle::DBusClientTypeMask DBusClientBundle::ParseUnstubList( |
| 286 const std::string& unstub_list) { | 290 const std::string& unstub_list) { |
| 287 DBusClientTypeMask unstub_mask = 0; | 291 DBusClientTypeMask unstub_mask = 0; |
| 288 std::vector<std::string> unstub_components; | 292 std::vector<std::string> unstub_components; |
| 289 base::SplitString(unstub_list, ',', &unstub_components); | 293 base::SplitString(unstub_list, ',', &unstub_components); |
| 290 for (std::vector<std::string>::const_iterator iter = | 294 for (std::vector<std::string>::const_iterator iter = |
| 291 unstub_components.begin(); | 295 unstub_components.begin(); |
| 292 iter != unstub_components.end(); ++iter) { | 296 iter != unstub_components.end(); ++iter) { |
| 293 DBusClientBundle::DBusClientType client = GetDBusClientType(*iter); | 297 DBusClientBundle::DBusClientType client = GetDBusClientType(*iter); |
| 294 if (client != DBusClientBundle::NO_CLIENTS) { | 298 if (client != NO_CLIENT) { |
| 295 LOG(WARNING) << "Unstubbing dbus client for " << *iter; | 299 LOG(WARNING) << "Unstubbing dbus client for " << *iter; |
| 296 unstub_mask |= client; | 300 unstub_mask |= client; |
| 297 } else { | 301 } else { |
| 298 LOG(ERROR) << "Unknown dbus client: " << *iter; | 302 LOG(ERROR) << "Unknown dbus client: " << *iter; |
| 299 } | 303 } |
| 300 } | 304 } |
| 301 | 305 |
| 302 return unstub_mask; | 306 return unstub_mask; |
| 303 } | 307 } |
| 304 | 308 |
| 305 } // namespace chromeos | 309 } // namespace chromeos |
| OLD | NEW |