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

Unified Diff: components/policy/core/common/registry_dict_win.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 | « components/policy/core/common/mac_util.cc ('k') | components/policy/core/common/schema_map_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/core/common/registry_dict_win.cc
diff --git a/components/policy/core/common/registry_dict_win.cc b/components/policy/core/common/registry_dict_win.cc
index dc78ebcd1d942be05488f5f8474a5d55301c8af0..61657b8575f6d631bc40b0ff227114e20e582d30 100644
--- a/components/policy/core/common/registry_dict_win.cc
+++ b/components/policy/core/common/registry_dict_win.cc
@@ -86,13 +86,11 @@ scoped_ptr<base::Value> ConvertValue(const base::Value& value,
case base::Value::TYPE_DOUBLE: {
// Doubles may be string-encoded or integer-encoded.
double double_value = 0;
- if (value.GetAsInteger(&int_value)) {
- return scoped_ptr<base::Value>(
- base::Value::CreateDoubleValue(int_value));
- } else if (value.GetAsString(&string_value) &&
- base::StringToDouble(string_value, &double_value)) {
+ if (value.GetAsDouble(&double_value) ||
+ (value.GetAsString(&string_value) &&
+ base::StringToDouble(string_value, &double_value))) {
return scoped_ptr<base::Value>(
- base::Value::CreateDoubleValue(double_value));
+ new base::FundamentalValue(double_value));
}
break;
}
« no previous file with comments | « components/policy/core/common/mac_util.cc ('k') | components/policy/core/common/schema_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698