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

Unified Diff: components/policy/core/browser/configuration_policy_handler.cc

Issue 390233003: Decrement CreateDoubleValue count (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/base/math_util.cc ('k') | components/policy/core/browser/configuration_policy_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/core/browser/configuration_policy_handler.cc
diff --git a/components/policy/core/browser/configuration_policy_handler.cc b/components/policy/core/browser/configuration_policy_handler.cc
index 969b8d5c450147a0b468f046589aa3d040a5a43b..5927ab4026188034c27ae0ef15bc71555a2bb77b 100644
--- a/components/policy/core/browser/configuration_policy_handler.cc
+++ b/components/policy/core/browser/configuration_policy_handler.cc
@@ -267,10 +267,8 @@ void IntRangePolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
return;
const base::Value* value = policies.GetValue(policy_name());
int value_in_range;
- if (value && EnsureInRange(value, &value_in_range, NULL)) {
- prefs->SetValue(pref_path_,
- new base::FundamentalValue(value_in_range));
- }
+ if (value && EnsureInRange(value, &value_in_range, NULL))
+ prefs->SetInteger(pref_path_, value_in_range);
}
@@ -296,10 +294,8 @@ void IntPercentageToDoublePolicyHandler::ApplyPolicySettings(
return;
const base::Value* value = policies.GetValue(policy_name());
int percentage;
- if (value && EnsureInRange(value, &percentage, NULL)) {
- prefs->SetValue(pref_path_, base::Value::CreateDoubleValue(
- static_cast<double>(percentage) / 100.));
- }
+ if (value && EnsureInRange(value, &percentage, NULL))
+ prefs->SetDouble(pref_path_, static_cast<double>(percentage) / 100.);
}
« no previous file with comments | « cc/base/math_util.cc ('k') | components/policy/core/browser/configuration_policy_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698