Chromium Code Reviews| Index: webkit/fileapi/media/device_media_file_util.cc |
| diff --git a/webkit/fileapi/media/device_media_file_util.cc b/webkit/fileapi/media/device_media_file_util.cc |
| index aaf7a974745a0094606b4f2c0a439a988c1fc9f6..9661593e2f3e8d63e6b3b586f46d64c13b830e7e 100644 |
| --- a/webkit/fileapi/media/device_media_file_util.cc |
| +++ b/webkit/fileapi/media/device_media_file_util.cc |
| @@ -70,6 +70,7 @@ PlatformFileError DeviceMediaFileUtil::GetFileInfo( |
| const FileSystemURL& url, |
| PlatformFileInfo* file_info, |
| FilePath* platform_path) { |
| + DCHECK(file_info); |
| MTPDeviceDelegate* delegate = GetMTPDeviceDelegate(context); |
| if (!delegate) |
| return base::PLATFORM_FILE_ERROR_NOT_FOUND; |
| @@ -77,6 +78,8 @@ PlatformFileError DeviceMediaFileUtil::GetFileInfo( |
| PlatformFileError error = delegate->GetFileInfo(url.path(), file_info); |
| if (error != base::PLATFORM_FILE_OK) |
| return error; |
| + if (file_info->is_directory) |
| + return base::PLATFORM_FILE_ERROR_NOT_A_FILE; |
|
tzik
2013/01/21 07:10:41
Don't we support directory for DeviceMedia?
kinuko
2013/01/21 07:57:55
No, I needed to make this change in CreateSnapshot
|
| if (file_info->is_directory || |
| context->media_path_filter()->Match(url.path())) |
| @@ -122,24 +125,6 @@ PlatformFileError DeviceMediaFileUtil::Truncate( |
| return base::PLATFORM_FILE_ERROR_FAILED; |
| } |
| -bool DeviceMediaFileUtil::IsDirectoryEmpty( |
| - FileSystemOperationContext* context, |
| - const FileSystemURL& url) { |
| - MTPDeviceDelegate* delegate = GetMTPDeviceDelegate(context); |
| - if (!delegate) |
| - return false; |
| - |
| - scoped_ptr<AbstractFileEnumerator> enumerator( |
| - CreateFileEnumerator(context, url, false)); |
| - FilePath path; |
| - while (!(path = enumerator->Next()).empty()) { |
| - if (enumerator->IsDirectory() || |
| - context->media_path_filter()->Match(path)) |
| - return false; |
| - } |
| - return true; |
| -} |
| - |
| PlatformFileError DeviceMediaFileUtil::CopyOrMoveFile( |
| FileSystemOperationContext* context, |
| const FileSystemURL& src_url, |
| @@ -161,7 +146,7 @@ PlatformFileError DeviceMediaFileUtil::DeleteFile( |
| return base::PLATFORM_FILE_ERROR_SECURITY; |
| } |
| -PlatformFileError DeviceMediaFileUtil::DeleteSingleDirectory( |
| +PlatformFileError DeviceMediaFileUtil::DeleteDirectory( |
| FileSystemOperationContext* context, |
| const FileSystemURL& url) { |
| return base::PLATFORM_FILE_ERROR_SECURITY; |