| 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_DEVICE_MEDIA_FILE_UTIL_H_ | 5 #ifndef WEBKIT_FILEAPI_MEDIA_DEVICE_MEDIA_FILE_UTIL_H_ |
| 6 #define WEBKIT_FILEAPI_MEDIA_DEVICE_MEDIA_FILE_UTIL_H_ | 6 #define WEBKIT_FILEAPI_MEDIA_DEVICE_MEDIA_FILE_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
| 11 #include "webkit/fileapi/file_system_file_util.h" | 11 #include "webkit/fileapi/file_system_file_util.h" |
| 12 #include "webkit/storage/webkit_storage_export.h" | 12 #include "webkit/storage/webkit_storage_export.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class Time; | 15 class Time; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace fileapi { | 18 namespace fileapi { |
| 19 | 19 |
| 20 class FileSystemOperationContext; | 20 class FileSystemOperationContext; |
| 21 | 21 |
| 22 class WEBKIT_STORAGE_EXPORT_PRIVATE DeviceMediaFileUtil | 22 class WEBKIT_STORAGE_EXPORT_PRIVATE DeviceMediaFileUtil |
| 23 : public FileSystemFileUtil { | 23 : public FileSystemFileUtil { |
| 24 public: | 24 public: |
| 25 explicit DeviceMediaFileUtil(const FilePath& profile_path); | 25 explicit DeviceMediaFileUtil(const base::FilePath& profile_path); |
| 26 virtual ~DeviceMediaFileUtil() {} | 26 virtual ~DeviceMediaFileUtil() {} |
| 27 | 27 |
| 28 // FileSystemFileUtil overrides. | 28 // FileSystemFileUtil overrides. |
| 29 virtual base::PlatformFileError CreateOrOpen( | 29 virtual base::PlatformFileError CreateOrOpen( |
| 30 FileSystemOperationContext* context, | 30 FileSystemOperationContext* context, |
| 31 const FileSystemURL& url, | 31 const FileSystemURL& url, |
| 32 int file_flags, | 32 int file_flags, |
| 33 base::PlatformFile* file_handle, | 33 base::PlatformFile* file_handle, |
| 34 bool* created) OVERRIDE; | 34 bool* created) OVERRIDE; |
| 35 virtual base::PlatformFileError Close( | 35 virtual base::PlatformFileError Close( |
| 36 FileSystemOperationContext* context, | 36 FileSystemOperationContext* context, |
| 37 base::PlatformFile file) OVERRIDE; | 37 base::PlatformFile file) OVERRIDE; |
| 38 virtual base::PlatformFileError EnsureFileExists( | 38 virtual base::PlatformFileError EnsureFileExists( |
| 39 FileSystemOperationContext* context, | 39 FileSystemOperationContext* context, |
| 40 const FileSystemURL& url, bool* created) OVERRIDE; | 40 const FileSystemURL& url, bool* created) OVERRIDE; |
| 41 virtual base::PlatformFileError CreateDirectory( | 41 virtual base::PlatformFileError CreateDirectory( |
| 42 FileSystemOperationContext* context, | 42 FileSystemOperationContext* context, |
| 43 const FileSystemURL& url, | 43 const FileSystemURL& url, |
| 44 bool exclusive, | 44 bool exclusive, |
| 45 bool recursive) OVERRIDE; | 45 bool recursive) OVERRIDE; |
| 46 virtual base::PlatformFileError GetFileInfo( | 46 virtual base::PlatformFileError GetFileInfo( |
| 47 FileSystemOperationContext* context, | 47 FileSystemOperationContext* context, |
| 48 const FileSystemURL& url, | 48 const FileSystemURL& url, |
| 49 base::PlatformFileInfo* file_info, | 49 base::PlatformFileInfo* file_info, |
| 50 FilePath* platform_path) OVERRIDE; | 50 base::FilePath* platform_path) OVERRIDE; |
| 51 virtual scoped_ptr<AbstractFileEnumerator> CreateFileEnumerator( | 51 virtual scoped_ptr<AbstractFileEnumerator> CreateFileEnumerator( |
| 52 FileSystemOperationContext* context, | 52 FileSystemOperationContext* context, |
| 53 const FileSystemURL& root_url, | 53 const FileSystemURL& root_url, |
| 54 bool recursive) OVERRIDE; | 54 bool recursive) OVERRIDE; |
| 55 virtual base::PlatformFileError GetLocalFilePath( | 55 virtual base::PlatformFileError GetLocalFilePath( |
| 56 FileSystemOperationContext* context, | 56 FileSystemOperationContext* context, |
| 57 const FileSystemURL& file_system_url, | 57 const FileSystemURL& file_system_url, |
| 58 FilePath* local_file_path) OVERRIDE; | 58 base::FilePath* local_file_path) OVERRIDE; |
| 59 virtual base::PlatformFileError Touch( | 59 virtual base::PlatformFileError Touch( |
| 60 FileSystemOperationContext* context, | 60 FileSystemOperationContext* context, |
| 61 const FileSystemURL& url, | 61 const FileSystemURL& url, |
| 62 const base::Time& last_access_time, | 62 const base::Time& last_access_time, |
| 63 const base::Time& last_modified_time) OVERRIDE; | 63 const base::Time& last_modified_time) OVERRIDE; |
| 64 virtual base::PlatformFileError Truncate( | 64 virtual base::PlatformFileError Truncate( |
| 65 FileSystemOperationContext* context, | 65 FileSystemOperationContext* context, |
| 66 const FileSystemURL& url, | 66 const FileSystemURL& url, |
| 67 int64 length) OVERRIDE; | 67 int64 length) OVERRIDE; |
| 68 virtual base::PlatformFileError CopyOrMoveFile( | 68 virtual base::PlatformFileError CopyOrMoveFile( |
| 69 FileSystemOperationContext* context, | 69 FileSystemOperationContext* context, |
| 70 const FileSystemURL& src_url, | 70 const FileSystemURL& src_url, |
| 71 const FileSystemURL& dest_url, | 71 const FileSystemURL& dest_url, |
| 72 bool copy) OVERRIDE; | 72 bool copy) OVERRIDE; |
| 73 virtual base::PlatformFileError CopyInForeignFile( | 73 virtual base::PlatformFileError CopyInForeignFile( |
| 74 FileSystemOperationContext* context, | 74 FileSystemOperationContext* context, |
| 75 const FilePath& src_file_path, | 75 const base::FilePath& src_file_path, |
| 76 const FileSystemURL& dest_url) OVERRIDE; | 76 const FileSystemURL& dest_url) OVERRIDE; |
| 77 virtual base::PlatformFileError DeleteFile( | 77 virtual base::PlatformFileError DeleteFile( |
| 78 FileSystemOperationContext* context, | 78 FileSystemOperationContext* context, |
| 79 const FileSystemURL& url) OVERRIDE; | 79 const FileSystemURL& url) OVERRIDE; |
| 80 virtual base::PlatformFileError DeleteDirectory( | 80 virtual base::PlatformFileError DeleteDirectory( |
| 81 FileSystemOperationContext* context, | 81 FileSystemOperationContext* context, |
| 82 const FileSystemURL& url) OVERRIDE; | 82 const FileSystemURL& url) OVERRIDE; |
| 83 virtual base::PlatformFileError CreateSnapshotFile( | 83 virtual base::PlatformFileError CreateSnapshotFile( |
| 84 FileSystemOperationContext* context, | 84 FileSystemOperationContext* context, |
| 85 const FileSystemURL& url, | 85 const FileSystemURL& url, |
| 86 base::PlatformFileInfo* file_info, | 86 base::PlatformFileInfo* file_info, |
| 87 FilePath* platform_path, | 87 base::FilePath* platform_path, |
| 88 SnapshotFilePolicy* policy) OVERRIDE; | 88 SnapshotFilePolicy* policy) OVERRIDE; |
| 89 | 89 |
| 90 private: | 90 private: |
| 91 // Profile path | 91 // Profile path |
| 92 const FilePath profile_path_; | 92 const base::FilePath profile_path_; |
| 93 | 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(DeviceMediaFileUtil); | 94 DISALLOW_COPY_AND_ASSIGN(DeviceMediaFileUtil); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace fileapi | 97 } // namespace fileapi |
| 98 | 98 |
| 99 #endif // WEBKIT_FILEAPI_MEDIA_DEVICE_MEDIA_FILE_UTIL_H_ | 99 #endif // WEBKIT_FILEAPI_MEDIA_DEVICE_MEDIA_FILE_UTIL_H_ |
| OLD | NEW |