| 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 GetUsageForCachedOrigins(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, | 56 int64 GetCachedOriginsUsage(const std::set<GURL>& origins, |
| 56 std::vector<GURL>* origins_not_in_cache); | 57 std::vector<GURL>* origins_not_in_cache); |
| 57 bool IsUsageCacheEnabledForOrigin(const GURL& origin) const; | 58 bool IsUsageCacheEnabledForOrigin(const GURL& origin) const; |
| 58 void SetUsageCacheEnabled(const GURL& origin, bool enabled); | 59 void SetUsageCacheEnabled(const GURL& origin, bool enabled); |
| 59 | 60 |
| 60 private: | 61 private: |
| 61 typedef CallbackQueueMap<HostUsageAccumulator, std::string, int64, int64> | 62 typedef CallbackQueueMap<HostUsageAccumulator, std::string, int64, int64> |
| 62 HostUsageAccumulatorMap; | 63 HostUsageAccumulatorMap; |
| 63 | 64 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 HostUsageAccumulatorMap host_usage_accumulators_; | 130 HostUsageAccumulatorMap host_usage_accumulators_; |
| 130 | 131 |
| 131 scoped_refptr<SpecialStoragePolicy> special_storage_policy_; | 132 scoped_refptr<SpecialStoragePolicy> special_storage_policy_; |
| 132 | 133 |
| 133 DISALLOW_COPY_AND_ASSIGN(ClientUsageTracker); | 134 DISALLOW_COPY_AND_ASSIGN(ClientUsageTracker); |
| 134 }; | 135 }; |
| 135 | 136 |
| 136 } // namespace storage | 137 } // namespace storage |
| 137 | 138 |
| 138 #endif // STORAGE_BROWSER_QUOTA_CLIENT_USAGE_TRACKER_H_ | 139 #endif // STORAGE_BROWSER_QUOTA_CLIENT_USAGE_TRACKER_H_ |
| OLD | NEW |