| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_FILEAPI_MEDIA_NATIVE_MEDIA_FILE_UTIL_H_ | 5 #ifndef WEBKIT_FILEAPI_MEDIA_NATIVE_MEDIA_FILE_UTIL_H_ |
| 6 #define WEBKIT_FILEAPI_MEDIA_NATIVE_MEDIA_FILE_UTIL_H_ | 6 #define WEBKIT_FILEAPI_MEDIA_NATIVE_MEDIA_FILE_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "webkit/fileapi/isolated_file_util.h" | 9 #include "webkit/fileapi/isolated_file_util.h" |
| 10 #include "webkit/storage/webkit_storage_export.h" | 10 #include "webkit/storage/webkit_storage_export.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 FileSystemOperationContext* context, | 41 FileSystemOperationContext* context, |
| 42 const FileSystemURL& url, | 42 const FileSystemURL& url, |
| 43 int64 length) OVERRIDE; | 43 int64 length) OVERRIDE; |
| 44 virtual base::PlatformFileError CopyOrMoveFile( | 44 virtual base::PlatformFileError CopyOrMoveFile( |
| 45 FileSystemOperationContext* context, | 45 FileSystemOperationContext* context, |
| 46 const FileSystemURL& src_url, | 46 const FileSystemURL& src_url, |
| 47 const FileSystemURL& dest_url, | 47 const FileSystemURL& dest_url, |
| 48 bool copy) OVERRIDE; | 48 bool copy) OVERRIDE; |
| 49 virtual base::PlatformFileError CopyInForeignFile( | 49 virtual base::PlatformFileError CopyInForeignFile( |
| 50 FileSystemOperationContext* context, | 50 FileSystemOperationContext* context, |
| 51 const FilePath& src_file_path, | 51 const base::FilePath& src_file_path, |
| 52 const FileSystemURL& dest_url) OVERRIDE; | 52 const FileSystemURL& dest_url) OVERRIDE; |
| 53 virtual base::PlatformFileError DeleteFile( | 53 virtual base::PlatformFileError DeleteFile( |
| 54 FileSystemOperationContext* context, | 54 FileSystemOperationContext* context, |
| 55 const FileSystemURL& url) OVERRIDE; | 55 const FileSystemURL& url) OVERRIDE; |
| 56 virtual base::PlatformFileError GetFileInfo( | 56 virtual base::PlatformFileError GetFileInfo( |
| 57 FileSystemOperationContext* context, | 57 FileSystemOperationContext* context, |
| 58 const FileSystemURL& url, | 58 const FileSystemURL& url, |
| 59 base::PlatformFileInfo* file_info, | 59 base::PlatformFileInfo* file_info, |
| 60 FilePath* platform_path) OVERRIDE; | 60 base::FilePath* platform_path) OVERRIDE; |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 // Like GetLocalFilePath(), but always take media_path_filter() into | 63 // Like GetLocalFilePath(), but always take media_path_filter() into |
| 64 // consideration. If the media_path_filter() check fails, return | 64 // consideration. If the media_path_filter() check fails, return |
| 65 // PLATFORM_FILE_ERROR_SECURITY. |local_file_path| does not have to exist. | 65 // PLATFORM_FILE_ERROR_SECURITY. |local_file_path| does not have to exist. |
| 66 base::PlatformFileError GetFilteredLocalFilePath( | 66 base::PlatformFileError GetFilteredLocalFilePath( |
| 67 FileSystemOperationContext* context, | 67 FileSystemOperationContext* context, |
| 68 const FileSystemURL& file_system_url, | 68 const FileSystemURL& file_system_url, |
| 69 FilePath* local_file_path); | 69 base::FilePath* local_file_path); |
| 70 | 70 |
| 71 // Like GetLocalFilePath(), but if the file does not exist, then return | 71 // Like GetLocalFilePath(), but if the file does not exist, then return |
| 72 // |failure_error|. | 72 // |failure_error|. |
| 73 // If |local_file_path| is a file, then take media_path_filter() into | 73 // If |local_file_path| is a file, then take media_path_filter() into |
| 74 // consideration. | 74 // consideration. |
| 75 // If the media_path_filter() check fails, return |failure_error|. | 75 // If the media_path_filter() check fails, return |failure_error|. |
| 76 // If |local_file_path| is a directory, return PLATFORM_FILE_OK. | 76 // If |local_file_path| is a directory, return PLATFORM_FILE_OK. |
| 77 base::PlatformFileError GetFilteredLocalFilePathForExistingFileOrDirectory( | 77 base::PlatformFileError GetFilteredLocalFilePathForExistingFileOrDirectory( |
| 78 FileSystemOperationContext* context, | 78 FileSystemOperationContext* context, |
| 79 const FileSystemURL& file_system_url, | 79 const FileSystemURL& file_system_url, |
| 80 base::PlatformFileError failure_error, | 80 base::PlatformFileError failure_error, |
| 81 FilePath* local_file_path); | 81 base::FilePath* local_file_path); |
| 82 | 82 |
| 83 DISALLOW_COPY_AND_ASSIGN(NativeMediaFileUtil); | 83 DISALLOW_COPY_AND_ASSIGN(NativeMediaFileUtil); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } // namespace fileapi | 86 } // namespace fileapi |
| 87 | 87 |
| 88 #endif // WEBKIT_FILEAPI_MEDIA_NATIVE_MEDIA_FILE_UTIL_H_ | 88 #endif // WEBKIT_FILEAPI_MEDIA_NATIVE_MEDIA_FILE_UTIL_H_ |
| OLD | NEW |