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

Unified Diff: storage/browser/quota/client_usage_tracker.cc

Issue 1343273003: Integrate SiteEngagementEvictionPolicy with QuotaManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_eviction_policy
Patch Set: address comments Created 5 years, 3 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
« no previous file with comments | « storage/browser/quota/client_usage_tracker.h ('k') | storage/browser/quota/quota_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 968b35181a18aaa0651d3dd75dbe46174e5c7541..7f65612a5573f445678bce8f17af1d988f0d22a5 100644
--- a/storage/browser/quota/client_usage_tracker.cc
+++ b/storage/browser/quota/client_usage_tracker.cc
@@ -169,10 +169,20 @@ void ClientUsageTracker::GetCachedHostsUsage(
DCHECK(host_usage);
for (const auto& host_and_usage_map : cached_usage_by_host_) {
const std::string& host = host_and_usage_map.first;
+ LOG(ERROR) << host;
raymes 2015/09/23 01:56:14 nit: remove this
calamity 2015/09/23 02:15:56 Done.
(*host_usage)[host] += GetCachedHostUsage(host);
}
}
+void ClientUsageTracker::GetUsageForCachedOrigins(
+ std::map<GURL, int64>* origin_usage) const {
+ DCHECK(origin_usage);
+ for (const auto& host_and_usage_map : cached_usage_by_host_) {
+ for (const auto& origin_and_usage : host_and_usage_map.second)
+ (*origin_usage)[origin_and_usage.first] += origin_and_usage.second;
+ }
+}
+
void ClientUsageTracker::GetCachedOrigins(std::set<GURL>* origins) const {
DCHECK(origins);
for (const auto& host_and_usage_map : cached_usage_by_host_) {
« no previous file with comments | « storage/browser/quota/client_usage_tracker.h ('k') | storage/browser/quota/quota_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698