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

Unified Diff: webkit/fileapi/file_system_usage_cache.cc

Issue 10824031: Fix two unchecked return values (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: return false 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..73f4cbed60881f53c05e8c71e6da706a4a0e81e6 100644
--- a/webkit/fileapi/file_system_usage_cache.cc
+++ b/webkit/fileapi/file_system_usage_cache.cc
@@ -86,7 +86,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 false;
+
return is_valid;
}
@@ -163,8 +166,11 @@ 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());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698