Index: webkit/fileapi/file_system_usage_cache.cc |
diff --git a/webkit/fileapi/file_system_usage_cache.cc b/webkit/fileapi/file_system_usage_cache.cc |
index d1bc5c03fc9ca4b5259ccea5c0a0ee56e6d1cfb2..ba489be16477ebdd1fe9b1ea0b11f9c2424b7c38 100644 |
--- a/webkit/fileapi/file_system_usage_cache.cc |
+++ b/webkit/fileapi/file_system_usage_cache.cc |
@@ -4,6 +4,7 @@ |
#include "webkit/fileapi/file_system_usage_cache.h" |
+#include "base/compiler_specific.h" |
#include "base/file_path.h" |
#include "base/file_util.h" |
#include "base/pickle.h" |
@@ -86,7 +87,10 @@ bool FileSystemUsageCache::Invalidate(const FilePath& usage_file_path) { |
bool FileSystemUsageCache::IsValid(const FilePath& usage_file_path) { |
bool is_valid = true; |
uint32 dirty = 0; |
- Read(usage_file_path, &is_valid, &dirty); |
+ int64 result = Read(usage_file_path, &is_valid, &dirty); |
+ if (result < 0) |
+ return true; |
brettw
2012/07/26 17:38:04
I'm not 100% sure if this is correct. Let's ask Er
ericu
2012/07/26 17:58:52
I think we want to return false there, but Kinuko
kinuko
2012/07/26 18:45:31
Looks like this should return false. dmikurube@ c
Tyler Breisacher (Chromium)
2012/07/26 18:47:07
If I'm not mistaken it's currently returning true,
Dai Mikurube (NOT FULLTIME)
2012/07/27 03:53:43
I think false is fine here.
|
+ |
return is_valid; |
} |
@@ -163,8 +167,10 @@ int FileSystemUsageCache::Write(const FilePath& usage_file_path, |
DCHECK(!usage_file_path.empty()); |
FilePath temporary_usage_file_path; |
- file_util::CreateTemporaryFileInDir(usage_file_path.DirName(), |
- &temporary_usage_file_path); |
+ if (!file_util::CreateTemporaryFileInDir(usage_file_path.DirName(), |
+ &temporary_usage_file_path)) |
+ return -1; |
+ |
int bytes_written = file_util::WriteFile(temporary_usage_file_path, |
(const char *)write_pickle.data(), |
write_pickle.size()); |