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

Unified Diff: webkit/fileapi/file_system_usage_cache.cc

Issue 7608011: Simplify directory path accounting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Most feedback rolled in. More tests needed. 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
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 1f93c40e39241f57b2ef2b97c341e6e855128263..d6a522082108bb3d88949422ceb106951512d6b8 100644
--- a/webkit/fileapi/file_system_usage_cache.cc
+++ b/webkit/fileapi/file_system_usage_cache.cc
@@ -74,6 +74,9 @@ int FileSystemUsageCache::AtomicUpdateUsageByDelta(
// TODO(dmikurube): Make sure that usage_file_path is available.
fs_usage = Read(usage_file_path, &dirty);
+ if (fs_usage < 0)
+ return -1;
+
return Write(usage_file_path, dirty, fs_usage + delta);
}
@@ -144,4 +147,4 @@ int FileSystemUsageCache::Write(const FilePath& usage_file_path,
return -1;
}
-}
+} // namespace fileapi

Powered by Google App Engine
This is Rietveld 408576698