| 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 WEBKIT_BROWSER_QUOTA_USAGE_TRACKER_H_ | 5 #ifndef WEBKIT_BROWSER_QUOTA_USAGE_TRACKER_H_ |
| 6 #define WEBKIT_BROWSER_QUOTA_USAGE_TRACKER_H_ | 6 #define WEBKIT_BROWSER_QUOTA_USAGE_TRACKER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/threading/non_thread_safe.h" | 16 #include "base/threading/non_thread_safe.h" |
| 17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 18 #include "webkit/browser/quota/quota_callbacks.h" | 18 #include "webkit/browser/quota/quota_callbacks.h" |
| 19 #include "webkit/browser/quota/quota_client.h" | 19 #include "webkit/browser/quota/quota_client.h" |
| 20 #include "webkit/browser/quota/quota_task.h" | 20 #include "webkit/browser/quota/quota_task.h" |
| 21 #include "webkit/browser/quota/special_storage_policy.h" | 21 #include "webkit/browser/quota/special_storage_policy.h" |
| 22 #include "webkit/browser/webkit_storage_browser_export.h" |
| 22 #include "webkit/common/quota/quota_types.h" | 23 #include "webkit/common/quota/quota_types.h" |
| 23 | 24 |
| 24 namespace quota { | 25 namespace quota { |
| 25 | 26 |
| 26 class ClientUsageTracker; | 27 class ClientUsageTracker; |
| 27 | 28 |
| 28 // A helper class that gathers and tracks the amount of data stored in | 29 // A helper class that gathers and tracks the amount of data stored in |
| 29 // all quota clients. | 30 // all quota clients. |
| 30 // An instance of this class is created per storage type. | 31 // An instance of this class is created per storage type. |
| 31 class WEBKIT_STORAGE_EXPORT UsageTracker : public QuotaTaskObserver { | 32 class WEBKIT_STORAGE_BROWSER_EXPORT UsageTracker : public QuotaTaskObserver { |
| 32 public: | 33 public: |
| 33 UsageTracker(const QuotaClientList& clients, StorageType type, | 34 UsageTracker(const QuotaClientList& clients, StorageType type, |
| 34 SpecialStoragePolicy* special_storage_policy); | 35 SpecialStoragePolicy* special_storage_policy); |
| 35 virtual ~UsageTracker(); | 36 virtual ~UsageTracker(); |
| 36 | 37 |
| 37 StorageType type() const { return type_; } | 38 StorageType type() const { return type_; } |
| 38 ClientUsageTracker* GetClientTracker(QuotaClient::ID client_id); | 39 ClientUsageTracker* GetClientTracker(QuotaClient::ID client_id); |
| 39 | 40 |
| 40 void GetGlobalLimitedUsage(const UsageCallback& callback); | 41 void GetGlobalLimitedUsage(const UsageCallback& callback); |
| 41 void GetGlobalUsage(const GlobalUsageCallback& callback); | 42 void GetGlobalUsage(const GlobalUsageCallback& callback); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 HostUsageAccumulatorMap host_usage_accumulators_; | 185 HostUsageAccumulatorMap host_usage_accumulators_; |
| 185 | 186 |
| 186 scoped_refptr<SpecialStoragePolicy> special_storage_policy_; | 187 scoped_refptr<SpecialStoragePolicy> special_storage_policy_; |
| 187 | 188 |
| 188 DISALLOW_COPY_AND_ASSIGN(ClientUsageTracker); | 189 DISALLOW_COPY_AND_ASSIGN(ClientUsageTracker); |
| 189 }; | 190 }; |
| 190 | 191 |
| 191 } // namespace quota | 192 } // namespace quota |
| 192 | 193 |
| 193 #endif // WEBKIT_BROWSER_QUOTA_USAGE_TRACKER_H_ | 194 #endif // WEBKIT_BROWSER_QUOTA_USAGE_TRACKER_H_ |
| OLD | NEW |