Index: storage/browser/quota/client_usage_tracker.cc |
diff --git a/storage/browser/quota/client_usage_tracker.cc b/storage/browser/quota/client_usage_tracker.cc |
index c9c46f6d1a02abd845604ebcc3522add49ec5af7..c5a17a54ae30698492ece16b8ea3b4dd26fb9d5b 100644 |
--- a/storage/browser/quota/client_usage_tracker.cc |
+++ b/storage/browser/quota/client_usage_tracker.cc |
@@ -165,6 +165,15 @@ void ClientUsageTracker::UpdateUsageCache(const GURL& origin, int64_t delta) { |
AsWeakPtr(), origin)); |
} |
+int64_t ClientUsageTracker::GetCachedUsage() const { |
+ int64_t usage = 0; |
+ for (const auto& host_and_usage_map : cached_usage_by_host_) { |
+ for (const auto& origin_and_usage : host_and_usage_map.second) |
+ usage += origin_and_usage.second; |
+ } |
+ return usage; |
+} |
+ |
void ClientUsageTracker::GetCachedHostsUsage( |
std::map<std::string, int64_t>* host_usage) const { |
DCHECK(host_usage); |