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

Unified Diff: webkit/quota/quota_manager.h

Issue 7029009: Add an interface QuotaEvictionHandler. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Just rebased. 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 | « no previous file | 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 955cab5b10adeb9d418e97ede2552d2bcf646f1f..e3375cc52bc99074d92f10f37596a71be3614fed 100644
--- a/webkit/quota/quota_manager.h
+++ b/webkit/quota/quota_manager.h
@@ -34,10 +34,35 @@ class UsageTracker;
struct QuotaManagerDeleter;
class QuotaManagerProxy;
+// An interface called by QuotaTemporaryStorageEvictor.
+class QuotaEvictionHandler {
+ public:
+ typedef Callback1<GURL>::Type GetLRUOriginCallback;
+ typedef Callback1<QuotaStatusCode>::Type EvictOriginDataCallback;
+ typedef Callback4<QuotaStatusCode,
+ int64 /* usage */,
+ int64 /* quota */,
+ int64 /* physical_available */ >::Type
+ GetUsageAndQuotaForEvictionCallback;
+
+ virtual void GetLRUOrigin(
+ StorageType type,
+ GetLRUOriginCallback* callback) = 0;
+
+ virtual void EvictOriginData(
+ const GURL& origin,
+ StorageType type,
+ EvictOriginDataCallback* callback) = 0;
+
+ virtual void GetUsageAndQuotaForEviction(
+ GetUsageAndQuotaForEvictionCallback* callback) = 0;
+};
+
// The quota manager class. This class is instantiated per profile and
// 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:
@@ -46,7 +71,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,
@@ -150,7 +174,16 @@ class QuotaManager : public QuotaTaskObserver,
// Methods for eviction logic.
void DeleteOriginFromDatabase(const GURL& origin, StorageType type);
- void GetLRUOrigin(StorageType type, GetLRUOriginCallback* callback);
+
+ virtual void GetLRUOrigin(
+ StorageType type,
+ GetLRUOriginCallback* callback) OVERRIDE;
+ virtual void EvictOriginData(
+ const GURL& origin,
+ StorageType type,
+ EvictOriginDataCallback* callback) OVERRIDE;
+ virtual void GetUsageAndQuotaForEviction(
+ GetUsageAndQuotaForEvictionCallback* callback) OVERRIDE;
void DeleteOnCorrectThread() const;
« no previous file with comments | « no previous file | webkit/quota/quota_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698