| 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 581e02f509b9c360f2cdeeaf22fb103babe3dc53..9ccf08a0c9ce5bdd5a596124011bd7e56224e71b 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
|
| @@ -15,9 +15,9 @@ namespace extensions {
|
|
|
| using content::BrowserThread;
|
| using chrome::StorageMonitor;
|
| -using api::experimental_system_info_storage::StorageUnitInfo;
|
| -using api::experimental_system_info_storage::STORAGE_UNIT_TYPE_FIXED;
|
| -using api::experimental_system_info_storage::STORAGE_UNIT_TYPE_REMOVABLE;
|
| +using api::system_info_storage::StorageUnitInfo;
|
| +using api::system_info_storage::STORAGE_UNIT_TYPE_FIXED;
|
| +using api::system_info_storage::STORAGE_UNIT_TYPE_REMOVABLE;
|
|
|
| namespace systeminfo {
|
|
|
| @@ -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
|
| @@ -63,24 +62,8 @@ void StorageInfoProvider::QueryInfoImplOnUIThread() {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| // At this point, we can call StorageMonitor::GetAllAvailableStorages to
|
| // get the correct results.
|
| - QueryInfo(&info_);
|
| - // The amount of available capacity should be queried on blocking pool.
|
| - PostQueryTaskToBlockingPool(FROM_HERE,
|
| - base::Bind(&StorageInfoProvider::QueryAvailableCapacityOnBlockingPool,
|
| - this));
|
| -}
|
| -
|
| -void StorageInfoProvider::QueryAvailableCapacityOnBlockingPool() {
|
| - DCHECK(BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
|
| - for (StorageInfo::iterator it = info_.begin(); it != info_.end(); ++it) {
|
| - int64 amount = GetStorageFreeSpaceFromTransientId((*it)->id);
|
| - if (amount > 0)
|
| - (*it)->available_capacity = static_cast<double>(amount);
|
| - }
|
| -
|
| - // Notify UI thread that the querying operation has completed.
|
| - BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
|
| - base::Bind(&StorageInfoProvider::OnQueryCompleted, this, true));
|
| + bool success = QueryInfo(&info_);
|
| + OnQueryCompleted(success);
|
| }
|
|
|
| std::vector<chrome::StorageInfo> StorageInfoProvider::GetAllStorages() const {
|
|
|