Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Side by Side Diff: webkit/quota/usage_tracker.h

Issue 15907004: [Quota] Add UsageTracker::GetGlobalLimitedUsage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: +LazyInitialize Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/quota/quota_temporary_storage_evictor_unittest.cc ('k') | webkit/quota/usage_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « webkit/quota/quota_temporary_storage_evictor_unittest.cc ('k') | webkit/quota/usage_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698