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

Unified Diff: chrome/browser/chromeos/drive/sync/remove_performer.cc

Issue 68543002: drive: Support offline delete (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Stop modifying local state after server side update Created 7 years, 1 month 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/sync/remove_performer.cc
diff --git a/chrome/browser/chromeos/drive/sync/remove_performer.cc b/chrome/browser/chromeos/drive/sync/remove_performer.cc
index 89297ee58812c816b090466d34cedd7acf6a1557..14b21ff0f3a22463fcb4e620bb4a62cb8ac8b7f0 100644
--- a/chrome/browser/chromeos/drive/sync/remove_performer.cc
+++ b/chrome/browser/chromeos/drive/sync/remove_performer.cc
@@ -126,13 +126,15 @@ void RemovePerformer::DeleteResourceAfterUpdateRemoteState(
DCHECK(!callback.is_null());
FileError error = GDataToFileError(status);
- if (error != FILE_ERROR_OK && error != FILE_ERROR_NOT_FOUND) {
- callback.Run(error);
+ if (error == FILE_ERROR_NOT_FOUND) { // Remove local entry when not found.
+ RemoveEntryOnUIThread(blocking_task_runner_.get(), metadata_, local_id,
+ callback);
return;
}
- RemoveEntryOnUIThread(blocking_task_runner_.get(), metadata_, local_id,
- callback);
+ // Now we're done. If the entry is deleted on the server, it'll be also
+ // deleted locally on the next update.
+ callback.Run(error);
}
void RemovePerformer::UnparentResource(

Powered by Google App Engine
This is Rietveld 408576698