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

Side by Side Diff: chrome/browser/chromeos/drive/sync/entry_update_performer.cc

Issue 99893007: drive: Retry update when the entry was trashed during update (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/drive/sync/entry_update_performer.h" 5 #include "chrome/browser/chromeos/drive/sync/entry_update_performer.h"
6 6
7 #include "chrome/browser/chromeos/drive/drive.pb.h" 7 #include "chrome/browser/chromeos/drive/drive.pb.h"
8 #include "chrome/browser/chromeos/drive/file_system_util.h" 8 #include "chrome/browser/chromeos/drive/file_system_util.h"
9 #include "chrome/browser/chromeos/drive/job_scheduler.h" 9 #include "chrome/browser/chromeos/drive/job_scheduler.h"
10 #include "chrome/browser/chromeos/drive/resource_metadata.h" 10 #include "chrome/browser/chromeos/drive/resource_metadata.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 171
172 void EntryUpdatePerformer::UpdateEntryAfterFinish( 172 void EntryUpdatePerformer::UpdateEntryAfterFinish(
173 const FileOperationCallback& callback, 173 const FileOperationCallback& callback,
174 const ResourceEntry* entry, 174 const ResourceEntry* entry,
175 FileError error) { 175 FileError error) {
176 if (error != FILE_ERROR_OK) { 176 if (error != FILE_ERROR_OK) {
177 callback.Run(error); 177 callback.Run(error);
178 return; 178 return;
179 } 179 }
180 180
181 if (entry->metadata_edit_state() == ResourceEntry::DIRTY) { 181 if (entry->metadata_edit_state() == ResourceEntry::DIRTY ||
182 entry->parent_local_id() == util::kDriveTrashDirLocalId) {
182 // The entry was edited during the update. Update again. 183 // The entry was edited during the update. Update again.
183 UpdateEntry(entry->local_id(), callback); 184 UpdateEntry(entry->local_id(), callback);
184 return; 185 return;
185 } 186 }
186 187
187 callback.Run(FILE_ERROR_OK); 188 callback.Run(FILE_ERROR_OK);
188 } 189 }
189 190
190 } // namespace internal 191 } // namespace internal
191 } // namespace drive 192 } // namespace drive
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698