| 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();
|
| }
|
|
|