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

Side by Side Diff: storage/browser/quota/client_usage_tracker.h

Issue 1343273003: Integrate SiteEngagementEvictionPolicy with QuotaManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_eviction_policy
Patch Set: export Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef STORAGE_BROWSER_QUOTA_CLIENT_USAGE_TRACKER_H_ 5 #ifndef STORAGE_BROWSER_QUOTA_CLIENT_USAGE_TRACKER_H_
6 #define STORAGE_BROWSER_QUOTA_CLIENT_USAGE_TRACKER_H_ 6 #define STORAGE_BROWSER_QUOTA_CLIENT_USAGE_TRACKER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 StorageType type, 44 StorageType type,
45 SpecialStoragePolicy* special_storage_policy, 45 SpecialStoragePolicy* special_storage_policy,
46 StorageMonitor* storage_monitor); 46 StorageMonitor* storage_monitor);
47 ~ClientUsageTracker() override; 47 ~ClientUsageTracker() override;
48 48
49 void GetGlobalLimitedUsage(const UsageCallback& callback); 49 void GetGlobalLimitedUsage(const UsageCallback& callback);
50 void GetGlobalUsage(const GlobalUsageCallback& callback); 50 void GetGlobalUsage(const GlobalUsageCallback& callback);
51 void GetHostUsage(const std::string& host, const UsageCallback& callback); 51 void GetHostUsage(const std::string& host, const UsageCallback& callback);
52 void UpdateUsageCache(const GURL& origin, int64 delta); 52 void UpdateUsageCache(const GURL& origin, int64 delta);
53 void GetCachedHostsUsage(std::map<std::string, int64>* host_usage) const; 53 void GetCachedHostsUsage(std::map<std::string, int64>* host_usage) const;
54 void GetCachedOriginsUsage(std::map<GURL, int64>* origin_usage) const;
54 void GetCachedOrigins(std::set<GURL>* origins) const; 55 void GetCachedOrigins(std::set<GURL>* origins) const;
55 int64 GetCachedOriginsUsage(const std::set<GURL>& origins,
michaeln 2015/10/06 00:35:09 thnx for cleaning this up
56 std::vector<GURL>* origins_not_in_cache);
57 bool IsUsageCacheEnabledForOrigin(const GURL& origin) const; 56 bool IsUsageCacheEnabledForOrigin(const GURL& origin) const;
58 void SetUsageCacheEnabled(const GURL& origin, bool enabled); 57 void SetUsageCacheEnabled(const GURL& origin, bool enabled);
59 58
60 private: 59 private:
61 typedef CallbackQueueMap<HostUsageAccumulator, std::string, int64, int64> 60 typedef CallbackQueueMap<HostUsageAccumulator, std::string, int64, int64>
62 HostUsageAccumulatorMap; 61 HostUsageAccumulatorMap;
63 62
64 typedef std::set<std::string> HostSet; 63 typedef std::set<std::string> HostSet;
65 typedef std::map<GURL, int64> UsageMap; 64 typedef std::map<GURL, int64> UsageMap;
66 typedef std::map<std::string, UsageMap> HostUsageMap; 65 typedef std::map<std::string, UsageMap> HostUsageMap;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 HostUsageAccumulatorMap host_usage_accumulators_; 128 HostUsageAccumulatorMap host_usage_accumulators_;
130 129
131 scoped_refptr<SpecialStoragePolicy> special_storage_policy_; 130 scoped_refptr<SpecialStoragePolicy> special_storage_policy_;
132 131
133 DISALLOW_COPY_AND_ASSIGN(ClientUsageTracker); 132 DISALLOW_COPY_AND_ASSIGN(ClientUsageTracker);
134 }; 133 };
135 134
136 } // namespace storage 135 } // namespace storage
137 136
138 #endif // STORAGE_BROWSER_QUOTA_CLIENT_USAGE_TRACKER_H_ 137 #endif // STORAGE_BROWSER_QUOTA_CLIENT_USAGE_TRACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698