Skip to content

Commit

Permalink
Migrate DBus service constants from flimflam namespace to shill names…
Browse files Browse the repository at this point in the history
…pace.

All shill DBus service constants have been moved from the flimflam namespace to
the shill namespace. This CL makes the corresponding changes on the Chrome
side.

Related CLs:
  https://chromium-review.googlesource.com/#/c/170123/
  https://chromium-review.googlesource.com/#/c/170205/
  https://chromium-review.googlesource.com/#/c/170206/
  https://chromium-review.googlesource.com/#/c/170207/
  https://chromium-review.googlesource.com/#/c/170208/
  https://chromium-review.googlesource.com/#/c/170209/
  https://chromium-review.googlesource.com/#/c/170223/
  https://chromium-review.googlesource.com/#/c/170230/
  https://chromium-review.googlesource.com/#/c/170231/

BUG=295425
R=gspencer@chromium.org,gauravsh@chromium.org,stevenjb@chromium.org

Review URL: https://chromiumcodereview.appspot.com/24348002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224942 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
benchan@chromium.org committed Sep 24, 2013
1 parent 8b44fa5 commit 547396c
Show file tree
Hide file tree
Showing 41 changed files with 554 additions and 580 deletions.
8 changes: 4 additions & 4 deletions chromeos/network/client_cert_resolver_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ class ClientCertResolverTest : public testing::Test {
const bool add_to_watchlist = true;
service_test_->AddService(kWifiStub,
kWifiSSID,
flimflam::kTypeWifi,
flimflam::kStateOnline,
shill::kTypeWifi,
shill::kStateOnline,
add_to_visible,
add_to_watchlist);
service_test_->SetServiceProperty(
kWifiStub, flimflam::kGuidProperty, base::StringValue(kWifiStub));
kWifiStub, shill::kGuidProperty, base::StringValue(kWifiStub));

profile_test_->AddService(kUserProfilePath, kWifiStub);
}
Expand Down Expand Up @@ -196,7 +196,7 @@ class ClientCertResolverTest : public testing::Test {
service_test_->GetServiceProperties(kWifiStub);
if (!properties)
return;
properties->GetStringWithoutPathExpansion(flimflam::kEapCertIdProperty,
properties->GetStringWithoutPathExpansion(shill::kEapCertIdProperty,
pkcs11_id);
}

Expand Down
24 changes: 12 additions & 12 deletions chromeos/network/client_cert_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,33 +208,33 @@ void SetShillProperties(const client_cert::ConfigType cert_config_type,
return;
}
case CONFIG_TYPE_OPENVPN: {
tpm_pin_property = flimflam::kOpenVPNPinProperty;
tpm_pin_property = shill::kOpenVPNPinProperty;
if (pkcs11_id) {
properties->SetStringWithoutPathExpansion(
flimflam::kOpenVPNClientCertIdProperty, *pkcs11_id);
shill::kOpenVPNClientCertIdProperty, *pkcs11_id);
}
break;
}
case CONFIG_TYPE_IPSEC: {
tpm_pin_property = flimflam::kL2tpIpsecPinProperty;
tpm_pin_property = shill::kL2tpIpsecPinProperty;
if (!tpm_slot.empty()) {
properties->SetStringWithoutPathExpansion(
flimflam::kL2tpIpsecClientCertSlotProperty, tpm_slot);
shill::kL2tpIpsecClientCertSlotProperty, tpm_slot);
}
if (pkcs11_id) {
properties->SetStringWithoutPathExpansion(
flimflam::kL2tpIpsecClientCertIdProperty, *pkcs11_id);
shill::kL2tpIpsecClientCertIdProperty, *pkcs11_id);
}
break;
}
case CONFIG_TYPE_EAP: {
tpm_pin_property = flimflam::kEapPinProperty;
tpm_pin_property = shill::kEapPinProperty;
if (pkcs11_id) {
// Shill requires both CertID and KeyID for TLS connections, despite the
// fact that by convention they are the same ID.
properties->SetStringWithoutPathExpansion(flimflam::kEapCertIdProperty,
properties->SetStringWithoutPathExpansion(shill::kEapCertIdProperty,
*pkcs11_id);
properties->SetStringWithoutPathExpansion(flimflam::kEapKeyIdProperty,
properties->SetStringWithoutPathExpansion(shill::kEapKeyIdProperty,
*pkcs11_id);
}
break;
Expand All @@ -250,7 +250,7 @@ bool IsCertificateConfigured(const client_cert::ConfigType cert_config_type,
// VPN certificate properties are read from the Provider dictionary.
const base::DictionaryValue* provider_properties = NULL;
service_properties.GetDictionaryWithoutPathExpansion(
flimflam::kProviderProperty, &provider_properties);
shill::kProviderProperty, &provider_properties);
switch (cert_config_type) {
case CONFIG_TYPE_NONE:
return true;
Expand All @@ -263,11 +263,11 @@ bool IsCertificateConfigured(const client_cert::ConfigType cert_config_type,
return false;
case CONFIG_TYPE_EAP: {
std::string cert_id = GetStringFromDictionary(
service_properties, flimflam::kEapCertIdProperty);
service_properties, shill::kEapCertIdProperty);
std::string key_id = GetStringFromDictionary(
service_properties, flimflam::kEapKeyIdProperty);
service_properties, shill::kEapKeyIdProperty);
std::string identity = GetStringFromDictionary(
service_properties, flimflam::kEapIdentityProperty);
service_properties, shill::kEapIdentityProperty);
return !cert_id.empty() && !key_id.empty() && !identity.empty();
}
}
Expand Down
44 changes: 22 additions & 22 deletions chromeos/network/device_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ bool DeviceState::PropertyChanged(const std::string& key,

if (ManagedStatePropertyChanged(key, value))
return true;
if (key == flimflam::kAddressProperty) {
if (key == shill::kAddressProperty) {
return GetStringValue(key, value, &mac_address_);
} else if (key == flimflam::kScanningProperty) {
} else if (key == shill::kScanningProperty) {
return GetBooleanValue(key, value, &scanning_);
} else if (key == flimflam::kSupportNetworkScanProperty) {
} else if (key == shill::kSupportNetworkScanProperty) {
return GetBooleanValue(key, value, &support_network_scan_);
} else if (key == shill::kProviderRequiresRoamingProperty) {
return GetBooleanValue(key, value, &provider_requires_roaming_);
} else if (key == flimflam::kHomeProviderProperty) {
} else if (key == shill::kHomeProviderProperty) {
const base::DictionaryValue* dict = NULL;
if (!value.GetAsDictionary(&dict))
return false;
std::string home_provider_country;
std::string home_provider_name;
dict->GetStringWithoutPathExpansion(flimflam::kOperatorCountryKey,
dict->GetStringWithoutPathExpansion(shill::kOperatorCountryKey,
&home_provider_country);
dict->GetStringWithoutPathExpansion(flimflam::kOperatorNameKey,
dict->GetStringWithoutPathExpansion(shill::kOperatorNameKey,
&home_provider_name);
// Set home_provider_id_
if (!home_provider_name.empty() && !home_provider_country.empty()) {
Expand All @@ -56,17 +56,17 @@ bool DeviceState::PropertyChanged(const std::string& key,
home_provider_name.c_str(),
home_provider_country.c_str());
} else {
dict->GetStringWithoutPathExpansion(flimflam::kOperatorCodeKey,
dict->GetStringWithoutPathExpansion(shill::kOperatorCodeKey,
&home_provider_id_);
LOG(WARNING) << "Carrier ID not defined, using code instead: "
<< home_provider_id_;
}
return true;
} else if (key == flimflam::kTechnologyFamilyProperty) {
} else if (key == shill::kTechnologyFamilyProperty) {
return GetStringValue(key, value, &technology_family_);
} else if (key == flimflam::kCarrierProperty) {
} else if (key == shill::kCarrierProperty) {
return GetStringValue(key, value, &carrier_);
} else if (key == flimflam::kFoundNetworksProperty) {
} else if (key == shill::kFoundNetworksProperty) {
const base::ListValue* list = NULL;
if (!value.GetAsList(&list))
return false;
Expand All @@ -75,43 +75,43 @@ bool DeviceState::PropertyChanged(const std::string& key,
return false;
scan_results_.swap(parsed_results);
return true;
} else if (key == flimflam::kSIMLockStatusProperty) {
} else if (key == shill::kSIMLockStatusProperty) {
const base::DictionaryValue* dict = NULL;
if (!value.GetAsDictionary(&dict))
return false;

// Return true if at least one of the property values changed.
bool property_changed = false;
const base::Value* out_value = NULL;
if (!dict->GetWithoutPathExpansion(flimflam::kSIMLockRetriesLeftProperty,
if (!dict->GetWithoutPathExpansion(shill::kSIMLockRetriesLeftProperty,
&out_value))
return false;
if (GetUInt32Value(flimflam::kSIMLockRetriesLeftProperty,
if (GetUInt32Value(shill::kSIMLockRetriesLeftProperty,
*out_value, &sim_retries_left_))
property_changed = true;

if (!dict->GetWithoutPathExpansion(flimflam::kSIMLockTypeProperty,
if (!dict->GetWithoutPathExpansion(shill::kSIMLockTypeProperty,
&out_value))
return false;
if (GetStringValue(flimflam::kSIMLockTypeProperty,
if (GetStringValue(shill::kSIMLockTypeProperty,
*out_value, &sim_lock_type_))
property_changed = true;

if (!dict->GetWithoutPathExpansion(flimflam::kSIMLockEnabledProperty,
if (!dict->GetWithoutPathExpansion(shill::kSIMLockEnabledProperty,
&out_value))
return false;
if (GetBooleanValue(flimflam::kSIMLockEnabledProperty,
if (GetBooleanValue(shill::kSIMLockEnabledProperty,
*out_value, &sim_lock_enabled_))
property_changed = true;

return property_changed;
} else if (key == flimflam::kMeidProperty) {
} else if (key == shill::kMeidProperty) {
return GetStringValue(key, value, &meid_);
} else if (key == flimflam::kImeiProperty) {
} else if (key == shill::kImeiProperty) {
return GetStringValue(key, value, &imei_);
} else if (key == flimflam::kIccidProperty) {
} else if (key == shill::kIccidProperty) {
return GetStringValue(key, value, &iccid_);
} else if (key == flimflam::kMdnProperty) {
} else if (key == shill::kMdnProperty) {
return GetStringValue(key, value, &mdn_);
} else if (key == shill::kSIMPresentProperty) {
return GetBooleanValue(key, value, &sim_present_);
Expand All @@ -130,7 +130,7 @@ bool DeviceState::InitialPropertiesReceived(
}

bool DeviceState::IsSimAbsent() const {
return technology_family_ == flimflam::kTechnologyFamilyGsm && !sim_present_;
return technology_family_ == shill::kTechnologyFamilyGsm && !sim_present_;
}

} // namespace chromeos
6 changes: 3 additions & 3 deletions chromeos/network/favorite_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ bool FavoriteState::PropertyChanged(const std::string& key,
const base::Value& value) {
if (ManagedStatePropertyChanged(key, value))
return true;
if (key == flimflam::kProfileProperty) {
if (key == shill::kProfileProperty) {
return GetStringValue(key, value, &profile_path_);
} else if (key == flimflam::kUIDataProperty) {
} else if (key == shill::kUIDataProperty) {
scoped_ptr<NetworkUIData> new_ui_data =
shill_property_util::GetUIDataFromValue(value);
if (!new_ui_data) {
Expand All @@ -37,7 +37,7 @@ bool FavoriteState::PropertyChanged(const std::string& key,
}
ui_data_ = *new_ui_data;
return true;
} else if (key == flimflam::kGuidProperty) {
} else if (key == shill::kGuidProperty) {
return GetStringValue(key, value, &guid_);
}
return false;
Expand Down
8 changes: 4 additions & 4 deletions chromeos/network/geolocation_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ void GeolocationHandler::ManagerPropertiesCallback(
DBusMethodCallStatus call_status,
const base::DictionaryValue& properties) {
const base::Value* value = NULL;
if (properties.Get(flimflam::kEnabledTechnologiesProperty, &value) && value)
HandlePropertyChanged(flimflam::kEnabledTechnologiesProperty, *value);
if (properties.Get(shill::kEnabledTechnologiesProperty, &value) && value)
HandlePropertyChanged(shill::kEnabledTechnologiesProperty, *value);
}

void GeolocationHandler::HandlePropertyChanged(const std::string& key,
const base::Value& value) {
if (key != flimflam::kEnabledTechnologiesProperty)
if (key != shill::kEnabledTechnologiesProperty)
return;
const base::ListValue* technologies = NULL;
if (!value.GetAsList(&technologies) || !technologies)
Expand All @@ -81,7 +81,7 @@ void GeolocationHandler::HandlePropertyChanged(const std::string& key,
iter != technologies->end(); ++iter) {
std::string technology;
(*iter)->GetAsString(&technology);
if (technology == flimflam::kTypeWifi) {
if (technology == shill::kTypeWifi) {
wifi_enabled_ = true;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion chromeos/network/geolocation_handler_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class GeolocationHandlerTest : public testing::Test {
shill::kGeoChannelProperty, channel);
properties.SetStringWithoutPathExpansion(
shill::kGeoSignalStrengthProperty, strength);
manager_test_->AddGeoNetwork(flimflam::kTypeWifi, properties);
manager_test_->AddGeoNetwork(shill::kTypeWifi, properties);
message_loop_.RunUntilIdle();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void ManagedNetworkConfigurationHandlerImpl::GetManagedPropertiesCallback(
const std::string& service_path,
const base::DictionaryValue& shill_properties) {
std::string profile_path;
shill_properties.GetStringWithoutPathExpansion(flimflam::kProfileProperty,
shill_properties.GetStringWithoutPathExpansion(shill::kProfileProperty,
&profile_path);
const NetworkProfile* profile =
network_profile_handler_->GetProfileForPath(profile_path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ShillProfileTestClient {
ASSERT_TRUE(entries);

base::DictionaryValue* new_entry = entry.DeepCopy();
new_entry->SetStringWithoutPathExpansion(flimflam::kProfileProperty,
new_entry->SetStringWithoutPathExpansion(shill::kProfileProperty,
profile_path);
entries->SetWithoutPathExpansion(entry_path, new_entry);
}
Expand All @@ -94,8 +94,7 @@ class ShillProfileTestClient {

scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue);
base::ListValue* entry_paths = new base::ListValue;
result->SetWithoutPathExpansion(flimflam::kEntriesProperty,
entry_paths);
result->SetWithoutPathExpansion(shill::kEntriesProperty, entry_paths);
for (base::DictionaryValue::Iterator it(*entries); !it.IsAtEnd();
it.Advance()) {
entry_paths->AppendString(it.key());
Expand Down Expand Up @@ -412,7 +411,7 @@ TEST_F(ManagedNetworkConfigurationHandlerTest, SetPolicyUpdateManagedNewGUID) {
// The passphrase isn't sent again, because it's configured by the user and
// Shill doesn't sent it on GetProperties calls.
expected_shill_properties->RemoveWithoutPathExpansion(
flimflam::kPassphraseProperty, NULL);
shill::kPassphraseProperty, NULL);

EXPECT_CALL(mock_profile_client_,
GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
Expand Down Expand Up @@ -448,7 +447,7 @@ TEST_F(ManagedNetworkConfigurationHandlerTest, SetPolicyReapplyToManaged) {
// The passphrase isn't sent again, because it's configured by the user and
// Shill doesn't sent it on GetProperties calls.
expected_shill_properties->RemoveWithoutPathExpansion(
flimflam::kPassphraseProperty, NULL);
shill::kPassphraseProperty, NULL);

EXPECT_CALL(mock_profile_client_,
GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
Expand Down
4 changes: 2 additions & 2 deletions chromeos/network/managed_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ bool ManagedState::InitialPropertiesReceived(

bool ManagedState::ManagedStatePropertyChanged(const std::string& key,
const base::Value& value) {
if (key == flimflam::kNameProperty) {
if (key == shill::kNameProperty) {
return GetStringValue(key, value, &name_);
} else if (key == flimflam::kTypeProperty) {
} else if (key == shill::kTypeProperty) {
return GetStringValue(key, value, &type_);
}
return false;
Expand Down
4 changes: 2 additions & 2 deletions chromeos/network/managed_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ class CHROMEOS_EXPORT ManagedState {
std::string path_;

// Common properties shared by all managed state objects.
std::string name_; // flimflam::kNameProperty
std::string type_; // flimflam::kTypeProperty
std::string name_; // shill::kNameProperty
std::string type_; // shill::kTypeProperty

// Set to true when the an update has been received.
bool update_received_;
Expand Down
6 changes: 3 additions & 3 deletions chromeos/network/network_cert_migrator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ class NetworkCertMigrator::MigrationTask
const char* pem_key;
UMANetworkType uma_type;
} const kNssPemMap[] = {
{ NULL, flimflam::kEapCaCertNssProperty, shill::kEapCaCertPemProperty,
{ NULL, shill::kEapCaCertNssProperty, shill::kEapCaCertPemProperty,
UMA_NETWORK_TYPE_EAP },
{ flimflam::kProviderProperty, flimflam::kL2tpIpsecCaCertNssProperty,
{ shill::kProviderProperty, shill::kL2tpIpsecCaCertNssProperty,
shill::kL2tpIpsecCaCertPemProperty, UMA_NETWORK_TYPE_IPSEC },
{ flimflam::kProviderProperty, flimflam::kOpenVPNCaCertNSSProperty,
{ shill::kProviderProperty, shill::kOpenVPNCaCertNSSProperty,
shill::kOpenVPNCaCertPemProperty, UMA_NETWORK_TYPE_OPENVPN },
};

Expand Down
Loading

0 comments on commit 547396c

Please sign in to comment.