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

Unified Diff: chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc

Issue 1147813003: Files.app: Tell users that the remaining space is 0 bytes when Drive usage is over quota. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc
diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc
index 4c4b8c56041d935458f6fd15f1ee8cb9f23891b0..6e0f24995a7aa8bc585cf8b85316855301ac4b4d 100644
--- a/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc
@@ -430,7 +430,9 @@ void FileManagerPrivateGetSizeStatsFunction::GetDriveAvailableSpaceCallback(
int64 bytes_used) {
if (error == drive::FILE_ERROR_OK) {
const uint64 bytes_total_unsigned = bytes_total;
- const uint64 bytes_remaining_unsigned = bytes_total - bytes_used;
+ // bytes_used can be larger than bytes_total (over quota).
+ const uint64 bytes_remaining_unsigned =
+ std::max(bytes_total - bytes_used, int64(0));
GetSizeStatsCallback(&bytes_total_unsigned,
&bytes_remaining_unsigned);
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698