Commit b5dc8422 authored by estade@chromium.org's avatar estade@chromium.org

Get rid of some uses of CreateDoubleValue

BUG=160586

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283348 0039d316-1c4b-4281-b951-d872f2087c98
parent 681eb0ab
...@@ -405,7 +405,7 @@ bool WebViewInternalGetZoomFunction::RunAsyncSafe(WebViewGuest* guest) { ...@@ -405,7 +405,7 @@ bool WebViewInternalGetZoomFunction::RunAsyncSafe(WebViewGuest* guest) {
EXTENSION_FUNCTION_VALIDATE(params.get()); EXTENSION_FUNCTION_VALIDATE(params.get());
double zoom_factor = guest->GetZoom(); double zoom_factor = guest->GetZoom();
SetResult(base::Value::CreateDoubleValue(zoom_factor)); SetResult(new base::FundamentalValue(zoom_factor));
SendResponse(true); SendResponse(true);
return true; return true;
} }
......
...@@ -85,7 +85,7 @@ TEST(PrefHashCalculatorTest, CatchHashChanges) { ...@@ -85,7 +85,7 @@ TEST(PrefHashCalculatorTest, CatchHashChanges) {
scoped_ptr<base::Value> int_value( scoped_ptr<base::Value> int_value(
base::Value::CreateIntegerValue(1234567890)); base::Value::CreateIntegerValue(1234567890));
scoped_ptr<base::Value> double_value( scoped_ptr<base::Value> double_value(
base::Value::CreateDoubleValue(123.0987654321)); new base::FundamentalValue(123.0987654321));
scoped_ptr<base::Value> string_value(base::Value::CreateStringValue( scoped_ptr<base::Value> string_value(base::Value::CreateStringValue(
"testing with special chars:\n<>{}:^^@#$\\/")); "testing with special chars:\n<>{}:^^@#$\\/"));
......
...@@ -62,7 +62,7 @@ class TestingProfileWithHostZoomMap : public TestingProfile { ...@@ -62,7 +62,7 @@ class TestingProfileWithHostZoomMap : public TestingProfile {
host_zoom_dictionary->RemoveWithoutPathExpansion(change.host, NULL); host_zoom_dictionary->RemoveWithoutPathExpansion(change.host, NULL);
} else { } else {
host_zoom_dictionary->SetWithoutPathExpansion( host_zoom_dictionary->SetWithoutPathExpansion(
change.host, base::Value::CreateDoubleValue(level)); change.host, new base::FundamentalValue(level));
} }
} }
......
...@@ -1074,12 +1074,10 @@ void ProfileImpl::OnZoomLevelChanged( ...@@ -1074,12 +1074,10 @@ void ProfileImpl::OnZoomLevelChanged(
double level = change.zoom_level; double level = change.zoom_level;
DictionaryPrefUpdate update(prefs_.get(), prefs::kPerHostZoomLevels); DictionaryPrefUpdate update(prefs_.get(), prefs::kPerHostZoomLevels);
base::DictionaryValue* host_zoom_dictionary = update.Get(); base::DictionaryValue* host_zoom_dictionary = update.Get();
if (content::ZoomValuesEqual(level, host_zoom_map->GetDefaultZoomLevel())) { if (content::ZoomValuesEqual(level, host_zoom_map->GetDefaultZoomLevel()))
host_zoom_dictionary->RemoveWithoutPathExpansion(change.host, NULL); host_zoom_dictionary->RemoveWithoutPathExpansion(change.host, NULL);
} else { else
host_zoom_dictionary->SetWithoutPathExpansion( host_zoom_dictionary->SetDoubleWithoutPathExpansion(change.host, level);
change.host, base::Value::CreateDoubleValue(level));
}
} }
#if defined(ENABLE_SESSION_SERVICE) #if defined(ENABLE_SESSION_SERVICE)
......
...@@ -275,9 +275,9 @@ void DoGetEvents(base::ListValue* results, ...@@ -275,9 +275,9 @@ void DoGetEvents(base::ListValue* results,
// The property 'eventType' is set in HandleGetEvents as part of the // The property 'eventType' is set in HandleGetEvents as part of the
// entire result set, so we don't need to include this here in the // entire result set, so we don't need to include this here in the
// event. // event.
if (data.key() == "eventType") if (data.key() == "eventType") {
continue; continue;
else if (data.key() == "time") { } else if (data.key() == "time") {
// The property 'time' is also used computationally, but must be // The property 'time' is also used computationally, but must be
// converted to JS-style time. // converted to JS-style time.
double time = 0.0; double time = 0.0;
...@@ -285,9 +285,9 @@ void DoGetEvents(base::ListValue* results, ...@@ -285,9 +285,9 @@ void DoGetEvents(base::ListValue* results,
LOG(ERROR) << "Failed to get 'time' field from event."; LOG(ERROR) << "Failed to get 'time' field from event.";
continue; continue;
} }
value = base::Value::CreateDoubleValue( value = new base::FundamentalValue(
base::Time::FromInternalValue( base::Time::FromInternalValue(static_cast<int64>(time))
static_cast<int64>(time)).ToJsTime()); .ToJsTime());
} else { } else {
// All other values are user-facing, so we create a new value for // All other values are user-facing, so we create a new value for
// localized display. // localized display.
......
...@@ -34,9 +34,8 @@ void QuotaInternalsHandler::RegisterMessages() { ...@@ -34,9 +34,8 @@ void QuotaInternalsHandler::RegisterMessages() {
} }
void QuotaInternalsHandler::ReportAvailableSpace(int64 available_space) { void QuotaInternalsHandler::ReportAvailableSpace(int64 available_space) {
scoped_ptr<base::Value> avail( SendMessage("AvailableSpaceUpdated",
base::Value::CreateDoubleValue(static_cast<double>(available_space))); base::FundamentalValue(static_cast<double>(available_space)));
SendMessage("AvailableSpaceUpdated", *avail);
} }
void QuotaInternalsHandler::ReportGlobalInfo(const GlobalStorageInfo& data) { void QuotaInternalsHandler::ReportGlobalInfo(const GlobalStorageInfo& data) {
......
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