Chromium Code Reviews| Index: webkit/quota/quota_manager.h |
| diff --git a/webkit/quota/quota_manager.h b/webkit/quota/quota_manager.h |
| index e50a58f75e07d22843ad9709a3a42e7d9d1207ab..8e569cd585a67cc536d73970a2a924d646dc91dc 100644 |
| --- a/webkit/quota/quota_manager.h |
| +++ b/webkit/quota/quota_manager.h |
| @@ -29,6 +29,7 @@ class FilePath; |
| namespace quota { |
| class QuotaDatabase; |
| +class QuotaTemporaryStorageEvictor; |
| class UsageTracker; |
| struct QuotaManagerDeleter; |
| @@ -60,6 +61,7 @@ class QuotaEvictionHandler { |
| // held by the profile. With the exception of the constructor and the |
| // proxy() method, all methods should only be called on the IO thread. |
| class QuotaManager : public QuotaTaskObserver, |
| + public QuotaEvictionHandler, |
| public base::RefCountedThreadSafe< |
| QuotaManager, QuotaManagerDeleter> { |
| public: |
| @@ -68,7 +70,6 @@ class QuotaManager : public QuotaTaskObserver, |
| int64 /* quota */>::Type GetUsageAndQuotaCallback; |
| typedef Callback2<QuotaStatusCode, |
| int64 /* granted_quota */>::Type RequestQuotaCallback; |
| - typedef Callback1<GURL>::Type GetLRUOriginCallback; |
| QuotaManager(bool is_incognito, |
| const FilePath& profile_path, |
| @@ -129,6 +130,10 @@ class QuotaManager : public QuotaTaskObserver, |
| void GetHostUsage(const std::string& host, StorageType type, |
| HostUsageCallback* callback); |
| + // TODO(dmikurube): Make it a friend? |
| + void RegisterTemporaryStorageEvictor( |
| + scoped_refptr<QuotaTemporaryStorageEvictor> temporary_storage_evictor); |
| + |
| static const int64 kTemporaryStorageQuotaDefaultSize; |
| static const int64 kTemporaryStorageQuotaMaxSize; |
| static const char kDatabaseName[]; |
| @@ -152,6 +157,7 @@ class QuotaManager : public QuotaTaskObserver, |
| friend struct QuotaManagerDeleter; |
| friend class QuotaManagerProxy; |
| + friend class QuotaTemporaryStorageEvictor; |
| // This initialization method is lazily called on the IO thread |
| // when the first quota manager API is called. |
| @@ -164,10 +170,23 @@ class QuotaManager : public QuotaTaskObserver, |
| // The client must remain valid until OnQuotaManagerDestored is called. |
| void RegisterClient(QuotaClient* client); |
| - // TODO(dmikurube): Add a test for this method. |
| virtual void GetLRUOrigin( |
| StorageType type, |
| - GetLRUOriginCallback* callback); |
| + GetLRUOriginCallback* callback) OVERRIDE; |
| + |
| + void StartEviction(); |
| + |
| + virtual void GetUsageAndQuotaForEviction( |
| + DeleteOriginDataCallback* callback) OVERRIDE; |
| + |
| + void OnOriginDataDeleted( |
| + QuotaStatusCode status, |
| + DeleteOriginDataCallback* callback); |
| + |
| + virtual void DeleteOriginData( |
| + const GURL& origin, |
| + StorageType type, |
| + DeleteOriginDataCallback* callback) OVERRIDE; |
|
kinuko
2011/05/16 13:48:01
style-nit: Can you put derived methods together wi
Dai Mikurube (NOT FULLTIME)
2011/05/17 09:18:40
Done.
|
| UsageTracker* GetUsageTracker(StorageType type) const; |
| @@ -189,9 +208,13 @@ class QuotaManager : public QuotaTaskObserver, |
| scoped_ptr<UsageTracker> temporary_usage_tracker_; |
| scoped_ptr<UsageTracker> persistent_usage_tracker_; |
| + scoped_refptr<QuotaTemporaryStorageEvictor> temporary_storage_evictor_; |
| UsageAndQuotaDispatcherTaskMap usage_and_quota_dispatchers_; |
| + int num_deletion_requested_clients_; |
| + int num_deleted_clients_; |
| + |
| int64 temporary_global_quota_; |
| QuotaCallbackQueue temporary_global_quota_callbacks_; |