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

Unified Diff: chrome/browser/extensions/api/system_info_storage/storage_info_provider.cc

Issue 19672022: [SystemInfo API] Update systemInfo.storage API StorageUnitInfo Definition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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
Index: chrome/browser/extensions/api/system_info_storage/storage_info_provider.cc
diff --git a/chrome/browser/extensions/api/system_info_storage/storage_info_provider.cc b/chrome/browser/extensions/api/system_info_storage/storage_info_provider.cc
index c43fe8f4fdaa6829d65abbac7062798412769fa3..c868769cd3bff06d500abf590101667b7f177f4a 100644
--- a/chrome/browser/extensions/api/system_info_storage/storage_info_provider.cc
+++ b/chrome/browser/extensions/api/system_info_storage/storage_info_provider.cc
@@ -34,7 +34,6 @@ void BuildStorageUnitInfo(const chrome::StorageInfo& info,
unit->type = chrome::StorageInfo::IsRemovableDevice(info.device_id()) ?
STORAGE_UNIT_TYPE_REMOVABLE : STORAGE_UNIT_TYPE_FIXED;
unit->capacity = static_cast<double>(info.total_size_in_bytes());
- unit->available_capacity = 0;
}
} // namespace systeminfo
@@ -61,8 +60,7 @@ const StorageUnitInfoList& StorageInfoProvider::storage_unit_info_list() const {
}
void StorageInfoProvider::PrepareQueryOnUIThread() {
- // Get all available storage devices before invoking |QueryInfo()| to get
- // available capacity.
+ // Get all available storage devices before invoking |QueryInfo()|.
GetAllStoragesIntoInfoList();
}
@@ -77,13 +75,8 @@ void StorageInfoProvider::InitializeProvider(
bool StorageInfoProvider::QueryInfo() {
DCHECK(BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
- for (StorageUnitInfoList::iterator it = info_.begin();
- it != info_.end(); ++it) {
- int64 amount = GetStorageFreeSpaceFromTransientId((*it)->id);
- if (amount > 0)
- (*it)->available_capacity = static_cast<double>(amount);
- }
-
+ // No info to query since we get all available storage devices' info in
+ // |PrepareQueryOnUIThread()|.
return true;
}

Powered by Google App Engine
This is Rietveld 408576698