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

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: 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 cc8bf6b38d23a8bba4c165e0950ab73cd5ab18d5..ae3eb3087f5bf732dbd2e6e51023cb1df39cb0b1 100644
--- a/webkit/quota/quota_manager.h
+++ b/webkit/quota/quota_manager.h
@@ -34,10 +34,33 @@ class UsageTracker;
struct QuotaManagerDeleter;
class QuotaManagerProxy;
+// An interface called by QuotaTemporaryStorageEvictor.
+class QuotaEvictionHandler {
+ public:
+ typedef Callback1<GURL>::Type GetLRUOriginCallback;
+ typedef Callback4<QuotaStatusCode,
+ int64 /* usage */,
+ int64 /* quota */,
+ int64 /* physical_avail */ >::Type DeleteOriginDataCallback;
kinuko 2011/05/16 13:57:44 This callback being used for GetUsageAndQuotaForEv
+
+ virtual void GetUsageAndQuotaForEviction(
+ DeleteOriginDataCallback* callback) = 0;
+
+ virtual void DeleteOriginData(
+ const GURL& origin,
+ StorageType type,
+ DeleteOriginDataCallback* callback) = 0;
+
+ virtual void GetLRUOrigin(
+ StorageType type,
+ GetLRUOriginCallback* 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:
@@ -142,10 +165,17 @@ 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;
+
kinuko 2011/05/16 13:57:44 style-nit: no empty lines between OVERRIDE methods
+ virtual void GetUsageAndQuotaForEviction(
+ DeleteOriginDataCallback* callback) OVERRIDE;
+
+ virtual void DeleteOriginData(
+ const GURL& origin,
+ StorageType type,
+ DeleteOriginDataCallback* callback) OVERRIDE;
UsageTracker* GetUsageTracker(StorageType type) 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