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

Unified Diff: webkit/fileapi/file_system_usage_cache.h

Issue 7608018: Handle inconsistency between DB and Files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed regression Created 9 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/fileapi/file_system_quota_util.h ('k') | webkit/fileapi/file_system_usage_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/file_system_usage_cache.h
diff --git a/webkit/fileapi/file_system_usage_cache.h b/webkit/fileapi/file_system_usage_cache.h
index 7c38bfbf8db77a407fabe633bfb15fd0e3345ce5..71198abd964239dd8ff1a1418a7f5e9ba15d1e45 100644
--- a/webkit/fileapi/file_system_usage_cache.h
+++ b/webkit/fileapi/file_system_usage_cache.h
@@ -12,8 +12,9 @@ namespace fileapi {
class FileSystemUsageCache {
public:
- // Gets the size described in the .usage file even if dirty > 0.
- // Returns less than zero if the .usage file is not available.
+ // Gets the size described in the .usage file even if dirty > 0 or
+ // is_valid == false. Returns less than zero if the .usage file is not
+ // available.
static int64 GetUsage(const FilePath& usage_file_path);
// Gets the dirty count in the .usage file.
@@ -25,6 +26,11 @@ class FileSystemUsageCache {
static bool IncrementDirty(const FilePath& usage_file_path);
static bool DecrementDirty(const FilePath& usage_file_path);
+ // Notifies quota system that it needs to recalculate the usage cache of the
+ // origin. Returns false if no .usage is available.
+ static bool Invalidate(const FilePath& usage_file_path);
+ static bool IsValid(const FilePath& usage_file_path);
+
// Updates the size described in the .usage file.
static int UpdateUsage(const FilePath& usage_file_path, int64 fs_usage);
@@ -42,12 +48,16 @@ class FileSystemUsageCache {
static const int kUsageFileHeaderSize;
private:
- // Read the size and the "dirty" entry described in the .usage file.
+ // Read the size, validity and the "dirty" entry described in the .usage file.
// Returns less than zero if no .usage file is available.
- static int64 Read(const FilePath& usage_file_path, uint32* dirty);
+ static int64 Read(const FilePath& usage_file_path,
+ bool* is_valid,
+ uint32* dirty);
static int Write(const FilePath& usage_file_path,
- uint32 dirty, int64 fs_usage);
+ bool is_valid,
+ uint32 dirty,
+ int64 fs_usage);
};
} // namespace fileapi
« no previous file with comments | « webkit/fileapi/file_system_quota_util.h ('k') | webkit/fileapi/file_system_usage_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698