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

Unified Diff: webkit/fileapi/sandbox_mount_point_provider.cc

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/sandbox_mount_point_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/sandbox_mount_point_provider.cc
diff --git a/webkit/fileapi/sandbox_mount_point_provider.cc b/webkit/fileapi/sandbox_mount_point_provider.cc
index dbef6c315307620fc222b286809a3706d250f4ad..1f84cf0fa65a7e25eaff4ec733e8ac5f189ebffa 100644
--- a/webkit/fileapi/sandbox_mount_point_provider.cc
+++ b/webkit/fileapi/sandbox_mount_point_provider.cc
@@ -525,10 +525,11 @@ int64 SandboxMountPointProvider::GetOriginUsageOnFileThread(
FilePath usage_file_path =
base_path.AppendASCII(FileSystemUsageCache::kUsageFileName);
+ bool is_valid = FileSystemUsageCache::IsValid(usage_file_path);
int32 dirty_status = FileSystemUsageCache::GetDirty(usage_file_path);
bool visited = (visited_origins_.find(origin_url) != visited_origins_.end());
visited_origins_.insert(origin_url);
- if (dirty_status == 0 || (dirty_status > 0 && visited)) {
+ if (is_valid && (dirty_status == 0 || (dirty_status > 0 && visited))) {
// The usage cache is clean (dirty == 0) or the origin is already
// initialized and running. Read the cache file to get the usage.
return FileSystemUsageCache::GetUsage(usage_file_path);
@@ -619,6 +620,15 @@ void SandboxMountPointProvider::EndUpdateOriginOnFileThread(
FileSystemUsageCache::DecrementDirty(usage_file_path);
}
+void SandboxMountPointProvider::InvalidateUsageCache(
+ const GURL& origin_url, fileapi::FileSystemType type) {
+ DCHECK(type == fileapi::kFileSystemTypeTemporary ||
+ type == fileapi::kFileSystemTypePersistent);
+ FilePath usage_file_path = GetUsageCachePathForOriginAndType(
+ origin_url, type);
+ FileSystemUsageCache::IncrementDirty(usage_file_path);
+}
+
FileSystemFileUtil* SandboxMountPointProvider::GetFileSystemFileUtil() {
return sandbox_file_util_.get();
}
« no previous file with comments | « webkit/fileapi/sandbox_mount_point_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698