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

Unified Diff: webkit/quota/quota_manager.h

Issue 7039006: Implement GetUsageAndQuotaForEviction in QuotaManager. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added a TODO. Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/quota/quota_client.h ('k') | webkit/quota/quota_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/quota/quota_manager.h
diff --git a/webkit/quota/quota_manager.h b/webkit/quota/quota_manager.h
index b48ce7a695efa2fc2891075e0704f07d0afee0c5..ad993cccbdb3a804f1d003f1632a6152d9e70733 100644
--- a/webkit/quota/quota_manager.h
+++ b/webkit/quota/quota_manager.h
@@ -56,6 +56,9 @@ class QuotaEvictionHandler {
virtual void GetUsageAndQuotaForEviction(
GetUsageAndQuotaForEvictionCallback* callback) = 0;
+
+ protected:
+ virtual ~QuotaEvictionHandler() {}
};
// The quota manager class. This class is instantiated per profile and
@@ -154,6 +157,26 @@ class QuotaManager : public QuotaTaskObserver,
class AvailableSpaceQueryTask;
+ struct EvictionContext {
+ EvictionContext()
+ : num_eviction_requested_clients(0),
+ num_evicted_clients(0),
+ num_eviction_error(0),
+ usage(0),
+ quota(0) {}
+ virtual ~EvictionContext() {}
+
+ scoped_ptr<EvictOriginDataCallback> evict_origin_data_callback;
+ int num_eviction_requested_clients;
+ int num_evicted_clients;
+ int num_eviction_error;
+
+ 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;
@@ -181,6 +204,13 @@ class QuotaManager : public QuotaTaskObserver,
void DeleteOriginFromDatabase(const GURL& origin, StorageType type);
void DidOriginDataEvicted(QuotaStatusCode status);
+ void DidGetAvailableSpaceForEviction(
+ QuotaStatusCode status,
+ int64 available_space);
+ void DidGetGlobalQuotaForEviction(
+ QuotaStatusCode status,
+ int64 quota);
+ void DidGetGlobalUsageForEviction(int64 usage);
virtual void GetLRUOrigin(
StorageType type,
@@ -208,11 +238,9 @@ class QuotaManager : public QuotaTaskObserver,
scoped_ptr<UsageTracker> temporary_usage_tracker_;
scoped_ptr<UsageTracker> persistent_usage_tracker_;
- UsageAndQuotaDispatcherTaskMap usage_and_quota_dispatchers_;
+ EvictionContext eviction_context_;
- scoped_ptr<EvictOriginDataCallback> evict_origin_data_callback_;
- int num_eviction_requested_clients_;
- int num_evicted_clients_;
+ UsageAndQuotaDispatcherTaskMap usage_and_quota_dispatchers_;
int64 temporary_global_quota_;
QuotaCallbackQueue temporary_global_quota_callbacks_;
« no previous file with comments | « webkit/quota/quota_client.h ('k') | webkit/quota/quota_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698