| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 ShillManagerClient::TestInterface* manager = | 347 ShillManagerClient::TestInterface* manager = |
| 348 shill_manager_client_->GetTestInterface(); | 348 shill_manager_client_->GetTestInterface(); |
| 349 if (manager) | 349 if (manager) |
| 350 manager->SetupDefaultEnvironment(); | 350 manager->SetupDefaultEnvironment(); |
| 351 } | 351 } |
| 352 | 352 |
| 353 // static | 353 // static |
| 354 DBusClientBundle::DBusClientTypeMask DBusClientBundle::ParseUnstubList( | 354 DBusClientBundle::DBusClientTypeMask DBusClientBundle::ParseUnstubList( |
| 355 const std::string& unstub_list) { | 355 const std::string& unstub_list) { |
| 356 DBusClientTypeMask unstub_mask = 0; | 356 DBusClientTypeMask unstub_mask = 0; |
| 357 std::vector<std::string> unstub_components; | 357 for (const std::string& cur : base::SplitString( |
| 358 base::SplitString(unstub_list, ',', &unstub_components); | 358 unstub_list, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { |
| 359 for (std::vector<std::string>::const_iterator iter = | 359 DBusClientBundle::DBusClientType client = GetDBusClientType(cur); |
| 360 unstub_components.begin(); | |
| 361 iter != unstub_components.end(); ++iter) { | |
| 362 DBusClientBundle::DBusClientType client = GetDBusClientType(*iter); | |
| 363 if (client != NO_CLIENT) { | 360 if (client != NO_CLIENT) { |
| 364 LOG(WARNING) << "Unstubbing dbus client for " << *iter; | 361 LOG(WARNING) << "Unstubbing dbus client for " << cur; |
| 365 unstub_mask |= client; | 362 unstub_mask |= client; |
| 366 } else { | 363 } else { |
| 367 LOG(ERROR) << "Unknown dbus client: " << *iter; | 364 LOG(ERROR) << "Unknown dbus client: " << cur; |
| 368 } | 365 } |
| 369 } | 366 } |
| 370 | 367 |
| 371 return unstub_mask; | 368 return unstub_mask; |
| 372 } | 369 } |
| 373 | 370 |
| 374 } // namespace chromeos | 371 } // namespace chromeos |
| OLD | NEW |