OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 WEBKIT_QUOTA_USAGE_TRACKER_H_ | 5 #ifndef WEBKIT_QUOTA_USAGE_TRACKER_H_ |
6 #define WEBKIT_QUOTA_USAGE_TRACKER_H_ | 6 #define WEBKIT_QUOTA_USAGE_TRACKER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 18 matching lines...) Expand all Loading... |
29 // An instance of this class is created per storage type. | 29 // An instance of this class is created per storage type. |
30 class WEBKIT_STORAGE_EXPORT UsageTracker : public QuotaTaskObserver { | 30 class WEBKIT_STORAGE_EXPORT UsageTracker : public QuotaTaskObserver { |
31 public: | 31 public: |
32 UsageTracker(const QuotaClientList& clients, StorageType type, | 32 UsageTracker(const QuotaClientList& clients, StorageType type, |
33 SpecialStoragePolicy* special_storage_policy); | 33 SpecialStoragePolicy* special_storage_policy); |
34 virtual ~UsageTracker(); | 34 virtual ~UsageTracker(); |
35 | 35 |
36 StorageType type() const { return type_; } | 36 StorageType type() const { return type_; } |
37 ClientUsageTracker* GetClientTracker(QuotaClient::ID client_id); | 37 ClientUsageTracker* GetClientTracker(QuotaClient::ID client_id); |
38 | 38 |
| 39 void GetGlobalLimitedUsage(const UsageCallback& callback); |
39 void GetGlobalUsage(const GlobalUsageCallback& callback); | 40 void GetGlobalUsage(const GlobalUsageCallback& callback); |
40 void GetHostUsage(const std::string& host, const UsageCallback& callback); | 41 void GetHostUsage(const std::string& host, const UsageCallback& callback); |
41 void UpdateUsageCache(QuotaClient::ID client_id, | 42 void UpdateUsageCache(QuotaClient::ID client_id, |
42 const GURL& origin, | 43 const GURL& origin, |
43 int64 delta); | 44 int64 delta); |
44 void GetCachedHostsUsage(std::map<std::string, int64>* host_usage) const; | 45 void GetCachedHostsUsage(std::map<std::string, int64>* host_usage) const; |
45 void GetCachedOrigins(std::set<GURL>* origins) const; | 46 void GetCachedOrigins(std::set<GURL>* origins) const; |
46 bool IsWorking() const { | 47 bool IsWorking() const { |
47 return global_usage_callbacks_.HasCallbacks() || | 48 return global_usage_callbacks_.HasCallbacks() || |
48 host_usage_callbacks_.HasAnyCallbacks(); | 49 host_usage_callbacks_.HasAnyCallbacks(); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 HostUsageAccumulatorMap host_usage_accumulators_; | 177 HostUsageAccumulatorMap host_usage_accumulators_; |
177 | 178 |
178 scoped_refptr<SpecialStoragePolicy> special_storage_policy_; | 179 scoped_refptr<SpecialStoragePolicy> special_storage_policy_; |
179 | 180 |
180 DISALLOW_COPY_AND_ASSIGN(ClientUsageTracker); | 181 DISALLOW_COPY_AND_ASSIGN(ClientUsageTracker); |
181 }; | 182 }; |
182 | 183 |
183 } // namespace quota | 184 } // namespace quota |
184 | 185 |
185 #endif // WEBKIT_QUOTA_USAGE_TRACKER_H_ | 186 #endif // WEBKIT_QUOTA_USAGE_TRACKER_H_ |
OLD | NEW |