drive: Do not clear dirty bit if someone is writing to the file

Keeping the cache entry dirty to make sure that the edited file will eventually be uploaded.

BUG=326054
TEST=unit_tests

Review URL: https://codereview.chromium.org/139783004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245277 0039d316-1c4b-4281-b951-d872f2087c98
parent 41fc0392
......@@ -95,7 +95,9 @@ FileError UpdateFileLocalState(
if (drive_file_path->empty())
return FILE_ERROR_NOT_FOUND;
// Clear the dirty bit if we have updated an existing file.
// Do not clear the dirty bit if someone is writing to the file.
if (cache->IsOpenedForWrite(local_id))
return FILE_ERROR_OK;
return cache->ClearDirty(local_id, entry.file_specific_info().md5());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment