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_QUOTA_MANAGER_H_ | 5 #ifndef WEBKIT_QUOTA_QUOTA_MANAGER_H_ |
6 #define WEBKIT_QUOTA_QUOTA_MANAGER_H_ | 6 #define WEBKIT_QUOTA_QUOTA_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <list> | 10 #include <list> |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // The client must remain valid until OnQuotaManagerDestored is called. | 168 // The client must remain valid until OnQuotaManagerDestored is called. |
169 void RegisterClient(QuotaClient* client); | 169 void RegisterClient(QuotaClient* client); |
170 | 170 |
171 UsageTracker* GetUsageTracker(StorageType type) const; | 171 UsageTracker* GetUsageTracker(StorageType type) const; |
172 | 172 |
173 void DidGetTemporaryGlobalQuota(int64 quota); | 173 void DidGetTemporaryGlobalQuota(int64 quota); |
174 | 174 |
175 // Methods for eviction logic. | 175 // Methods for eviction logic. |
176 void DeleteOriginFromDatabase(const GURL& origin, StorageType type); | 176 void DeleteOriginFromDatabase(const GURL& origin, StorageType type); |
177 | 177 |
| 178 void OnOriginDataEvicted( |
| 179 QuotaStatusCode status, |
| 180 EvictOriginDataCallback* callback); |
| 181 |
178 virtual void GetLRUOrigin( | 182 virtual void GetLRUOrigin( |
179 StorageType type, | 183 StorageType type, |
180 GetLRUOriginCallback* callback) OVERRIDE; | 184 GetLRUOriginCallback* callback) OVERRIDE; |
181 virtual void EvictOriginData( | 185 virtual void EvictOriginData( |
182 const GURL& origin, | 186 const GURL& origin, |
183 StorageType type, | 187 StorageType type, |
184 EvictOriginDataCallback* callback) OVERRIDE; | 188 EvictOriginDataCallback* callback) OVERRIDE; |
185 virtual void GetUsageAndQuotaForEviction( | 189 virtual void GetUsageAndQuotaForEviction( |
186 GetUsageAndQuotaForEvictionCallback* callback) OVERRIDE; | 190 GetUsageAndQuotaForEvictionCallback* callback) OVERRIDE; |
187 | 191 |
188 void DeleteOnCorrectThread() const; | 192 void DeleteOnCorrectThread() const; |
189 | 193 |
190 const bool is_incognito_; | 194 const bool is_incognito_; |
191 const FilePath profile_path_; | 195 const FilePath profile_path_; |
192 | 196 |
193 scoped_refptr<QuotaManagerProxy> proxy_; | 197 scoped_refptr<QuotaManagerProxy> proxy_; |
194 bool db_disabled_; | 198 bool db_disabled_; |
195 scoped_refptr<base::MessageLoopProxy> io_thread_; | 199 scoped_refptr<base::MessageLoopProxy> io_thread_; |
196 scoped_refptr<base::MessageLoopProxy> db_thread_; | 200 scoped_refptr<base::MessageLoopProxy> db_thread_; |
197 mutable scoped_ptr<QuotaDatabase> database_; | 201 mutable scoped_ptr<QuotaDatabase> database_; |
198 | 202 |
199 QuotaClientList clients_; | 203 QuotaClientList clients_; |
200 | 204 |
201 scoped_ptr<UsageTracker> temporary_usage_tracker_; | 205 scoped_ptr<UsageTracker> temporary_usage_tracker_; |
202 scoped_ptr<UsageTracker> persistent_usage_tracker_; | 206 scoped_ptr<UsageTracker> persistent_usage_tracker_; |
203 | 207 |
204 UsageAndQuotaDispatcherTaskMap usage_and_quota_dispatchers_; | 208 UsageAndQuotaDispatcherTaskMap usage_and_quota_dispatchers_; |
205 | 209 |
| 210 int num_deletion_requested_clients_; |
| 211 int num_deleted_clients_; |
| 212 |
206 int64 temporary_global_quota_; | 213 int64 temporary_global_quota_; |
207 QuotaCallbackQueue temporary_global_quota_callbacks_; | 214 QuotaCallbackQueue temporary_global_quota_callbacks_; |
208 | 215 |
209 // Map from origin to count. | 216 // Map from origin to count. |
210 std::map<GURL, int> origins_in_use_; | 217 std::map<GURL, int> origins_in_use_; |
211 | 218 |
212 DISALLOW_COPY_AND_ASSIGN(QuotaManager); | 219 DISALLOW_COPY_AND_ASSIGN(QuotaManager); |
213 }; | 220 }; |
214 | 221 |
215 struct QuotaManagerDeleter { | 222 struct QuotaManagerDeleter { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 QuotaManager* manager_; // only accessed on the io thread | 254 QuotaManager* manager_; // only accessed on the io thread |
248 scoped_refptr<base::MessageLoopProxy> io_thread_; | 255 scoped_refptr<base::MessageLoopProxy> io_thread_; |
249 | 256 |
250 DISALLOW_COPY_AND_ASSIGN(QuotaManagerProxy); | 257 DISALLOW_COPY_AND_ASSIGN(QuotaManagerProxy); |
251 }; | 258 }; |
252 | 259 |
253 | 260 |
254 } // namespace quota | 261 } // namespace quota |
255 | 262 |
256 #endif // WEBKIT_QUOTA_QUOTA_MANAGER_H_ | 263 #endif // WEBKIT_QUOTA_QUOTA_MANAGER_H_ |
OLD | NEW |