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

Unified Diff: chrome/browser/chromeos/drive/change_list_processor.cc

Issue 256773005: drive: Handle ApplyEntryMap correctly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/change_list_processor.cc
diff --git a/chrome/browser/chromeos/drive/change_list_processor.cc b/chrome/browser/chromeos/drive/change_list_processor.cc
index ac01e49b0771c5cbe346731da7c9a11363a4efaa..c5e620582a058cdaf9484dc8a5cd22548ea5024b 100644
--- a/chrome/browser/chromeos/drive/change_list_processor.cc
+++ b/chrome/browser/chromeos/drive/change_list_processor.cc
@@ -286,9 +286,11 @@ FileError ChangeListProcessor::ApplyEntryMap(
if (it->first != root.resource_id()) {
// TODO(hashimoto): Handle ApplyEntry errors correctly.
kinaba 2014/04/28 08:28:52 nit: Do you still need this TODO comment?
hashimoto 2014/04/28 09:30:54 Done.
FileError error = ApplyEntry(it->second);
- DLOG_IF(WARNING, error != FILE_ERROR_OK)
- << "ApplyEntry failed: " << FileErrorToString(error)
- << ", title = " << it->second.title();
+ if (error != FILE_ERROR_OK) {
+ LOG(ERROR) << "ApplyEntry failed: " << FileErrorToString(error)
+ << ", title = " << it->second.title();
+ return error;
+ }
}
entry_map_.erase(it);
}
@@ -299,12 +301,21 @@ FileError ChangeListProcessor::ApplyEntryMap(
std::string local_id;
FileError error = resource_metadata_->GetIdByResourceId(
deleted_resource_ids[i], &local_id);
- if (error == FILE_ERROR_OK)
- error = resource_metadata_->RemoveEntry(local_id);
-
- DLOG_IF(WARNING, error != FILE_ERROR_OK && error != FILE_ERROR_NOT_FOUND)
- << "Failed to delete: " << FileErrorToString(error)
- << ", resource_id = " << deleted_resource_ids[i];
+ switch (error) {
+ case FILE_ERROR_OK:
+ error = resource_metadata_->RemoveEntry(local_id);
+ break;
+ case FILE_ERROR_NOT_FOUND:
+ error = FILE_ERROR_OK;
+ break;
+ default:
+ break;
+ }
+ if (error != FILE_ERROR_OK) {
+ LOG(ERROR) << "Failed to delete: " << FileErrorToString(error)
+ << ", resource_id = " << deleted_resource_ids[i];
+ return error;
+ }
}
return FILE_ERROR_OK;
« 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