Commit c8b8dfb5 authored by pneubeck's avatar pneubeck Committed by Commit bot

Renaming CreateShillConfiguration argument for clarification.

Renaming from 'settings' to the more informative 'user_settings'.

BUG=NONE

Review URL: https://codereview.chromium.org/513143004

Cr-Commit-Position: refs/heads/master@{#292407}
parent b8744d2c
...@@ -338,7 +338,8 @@ void PolicyApplicator::ApplyRemainingPolicies() { ...@@ -338,7 +338,8 @@ void PolicyApplicator::ApplyRemainingPolicies() {
<< " in profile " << profile_.ToDebugString() << "."; << " in profile " << profile_.ToDebugString() << ".";
scoped_ptr<base::DictionaryValue> shill_dictionary = scoped_ptr<base::DictionaryValue> shill_dictionary =
policy_util::CreateShillConfiguration(profile_, *it, policy, NULL); policy_util::CreateShillConfiguration(
profile_, *it, policy, NULL /* no user settings */);
WriteNewShillConfiguration(*shill_dictionary, *policy, false); WriteNewShillConfiguration(*shill_dictionary, *policy, false);
} }
} }
......
...@@ -131,7 +131,7 @@ scoped_ptr<base::DictionaryValue> CreateShillConfiguration( ...@@ -131,7 +131,7 @@ scoped_ptr<base::DictionaryValue> CreateShillConfiguration(
const NetworkProfile& profile, const NetworkProfile& profile,
const std::string& guid, const std::string& guid,
const base::DictionaryValue* policy, const base::DictionaryValue* policy,
const base::DictionaryValue* settings) { const base::DictionaryValue* user_settings) {
scoped_ptr<base::DictionaryValue> effective; scoped_ptr<base::DictionaryValue> effective;
::onc::ONCSource onc_source = ::onc::ONC_SOURCE_NONE; ::onc::ONCSource onc_source = ::onc::ONC_SOURCE_NONE;
if (policy) { if (policy) {
...@@ -140,20 +140,20 @@ scoped_ptr<base::DictionaryValue> CreateShillConfiguration( ...@@ -140,20 +140,20 @@ scoped_ptr<base::DictionaryValue> CreateShillConfiguration(
NULL, // no user policy NULL, // no user policy
policy, // device policy policy, // device policy
NULL, // no user settings NULL, // no user settings
settings); // shared settings user_settings); // shared settings
onc_source = ::onc::ONC_SOURCE_DEVICE_POLICY; onc_source = ::onc::ONC_SOURCE_DEVICE_POLICY;
} else if (profile.type() == NetworkProfile::TYPE_USER) { } else if (profile.type() == NetworkProfile::TYPE_USER) {
effective = onc::MergeSettingsAndPoliciesToEffective( effective = onc::MergeSettingsAndPoliciesToEffective(
policy, // user policy policy, // user policy
NULL, // no device policy NULL, // no device policy
settings, // user settings user_settings, // user settings
NULL); // no shared settings NULL); // no shared settings
onc_source = ::onc::ONC_SOURCE_USER_POLICY; onc_source = ::onc::ONC_SOURCE_USER_POLICY;
} else { } else {
NOTREACHED(); NOTREACHED();
} }
} else if (settings) { } else if (user_settings) {
effective.reset(settings->DeepCopy()); effective.reset(user_settings->DeepCopy());
// TODO(pneubeck): change to source ONC_SOURCE_USER // TODO(pneubeck): change to source ONC_SOURCE_USER
onc_source = ::onc::ONC_SOURCE_NONE; onc_source = ::onc::ONC_SOURCE_NONE;
} else { } else {
...@@ -180,7 +180,7 @@ scoped_ptr<base::DictionaryValue> CreateShillConfiguration( ...@@ -180,7 +180,7 @@ scoped_ptr<base::DictionaryValue> CreateShillConfiguration(
scoped_ptr<NetworkUIData> ui_data(NetworkUIData::CreateFromONC(onc_source)); scoped_ptr<NetworkUIData> ui_data(NetworkUIData::CreateFromONC(onc_source));
if (settings) { if (user_settings) {
// Shill doesn't know that sensitive data is contained in the UIData // Shill doesn't know that sensitive data is contained in the UIData
// property and might write it into logs or other insecure places. Thus, we // property and might write it into logs or other insecure places. Thus, we
// have to remove or mask credentials. // have to remove or mask credentials.
...@@ -188,11 +188,11 @@ scoped_ptr<base::DictionaryValue> CreateShillConfiguration( ...@@ -188,11 +188,11 @@ scoped_ptr<base::DictionaryValue> CreateShillConfiguration(
// Shill's GetProperties doesn't return credentials. Masking credentials // Shill's GetProperties doesn't return credentials. Masking credentials
// instead of just removing them, allows remembering if a credential is set // instead of just removing them, allows remembering if a credential is set
// or not. // or not.
scoped_ptr<base::DictionaryValue> sanitized_settings( scoped_ptr<base::DictionaryValue> sanitized_user_settings(
onc::MaskCredentialsInOncObject(onc::kNetworkConfigurationSignature, onc::MaskCredentialsInOncObject(onc::kNetworkConfigurationSignature,
*settings, *user_settings,
kFakeCredential)); kFakeCredential));
ui_data->set_user_settings(sanitized_settings.Pass()); ui_data->set_user_settings(sanitized_user_settings.Pass());
} }
shill_property_util::SetUIData(*ui_data, shill_dictionary.get()); shill_property_util::SetUIData(*ui_data, shill_dictionary.get());
......
...@@ -24,14 +24,14 @@ typedef std::map<std::string, const base::DictionaryValue*> GuidToPolicyMap; ...@@ -24,14 +24,14 @@ typedef std::map<std::string, const base::DictionaryValue*> GuidToPolicyMap;
// Creates a Shill property dictionary from the given arguments. The resulting // Creates a Shill property dictionary from the given arguments. The resulting
// dictionary will be sent to Shill by the caller. Depending on the profile // dictionary will be sent to Shill by the caller. Depending on the profile
// type, |policy| is interpreted as the user or device policy and |settings| as // type, |policy| is interpreted as the user or device policy and
// the user or shared settings. |policy| or |settings| can be NULL, but not // |user_settings| as the user or shared settings. |policy| or |user_settings|
// both. // can be NULL, but not both.
scoped_ptr<base::DictionaryValue> CreateShillConfiguration( scoped_ptr<base::DictionaryValue> CreateShillConfiguration(
const NetworkProfile& profile, const NetworkProfile& profile,
const std::string& guid, const std::string& guid,
const base::DictionaryValue* policy, const base::DictionaryValue* policy,
const base::DictionaryValue* settings); const base::DictionaryValue* user_settings);
// Returns the policy from |policies| matching |actual_network|, if any exists. // Returns the policy from |policies| matching |actual_network|, if any exists.
// Returns NULL otherwise. |actual_network| must be part of a ONC // Returns NULL otherwise. |actual_network| must be part of a ONC
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment