| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 GlobalUsageCallbackQueue global_usage_callbacks_; | 73 GlobalUsageCallbackQueue global_usage_callbacks_; |
| 74 HostUsageCallbackMap host_usage_callbacks_; | 74 HostUsageCallbackMap host_usage_callbacks_; |
| 75 | 75 |
| 76 base::WeakPtrFactory<UsageTracker> weak_factory_; | 76 base::WeakPtrFactory<UsageTracker> weak_factory_; |
| 77 DISALLOW_COPY_AND_ASSIGN(UsageTracker); | 77 DISALLOW_COPY_AND_ASSIGN(UsageTracker); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 // This class holds per-client usage tracking information and caches per-host | 80 // This class holds per-client usage tracking information and caches per-host |
| 81 // usage data. An instance of this class is created per client. | 81 // usage data. An instance of this class is created per client. |
| 82 class ClientUsageTracker : public SpecialStoragePolicy::Observer, | 82 class ClientUsageTracker : public SpecialStoragePolicy::Observer, |
| 83 public base::NonThreadSafe { | 83 public base::NonThreadSafe, |
| 84 public base::SupportsWeakPtr<ClientUsageTracker> { |
| 84 public: | 85 public: |
| 85 ClientUsageTracker(UsageTracker* tracker, | 86 ClientUsageTracker(UsageTracker* tracker, |
| 86 QuotaClient* client, | 87 QuotaClient* client, |
| 87 StorageType type, | 88 StorageType type, |
| 88 SpecialStoragePolicy* special_storage_policy); | 89 SpecialStoragePolicy* special_storage_policy); |
| 89 virtual ~ClientUsageTracker(); | 90 virtual ~ClientUsageTracker(); |
| 90 | 91 |
| 91 void GetGlobalUsage(const GlobalUsageCallback& callback); | 92 void GetGlobalUsage(const GlobalUsageCallback& callback); |
| 92 void GetHostUsage(const std::string& host, const HostUsageCallback& callback); | 93 void GetHostUsage(const std::string& host, const HostUsageCallback& callback); |
| 93 void UpdateUsageCache(const GURL& origin, int64 delta); | 94 void UpdateUsageCache(const GURL& origin, int64 delta); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 HostUsageCallbackMap host_usage_callbacks_; | 135 HostUsageCallbackMap host_usage_callbacks_; |
| 135 | 136 |
| 136 scoped_refptr<SpecialStoragePolicy> special_storage_policy_; | 137 scoped_refptr<SpecialStoragePolicy> special_storage_policy_; |
| 137 | 138 |
| 138 DISALLOW_COPY_AND_ASSIGN(ClientUsageTracker); | 139 DISALLOW_COPY_AND_ASSIGN(ClientUsageTracker); |
| 139 }; | 140 }; |
| 140 | 141 |
| 141 } // namespace quota | 142 } // namespace quota |
| 142 | 143 |
| 143 #endif // WEBKIT_QUOTA_USAGE_TRACKER_H_ | 144 #endif // WEBKIT_QUOTA_USAGE_TRACKER_H_ |
| OLD | NEW |