| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_USAGE_TRACKER_H_ | 5 #ifndef STORAGE_BROWSER_QUOTA_USAGE_TRACKER_H_ |
| 6 #define STORAGE_BROWSER_QUOTA_USAGE_TRACKER_H_ | 6 #define STORAGE_BROWSER_QUOTA_USAGE_TRACKER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 StorageType type() const { return type_; } | 39 StorageType type() const { return type_; } |
| 40 ClientUsageTracker* GetClientTracker(QuotaClient::ID client_id); | 40 ClientUsageTracker* GetClientTracker(QuotaClient::ID client_id); |
| 41 | 41 |
| 42 void GetGlobalLimitedUsage(const UsageCallback& callback); | 42 void GetGlobalLimitedUsage(const UsageCallback& callback); |
| 43 void GetGlobalUsage(const GlobalUsageCallback& callback); | 43 void GetGlobalUsage(const GlobalUsageCallback& callback); |
| 44 void GetHostUsage(const std::string& host, const UsageCallback& callback); | 44 void GetHostUsage(const std::string& host, const UsageCallback& callback); |
| 45 void UpdateUsageCache(QuotaClient::ID client_id, | 45 void UpdateUsageCache(QuotaClient::ID client_id, |
| 46 const GURL& origin, | 46 const GURL& origin, |
| 47 int64 delta); | 47 int64 delta); |
| 48 void GetCachedOriginsUsage(std::map<GURL, int64>* origin_usage) const; |
| 48 void GetCachedHostsUsage(std::map<std::string, int64>* host_usage) const; | 49 void GetCachedHostsUsage(std::map<std::string, int64>* host_usage) const; |
| 49 void GetCachedOrigins(std::set<GURL>* origins) const; | 50 void GetCachedOrigins(std::set<GURL>* origins) const; |
| 50 bool IsWorking() const { | 51 bool IsWorking() const { |
| 51 return global_usage_callbacks_.HasCallbacks() || | 52 return global_usage_callbacks_.HasCallbacks() || |
| 52 host_usage_callbacks_.HasAnyCallbacks(); | 53 host_usage_callbacks_.HasAnyCallbacks(); |
| 53 } | 54 } |
| 54 | 55 |
| 55 void SetUsageCacheEnabled(QuotaClient::ID client_id, | 56 void SetUsageCacheEnabled(QuotaClient::ID client_id, |
| 56 const GURL& origin, | 57 const GURL& origin, |
| 57 bool enabled); | 58 bool enabled); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 92 |
| 92 StorageMonitor* storage_monitor_; | 93 StorageMonitor* storage_monitor_; |
| 93 | 94 |
| 94 base::WeakPtrFactory<UsageTracker> weak_factory_; | 95 base::WeakPtrFactory<UsageTracker> weak_factory_; |
| 95 DISALLOW_COPY_AND_ASSIGN(UsageTracker); | 96 DISALLOW_COPY_AND_ASSIGN(UsageTracker); |
| 96 }; | 97 }; |
| 97 | 98 |
| 98 } // namespace storage | 99 } // namespace storage |
| 99 | 100 |
| 100 #endif // STORAGE_BROWSER_QUOTA_USAGE_TRACKER_H_ | 101 #endif // STORAGE_BROWSER_QUOTA_USAGE_TRACKER_H_ |
| OLD | NEW |