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

Unified Diff: chrome/browser/chromeos/drive/file_system/create_directory_operation.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/file_system/create_directory_operation.cc
diff --git a/chrome/browser/chromeos/drive/file_system/create_directory_operation.cc b/chrome/browser/chromeos/drive/file_system/create_directory_operation.cc
index 39f57429fa4a4a8230273dcfd1c9f765ca785f34..ae45d8387034eb8e612deeef53dba721ade23988 100644
--- a/chrome/browser/chromeos/drive/file_system/create_directory_operation.cc
+++ b/chrome/browser/chromeos/drive/file_system/create_directory_operation.cc
@@ -46,8 +46,13 @@ FileError CreateDirectoryRecursively(
if (error != FILE_ERROR_OK)
return error;
+ base::FilePath path;
+ error = metadata->GetFilePath(local_id, &path);
+ if (error != FILE_ERROR_OK)
+ return error;
+
updated_local_ids->insert(local_id);
- changed_directories->insert(metadata->GetFilePath(local_id).DirName());
+ changed_directories->insert(path.DirName());
if (remaining_path.empty()) // All directories are created successfully.
return FILE_ERROR_OK;
@@ -73,9 +78,13 @@ FileError UpdateLocalState(internal::ResourceMetadata* metadata,
base::FilePath existing_deepest_path(components[0]);
std::string local_id = util::kDriveGrandRootLocalId;
for (size_t i = 1; i < components.size(); ++i) {
- std::string child_local_id = metadata->GetChildId(local_id, components[i]);
- if (child_local_id.empty())
+ std::string child_local_id;
+ FileError error =
+ metadata->GetChildId(local_id, components[i], &child_local_id);
+ if (error == FILE_ERROR_NOT_FOUND)
break;
+ if (error != FILE_ERROR_OK)
+ return error;
existing_deepest_path = existing_deepest_path.Append(components[i]);
local_id = child_local_id;
}

Powered by Google App Engine
This is Rietveld 408576698