Index: webkit/quota/quota_manager.h |
diff --git a/webkit/quota/quota_manager.h b/webkit/quota/quota_manager.h |
index ff199d0716800b218dff1be6d7d7cec6457cf474..bdd6b1d6b7b0fa071027b34058fa5d81457484ea 100644 |
--- a/webkit/quota/quota_manager.h |
+++ b/webkit/quota/quota_manager.h |
@@ -154,12 +154,24 @@ class QuotaManager : public QuotaTaskObserver, |
class AvailableSpaceQueryTask; |
+ struct EvictionContext { |
+ EvictionContext() |
+ : usage(0), |
+ quota(0) {} |
+ |
+ scoped_ptr<GetUsageAndQuotaForEvictionCallback> |
+ get_usage_and_quota_callback; |
+ int64 usage; |
+ int64 quota; |
+ }; |
+ |
typedef std::pair<std::string, StorageType> HostAndType; |
typedef std::map<HostAndType, UsageAndQuotaDispatcherTask*> |
UsageAndQuotaDispatcherTaskMap; |
friend struct QuotaManagerDeleter; |
friend class QuotaManagerProxy; |
+ friend class QuotaManagerTest; |
// This initialization method is lazily called on the IO thread |
// when the first quota manager API is called. |
@@ -179,6 +191,14 @@ class QuotaManager : public QuotaTaskObserver, |
// Methods for eviction logic. |
void DeleteOriginFromDatabase(const GURL& origin, StorageType type); |
+ void DidGetAvailableSpaceForEviction( |
+ QuotaStatusCode status, |
+ int64 available_space); |
+ void DidGetGlobalQuotaForEviction( |
+ QuotaStatusCode status, |
+ int64 quota); |
+ void DidGetGlobalUsageForEviction(int64 usage); |
+ |
virtual void GetLRUOrigin( |
StorageType type, |
GetLRUOriginCallback* callback) OVERRIDE; |
@@ -205,6 +225,8 @@ class QuotaManager : public QuotaTaskObserver, |
scoped_ptr<UsageTracker> temporary_usage_tracker_; |
scoped_ptr<UsageTracker> persistent_usage_tracker_; |
+ EvictionContext eviction_context_; |
+ |
UsageAndQuotaDispatcherTaskMap usage_and_quota_dispatchers_; |
int64 temporary_global_quota_; |
@@ -213,6 +235,8 @@ class QuotaManager : public QuotaTaskObserver, |
// Map from origin to count. |
std::map<GURL, int> origins_in_use_; |
+ base::ScopedCallbackFactory<QuotaManager> callback_factory_; |
+ |
DISALLOW_COPY_AND_ASSIGN(QuotaManager); |
}; |