Chromium Code Reviews| Index: chrome/browser/media_galleries/fileapi/native_media_file_util.h |
| diff --git a/chrome/browser/media_galleries/fileapi/native_media_file_util.h b/chrome/browser/media_galleries/fileapi/native_media_file_util.h |
| index 0cfa71002c83c412ec0fb0054d3849dc0167352c..31701e4b4b98f1a03740589d159f0be0c5e274b6 100644 |
| --- a/chrome/browser/media_galleries/fileapi/native_media_file_util.h |
| +++ b/chrome/browser/media_galleries/fileapi/native_media_file_util.h |
| @@ -6,88 +6,101 @@ |
| #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_NATIVE_MEDIA_FILE_UTIL_H_ |
| #include "base/memory/scoped_ptr.h" |
| -#include "webkit/browser/fileapi/isolated_file_util.h" |
| +#include "webkit/browser/fileapi/async_file_util.h" |
| namespace chrome { |
| // This class handles native file system operations with media type filtering |
| // which is passed to each method via fileapi::FileSystemOperationContext as |
| // MediaPathFilter. |
| -class NativeMediaFileUtil : public fileapi::IsolatedFileUtil { |
| +class NativeMediaFileUtil : public fileapi::AsyncFileUtil { |
| public: |
| NativeMediaFileUtil(); |
| - virtual base::PlatformFileError CreateOrOpen( |
| + // AsyncFileUtil overrides. |
| + virtual bool CreateOrOpen( |
| fileapi::FileSystemOperationContext* context, |
| const fileapi::FileSystemURL& url, |
| int file_flags, |
| - base::PlatformFile* file_handle, |
| - bool* created) OVERRIDE; |
| - virtual base::PlatformFileError EnsureFileExists( |
| + const CreateOrOpenCallback& callback) OVERRIDE; |
| + virtual bool EnsureFileExists( |
| fileapi::FileSystemOperationContext* context, |
| - const fileapi::FileSystemURL& url, bool* created) OVERRIDE; |
| - virtual scoped_ptr<AbstractFileEnumerator> CreateFileEnumerator( |
| + const fileapi::FileSystemURL& url, |
| + const EnsureFileExistsCallback& callback) OVERRIDE; |
| + virtual bool CreateDirectory( |
| + fileapi::FileSystemOperationContext* context, |
| + const fileapi::FileSystemURL& url, |
| + bool exclusive, |
| + bool recursive, |
| + const StatusCallback& callback) OVERRIDE; |
| + virtual bool GetFileInfo( |
| fileapi::FileSystemOperationContext* context, |
| - const fileapi::FileSystemURL& root_url) OVERRIDE; |
| - virtual base::PlatformFileError Touch( |
| + const fileapi::FileSystemURL& url, |
| + const GetFileInfoCallback& callback) OVERRIDE; |
| + virtual bool ReadDirectory( |
| + fileapi::FileSystemOperationContext* context, |
| + const fileapi::FileSystemURL& url, |
| + const ReadDirectoryCallback& callback) OVERRIDE; |
| + virtual bool Touch( |
| fileapi::FileSystemOperationContext* context, |
| const fileapi::FileSystemURL& url, |
| const base::Time& last_access_time, |
| - const base::Time& last_modified_time) OVERRIDE; |
| - virtual base::PlatformFileError Truncate( |
| + const base::Time& last_modified_time, |
| + const StatusCallback& callback) OVERRIDE; |
| + virtual bool Truncate( |
| fileapi::FileSystemOperationContext* context, |
| const fileapi::FileSystemURL& url, |
| - int64 length) OVERRIDE; |
| - virtual base::PlatformFileError CopyOrMoveFile( |
| + int64 length, |
| + const StatusCallback& callback) OVERRIDE; |
| + virtual bool CopyFileLocal( |
| fileapi::FileSystemOperationContext* context, |
| const fileapi::FileSystemURL& src_url, |
| const fileapi::FileSystemURL& dest_url, |
| - bool copy) OVERRIDE; |
| - virtual base::PlatformFileError CopyInForeignFile( |
| - fileapi::FileSystemOperationContext* context, |
| - const base::FilePath& src_file_path, |
| - const fileapi::FileSystemURL& dest_url) OVERRIDE; |
| - virtual base::PlatformFileError DeleteFile( |
| + const StatusCallback& callback) OVERRIDE; |
| + virtual bool MoveFileLocal( |
| fileapi::FileSystemOperationContext* context, |
| - const fileapi::FileSystemURL& url) OVERRIDE; |
| - virtual base::PlatformFileError GetFileInfo( |
| + const fileapi::FileSystemURL& src_url, |
| + const fileapi::FileSystemURL& dest_url, |
| + const StatusCallback& callback) OVERRIDE; |
| + virtual bool CopyInForeignFile( |
| + fileapi::FileSystemOperationContext* context, |
| + const base::FilePath& src_file_path, |
| + const fileapi::FileSystemURL& dest_url, |
| + const StatusCallback& callback) OVERRIDE; |
| + virtual bool DeleteFile( |
| fileapi::FileSystemOperationContext* context, |
| const fileapi::FileSystemURL& url, |
| - base::PlatformFileInfo* file_info, |
| - base::FilePath* platform_path) OVERRIDE; |
| - virtual webkit_blob::ScopedFile CreateSnapshotFile( |
| + const StatusCallback& callback) OVERRIDE; |
| + virtual bool DeleteDirectory( |
| fileapi::FileSystemOperationContext* context, |
| const fileapi::FileSystemURL& url, |
| - base::PlatformFileError* error, |
| - base::PlatformFileInfo* file_info, |
| - base::FilePath* platform_path) OVERRIDE; |
| + const StatusCallback& callback) OVERRIDE; |
| + virtual bool CreateSnapshotFile( |
| + fileapi::FileSystemOperationContext* context, |
| + const fileapi::FileSystemURL& url, |
| + const CreateSnapshotFileCallback& callback) OVERRIDE; |
| // Uses the MIME sniffer code, which actually looks into the file, |
| // to determine if it is really a media file (to avoid exposing |
| // non-media files with a media file extension.) |
| static base::PlatformFileError IsMediaFile(const base::FilePath& path); |
| - private: |
| - // Like GetLocalFilePath(), but always take media_path_filter() into |
| - // consideration. If the media_path_filter() check fails, return |
| - // PLATFORM_FILE_ERROR_SECURITY. |local_file_path| does not have to exist. |
| - base::PlatformFileError GetFilteredLocalFilePath( |
| + protected: |
| + virtual base::PlatformFileError GetFileInfoSync( |
|
vandebo (ex-Chrome)
2013/05/30 18:39:19
These methods should be documented.
tommycli
2013/05/30 19:35:20
Done.
|
| fileapi::FileSystemOperationContext* context, |
| - const fileapi::FileSystemURL& file_system_url, |
| - base::FilePath* local_file_path); |
| - |
| - // Like GetLocalFilePath(), but if the file does not exist, then return |
| - // |failure_error|. |
| - // If |local_file_path| is a file, then take media_path_filter() into |
| - // consideration. |
| - // If the media_path_filter() check fails, return |failure_error|. |
| - // If |local_file_path| is a directory, return PLATFORM_FILE_OK. |
| - base::PlatformFileError GetFilteredLocalFilePathForExistingFileOrDirectory( |
| + const fileapi::FileSystemURL& url, |
| + base::PlatformFileInfo* file_info, |
| + base::FilePath* platform_path); |
| + virtual base::PlatformFileError GetLocalFilePath( |
| fileapi::FileSystemOperationContext* context, |
| const fileapi::FileSystemURL& file_system_url, |
| - base::PlatformFileError failure_error, |
| base::FilePath* local_file_path); |
| + virtual base::PlatformFileError ReadDirectorySync( |
| + fileapi::FileSystemOperationContext* context, |
| + const fileapi::FileSystemURL& url, |
| + EntryList* file_list); |
| + private: |
| DISALLOW_COPY_AND_ASSIGN(NativeMediaFileUtil); |
| }; |