OLD | NEW |
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 Loading... |
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 |
OLD | NEW |