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

Unified Diff: chrome/browser/extensions/extension_history_api.cc

Issue 6901084: Use new APIs in base/values.h: Value::GetAsNumber and DictionaryValue::GetNumber. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, 2010->2011 Created 9 years, 8 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 | « chrome/browser/automation/automation_util.cc ('k') | chrome/browser/extensions/extension_tts_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_history_api.cc
diff --git a/chrome/browser/extensions/extension_history_api.cc b/chrome/browser/extensions/extension_history_api.cc
index 49929bd4859a22e8ad0ad71b0bf0a0197254b672..9ead42236424d59ca9d069b177533b4600ca286a 100644
--- a/chrome/browser/extensions/extension_history_api.cc
+++ b/chrome/browser/extensions/extension_history_api.cc
@@ -176,12 +176,8 @@ bool HistoryFunction::GetUrlFromValue(Value* value, GURL* url) {
bool HistoryFunction::GetTimeFromValue(Value* value, base::Time* time) {
double ms_from_epoch = 0.0;
- if (!value->GetAsDouble(&ms_from_epoch)) {
- int ms_from_epoch_as_int = 0;
- if (!value->GetAsInteger(&ms_from_epoch_as_int))
- return false;
- ms_from_epoch = static_cast<double>(ms_from_epoch_as_int);
- }
+ if (!value->GetAsDouble(&ms_from_epoch))
+ return false;
// The history service has seconds resolution, while javascript Date() has
// milliseconds resolution.
double seconds_from_epoch = ms_from_epoch / 1000.0;
« no previous file with comments | « chrome/browser/automation/automation_util.cc ('k') | chrome/browser/extensions/extension_tts_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698