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

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: Cleanup 2. 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
Index: webkit/quota/quota_manager.h
diff --git a/webkit/quota/quota_manager.h b/webkit/quota/quota_manager.h
index 6390b7347041da252a18aa08f32004ab4a6bed31..f288cc90a1d3a700f036cce9d92af05c25f881f7 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.
kinuko 2012/08/20 04:04:44 nit: can you also add a comment about what is call
James Hawkins 2012/08/22 18:51:36 Done.
+ GetAvailableDiskSpaceFn get_disk_space_fn_;
+
DISALLOW_COPY_AND_ASSIGN(QuotaManager);
};

Powered by Google App Engine
This is Rietveld 408576698