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

Unified Diff: chrome/browser/extensions/extension_storage_monitor.cc

Issue 2592793002: Revert of Change how the quota system computes the total poolsize for temporary storage (Closed)
Patch Set: Created 4 years 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/extension_storage_monitor.cc
diff --git a/chrome/browser/extensions/extension_storage_monitor.cc b/chrome/browser/extensions/extension_storage_monitor.cc
index 81394f5609bafc272711c2f7fa52fbcef88191ab..7294fbd4fc8a03d9da3bbb61cd4b0667e620df2b 100644
--- a/chrome/browser/extensions/extension_storage_monitor.cc
+++ b/chrome/browser/extensions/extension_storage_monitor.cc
@@ -84,16 +84,17 @@ const Extension* GetExtensionById(content::BrowserContext* context,
extension_id, ExtensionRegistry::EVERYTHING);
}
-void LogTemporaryStorageUsage(
- scoped_refptr<storage::QuotaManager> quota_manager,
- int64_t usage) {
- const storage::QuotaSettings& settings = quota_manager->settings();
- if (settings.per_host_quota > 0) {
+void LogTemporaryStorageUsage(int64_t usage,
+ storage::QuotaStatusCode status,
+ int64_t global_quota) {
+ if (status == storage::kQuotaStatusOk) {
+ int64_t per_app_quota =
+ global_quota / storage::QuotaManager::kPerHostTemporaryPortion;
// Note we use COUNTS_100 (instead of PERCENT) because this can potentially
// exceed 100%.
UMA_HISTOGRAM_COUNTS_100(
"Extensions.HostedAppUnlimitedStorageTemporaryStorageUsage",
- 100.0 * usage / settings.per_host_quota);
+ 100.0 * usage / per_app_quota);
}
}
@@ -234,9 +235,12 @@ class StorageEventObserver
} else {
// We can't use the quota in the event because it assumes unlimited
// storage.
- BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
- base::Bind(&LogTemporaryStorageUsage,
- state.quota_manager, event.usage));
+ BrowserThread::PostTask(
+ BrowserThread::IO,
+ FROM_HERE,
+ base::Bind(&storage::QuotaManager::GetTemporaryGlobalQuota,
+ state.quota_manager,
+ base::Bind(&LogTemporaryStorageUsage, event.usage)));
}
}

Powered by Google App Engine
This is Rietveld 408576698