drive: Remove cache entry before metadata entry

Cache entry cannot be removed when mounted.
This check should be performed before removing metadata entry.

BUG=349380

Review URL: https://codereview.chromium.org/187893006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255656 0039d316-1c4b-4281-b951-d872f2087c98
parent aa2bf3ba
......@@ -45,15 +45,15 @@ FileError UpdateLocalState(internal::ResourceMetadata* metadata,
return FILE_ERROR_NOT_EMPTY;
}
error = cache->Remove(*local_id);
if (error != FILE_ERROR_OK)
return error;
*changed_directory_path = metadata->GetFilePath(*local_id).DirName();
// Move to the trash.
entry.set_parent_local_id(util::kDriveTrashDirLocalId);
error = metadata->RefreshEntry(entry);
if (error != FILE_ERROR_OK)
return error;
return cache->Remove(*local_id);
return metadata->RefreshEntry(entry);
}
} // namespace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment