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

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

Issue 278273002: drive: Change the return type of ResourceMetadata's methods to FileError (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/sync/entry_update_performer.cc
diff --git a/chrome/browser/chromeos/drive/sync/entry_update_performer.cc b/chrome/browser/chromeos/drive/sync/entry_update_performer.cc
index c1410f16f12d48dc97fabaa0af5b5551f04eb265..cd3bd1023817100dfbee2ecca148225516b30b19 100644
--- a/chrome/browser/chromeos/drive/sync/entry_update_performer.cc
+++ b/chrome/browser/chromeos/drive/sync/entry_update_performer.cc
@@ -50,9 +50,9 @@ FileError PrepareUpdate(ResourceMetadata* metadata,
if (error != FILE_ERROR_OK)
return error;
- local_state->drive_file_path = metadata->GetFilePath(local_id);
- if (local_state->drive_file_path.empty())
- return FILE_ERROR_NOT_FOUND;
+ error = metadata->GetFilePath(local_id, &local_state->drive_file_path);
+ if (error != FILE_ERROR_OK)
+ return error;
FileCacheEntry cache_entry;
cache->GetCacheEntry(local_id, &cache_entry);
@@ -123,8 +123,10 @@ FileError FinishUpdate(ResourceMetadata* metadata,
switch (error) {
case FILE_ERROR_OK:
if (existing_local_id != local_id) {
- base::FilePath existing_entry_path =
- metadata->GetFilePath(existing_local_id);
+ base::FilePath existing_entry_path;
+ error = metadata->GetFilePath(existing_local_id, &existing_entry_path);
+ if (error != FILE_ERROR_OK)
+ return error;
error = metadata->RemoveEntry(existing_local_id);
if (error != FILE_ERROR_OK)
return error;
« no previous file with comments | « chrome/browser/chromeos/drive/sync/entry_revert_performer.cc ('k') | chrome/browser/chromeos/drive/sync_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698