- callback,
- base::Passed(&entry)));
-}
-
-void FileSystem::GetResourceEntryByPathAfterGetEntry(
- const base::FilePath& file_path,
- const GetResourceEntryCallback& callback,
- scoped_ptr<ResourceEntry> entry,
- FileError error) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK(!callback.is_null());
-
- if (error == FILE_ERROR_NOT_FOUND) {
- // If the information about the path is not in the local ResourceMetadata,
- // try fetching information of the directory and retry.
- //
- // Note: this forms mutual recursion between GetResourceEntryByPath and
- // LoadDirectoryIfNeeded, because directory loading requires the existence
- // of directory entry itself. The recursion terminates because we always go
- // up the hierarchy by .DirName() bounded under the Drive root path.
- if (util::GetDriveGrandRootPath().IsParent(file_path)) {
- LoadDirectoryIfNeeded(
- file_path.DirName(),
- base::Bind(&FileSystem::GetResourceEntryByPathAfterLoad,
- weak_ptr_factory_.GetWeakPtr(),
- file_path,
- callback));
- return;
- }
- }
-
- callback.Run(error, entry.Pass());