diff options
author | tbreisacher@chromium.org <tbreisacher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-03 23:34:46 +0000 |
---|---|---|
committer | tbreisacher@chromium.org <tbreisacher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-03 23:34:46 +0000 |
commit | 2040ebaf23c925708f4a988fa4fbf64a35ed1873 (patch) | |
tree | 5bb1a3dca48b6dbdb745c5770de5427c937d473b /webkit | |
parent | d71d90820be7fef28e504395cb6ad11f826746cb (diff) | |
download | chromium_src-2040ebaf23c925708f4a988fa4fbf64a35ed1873.zip chromium_src-2040ebaf23c925708f4a988fa4fbf64a35ed1873.tar.gz chromium_src-2040ebaf23c925708f4a988fa4fbf64a35ed1873.tar.bz2 |
Fix two unchecked return values
CID=104234,104664
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com/10824031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149970 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/fileapi/file_system_usage_cache.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/webkit/fileapi/file_system_usage_cache.cc b/webkit/fileapi/file_system_usage_cache.cc index d1bc5c0..73f4cbe 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()); |