Index: webkit/quota/quota_manager.cc |
diff --git a/webkit/quota/quota_manager.cc b/webkit/quota/quota_manager.cc |
index 2c810a727bbfdfb2a44b7d0ec0bff20a3e9b5161..80db56394cbcb43269ed247112cabe9a68228843 100644 |
--- a/webkit/quota/quota_manager.cc |
+++ b/webkit/quota/quota_manager.cc |
@@ -204,12 +204,12 @@ int64 CalculateQuotaForInstalledApp( |
void CallGetUsageAndQuotaCallback( |
const QuotaManager::GetUsageAndQuotaCallback& callback, |
bool unlimited, |
- bool is_installed_app, |
+ bool can_query_disk_size, |
QuotaStatusCode status, |
const QuotaAndUsage& quota_and_usage) { |
// Regular limited case. |
if (!unlimited) { |
- if (is_installed_app) { |
+ if (can_query_disk_size) { |
// Cap the quota by the available disk space. |
callback.Run(status, quota_and_usage.usage, |
CalculateQuotaForInstalledApp( |
@@ -224,9 +224,10 @@ void CallGetUsageAndQuotaCallback( |
int64 usage = quota_and_usage.unlimited_usage; |
- // Unlimited case: this must be only for installed-app and extensions, |
+ // Unlimited case: this must be only for apps with unlimitedStorage permission |
// or only when --unlimited-storage flag is given. |
- // We return the available disk space (minus kMinimumPreserveForSystem). |
+ // We assume we can expose the disk size for them and return the available |
+ // disk space (minus kMinimumPreserveForSystem). |
callback.Run(status, usage, |
CalculateQuotaForInstalledApp( |
quota_and_usage.available_disk_space, |
@@ -967,7 +968,7 @@ void QuotaManager::GetUsageAndQuotaForWebApps( |
GetUsageAndQuotaInternal( |
origin, type, false /* global */, |
base::Bind(&CallGetUsageAndQuotaCallback, callback, |
- IsStorageUnlimited(origin, type), IsInstalledApp(origin))); |
+ IsStorageUnlimited(origin, type), CanQueryDiskSize(origin))); |
} |
void QuotaManager::GetUsageAndQuota( |
@@ -977,7 +978,7 @@ void QuotaManager::GetUsageAndQuota( |
if (IsStorageUnlimited(origin, type)) { |
CallGetUsageAndQuotaCallback( |
- callback, false, IsInstalledApp(origin), |
+ callback, false, CanQueryDiskSize(origin), |
kQuotaStatusOk, QuotaAndUsage::CreateForUnlimitedStorage()); |
return; |
} |