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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 struct AccumulateInfo { | 119 struct AccumulateInfo { |
120 int pending_jobs; | 120 int pending_jobs; |
121 int64 cached_usage; | 121 int64 cached_usage; |
122 int64 non_cached_usage; | 122 int64 non_cached_usage; |
123 | 123 |
124 AccumulateInfo() : pending_jobs(0), cached_usage(0), non_cached_usage(0) {} | 124 AccumulateInfo() : pending_jobs(0), cached_usage(0), non_cached_usage(0) {} |
125 }; | 125 }; |
126 | 126 |
127 void DidGetOriginsForGlobalUsage(const GlobalUsageCallback& callback, | 127 void DidGetOriginsForGlobalUsage(const GlobalUsageCallback& callback, |
128 const std::set<GURL>& origins, | 128 const std::set<GURL>& origins); |
129 StorageType type); | |
130 void AccumulateHostUsage(AccumulateInfo* info, | 129 void AccumulateHostUsage(AccumulateInfo* info, |
131 const GlobalUsageCallback& callback, | 130 const GlobalUsageCallback& callback, |
132 int64 cached_usage, | 131 int64 cached_usage, |
133 int64 non_cached_usage); | 132 int64 non_cached_usage); |
134 | 133 |
135 void DidGetOriginsForHostUsage(const std::string& host, | 134 void DidGetOriginsForHostUsage(const std::string& host, |
136 const std::set<GURL>& origins, | 135 const std::set<GURL>& origins); |
137 StorageType type); | |
138 | 136 |
139 void GetUsageForOrigins(const std::string& host, | 137 void GetUsageForOrigins(const std::string& host, |
140 const std::set<GURL>& origins); | 138 const std::set<GURL>& origins); |
141 void AccumulateOriginUsage(AccumulateInfo* info, | 139 void AccumulateOriginUsage(AccumulateInfo* info, |
142 const std::string& host, | 140 const std::string& host, |
143 const GURL& origin, | 141 const GURL& origin, |
144 int64 usage); | 142 int64 usage); |
145 | 143 |
146 // Methods used by our GatherUsage tasks, as a task makes progress | 144 // Methods used by our GatherUsage tasks, as a task makes progress |
147 // origins and hosts are added incrementally to the cache. | 145 // origins and hosts are added incrementally to the cache. |
(...skipping 27 matching lines...) Expand all Loading... |
175 HostUsageAccumulatorMap host_usage_accumulators_; | 173 HostUsageAccumulatorMap host_usage_accumulators_; |
176 | 174 |
177 scoped_refptr<SpecialStoragePolicy> special_storage_policy_; | 175 scoped_refptr<SpecialStoragePolicy> special_storage_policy_; |
178 | 176 |
179 DISALLOW_COPY_AND_ASSIGN(ClientUsageTracker); | 177 DISALLOW_COPY_AND_ASSIGN(ClientUsageTracker); |
180 }; | 178 }; |
181 | 179 |
182 } // namespace quota | 180 } // namespace quota |
183 | 181 |
184 #endif // WEBKIT_QUOTA_USAGE_TRACKER_H_ | 182 #endif // WEBKIT_QUOTA_USAGE_TRACKER_H_ |
OLD | NEW |