Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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_ |
| OLD | NEW |