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

Unified Diff: chrome/browser/chromeos/drive/file_system/update_operation.cc

Issue 139783004: drive: Do not clear dirty bit if someone is writing to the file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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: chrome/browser/chromeos/drive/file_system/update_operation.cc
diff --git a/chrome/browser/chromeos/drive/file_system/update_operation.cc b/chrome/browser/chromeos/drive/file_system/update_operation.cc
index b9932c6b41341a21967f76e76c5723c3023bb4dc..6ce958f65faa26f6c540d753ecb54ab3745f2918 100644
--- a/chrome/browser/chromeos/drive/file_system/update_operation.cc
+++ b/chrome/browser/chromeos/drive/file_system/update_operation.cc
@@ -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());
}

Powered by Google App Engine
This is Rietveld 408576698