0

Do not update FileSystemUsageCache if the delta is zero

BUG=166158

Review URL: https://chromiumcodereview.appspot.com/11597005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173439 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
tzik@chromium.org
2012-12-17 10:05:31 +00:00
parent 1bedfcfa4f
commit f3fdedc565

@ -34,13 +34,14 @@ void SandboxQuotaObserver::OnStartUpdate(const FileSystemURL& url) {
}
void SandboxQuotaObserver::OnUpdate(const FileSystemURL& url,
int64 delta) {
int64 delta) {
DCHECK(SandboxMountPointProvider::CanHandleType(url.type()));
DCHECK(update_notify_runner_->RunsTasksOnCurrentThread());
FilePath usage_file_path = GetUsageCachePath(url);
if (usage_file_path.empty())
return;
FileSystemUsageCache::AtomicUpdateUsageByDelta(usage_file_path, delta);
if (delta != 0)
FileSystemUsageCache::AtomicUpdateUsageByDelta(usage_file_path, delta);
if (quota_manager_proxy_) {
quota_manager_proxy_->NotifyStorageModified(
quota::QuotaClient::kFileSystem,