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

Unified Diff: webkit/quota/quota_manager.h

Issue 10826270: QuotaManager: Return the remaining free disk space as quota. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes. Created 8 years, 4 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/mock_special_storage_policy.cc ('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 6390b7347041da252a18aa08f32004ab4a6bed31..6f5b504bd426a0b5b83cb5cdb96e7f4352317c28 100644
--- a/webkit/quota/quota_manager.h
+++ b/webkit/quota/quota_manager.h
@@ -39,13 +39,13 @@ class QuotaInternalsProxy;
namespace quota {
-struct QuotaManagerDeleter;
-
+class MockQuotaManager;
class QuotaDatabase;
class QuotaManagerProxy;
class QuotaTemporaryStorageEvictor;
class UsageTracker;
-class MockQuotaManager;
+
+struct QuotaManagerDeleter;
struct QuotaAndUsage {
int64 usage;
@@ -188,6 +188,11 @@ class QuotaManager : public QuotaTaskObserver,
special_storage_policy_->IsStorageUnlimited(origin);
}
+ bool IsInstalledApp(const GURL& origin) const {
+ return special_storage_policy_.get() &&
+ special_storage_policy_->IsInstalledApp(origin);
+ }
+
virtual void GetOriginsModifiedSince(StorageType type,
base::Time modified_since,
const GetOriginsCallback& callback);
@@ -247,6 +252,10 @@ class QuotaManager : public QuotaTaskObserver,
typedef std::vector<QuotaTableEntry> QuotaTableEntries;
typedef std::vector<OriginInfoTableEntry> OriginInfoTableEntries;
+ // Function pointer type used to store the function which returns the
+ // available disk space for the disk containing the given FilePath.
+ typedef int64 (*GetAvailableDiskSpaceFn)(const FilePath&);
+
typedef base::Callback<void(const QuotaTableEntries&)>
DumpQuotaTableCallback;
typedef base::Callback<void(const OriginInfoTableEntries&)>
@@ -387,6 +396,11 @@ class QuotaManager : public QuotaTaskObserver,
base::WeakPtrFactory<QuotaManager> weak_factory_;
base::RepeatingTimer<QuotaManager> histogram_timer_;
+ // Pointer to the function used to get the available disk space. This is
+ // overwritten by QuotaManagerTest in order to attain a deterministic reported
+ // value. The default value points to base::SysInfo::AmountOfFreeDiskSpace.
+ GetAvailableDiskSpaceFn get_disk_space_fn_;
+
DISALLOW_COPY_AND_ASSIGN(QuotaManager);
};
« no previous file with comments | « webkit/quota/mock_special_storage_policy.cc ('k') | webkit/quota/quota_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698