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

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: Implemented it and added a test. 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') | webkit/quota/quota_manager.cc » ('J')
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 ff199d0716800b218dff1be6d7d7cec6457cf474..223d14cbec9a1802bfbcedce21088367eed79aa8 100644
--- a/webkit/quota/quota_manager.h
+++ b/webkit/quota/quota_manager.h
@@ -160,6 +160,7 @@ class QuotaManager : public QuotaTaskObserver,
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 +180,14 @@ class QuotaManager : public QuotaTaskObserver,
// Methods for eviction logic.
void DeleteOriginFromDatabase(const GURL& origin, StorageType type);
+ void OnGetAvailableSpaceForEviction(
+ QuotaStatusCode status,
+ int64 available_space);
+ void OnGetGlobalQuotaForEviction(
+ QuotaStatusCode status,
+ int64 quota);
+ void OnGetGlobalUsageForEviction(int64 usage);
+
virtual void GetLRUOrigin(
StorageType type,
GetLRUOriginCallback* callback) OVERRIDE;
@@ -205,6 +214,11 @@ class QuotaManager : public QuotaTaskObserver,
scoped_ptr<UsageTracker> temporary_usage_tracker_;
scoped_ptr<UsageTracker> persistent_usage_tracker_;
+ scoped_ptr<GetUsageAndQuotaForEvictionCallback>
+ get_usage_and_quota_for_eviction_callback_;
+ int64 usage_for_eviction_;
+ int64 quota_for_eviction_;
+
UsageAndQuotaDispatcherTaskMap usage_and_quota_dispatchers_;
int64 temporary_global_quota_;
@@ -213,6 +227,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);
};
« no previous file with comments | « no previous file | webkit/quota/quota_manager.cc » ('j') | webkit/quota/quota_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698