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

Unified Diff: chrome/browser/extensions/api/downloads/downloads_api.cc

Issue 132353002: Change chrome.downloads.DownloadItem.{fileSize,bytesReceived,totalBytes} from longs to doubles for … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 11 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 | « no previous file | chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/downloads/downloads_api.cc
diff --git a/chrome/browser/extensions/api/downloads/downloads_api.cc b/chrome/browser/extensions/api/downloads/downloads_api.cc
index fab0dd137aa1d4ffe17d44237485f77ab19f1d5d..b47c48a5ad1b79496a762c6f8f09a1efdb2f4952 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api.cc
@@ -258,8 +258,8 @@ scoped_ptr<base::DictionaryValue> DownloadItemToJSON(
json->SetBoolean(kPausedKey, download_item->IsPaused());
json->SetString(kMimeKey, download_item->GetMimeType());
json->SetString(kStartTimeKey, TimeToISO8601(download_item->GetStartTime()));
- json->SetInteger(kBytesReceivedKey, download_item->GetReceivedBytes());
- json->SetInteger(kTotalBytesKey, download_item->GetTotalBytes());
+ json->SetDouble(kBytesReceivedKey, download_item->GetReceivedBytes());
+ json->SetDouble(kTotalBytesKey, download_item->GetTotalBytes());
json->SetBoolean(kIncognitoKey, profile->IsOffTheRecord());
if (download_item->GetState() == DownloadItem::INTERRUPTED) {
json->SetString(kErrorKey, content::InterruptReasonDebugString(
@@ -290,7 +290,7 @@ scoped_ptr<base::DictionaryValue> DownloadItemToJSON(
json->SetString(kByExtensionNameKey, extension->name());
}
// TODO(benjhayden): Implement fileSize.
- json->SetInteger(kFileSizeKey, download_item->GetTotalBytes());
+ json->SetDouble(kFileSizeKey, download_item->GetTotalBytes());
return scoped_ptr<base::DictionaryValue>(json);
}
« no previous file with comments | « no previous file | chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698