| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_DEVICE_MEDIA_ASYNC_FILE_UTIL_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_DEVICE_MEDIA_ASYNC_FILE_UTIL_H_ |
| 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_DEVICE_MEDIA_ASYNC_FILE_UTIL_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_DEVICE_MEDIA_ASYNC_FILE_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 const base::FilePath& profile_path, | 36 const base::FilePath& profile_path, |
| 37 MediaFileValidationType validation_type); | 37 MediaFileValidationType validation_type); |
| 38 | 38 |
| 39 bool SupportsStreaming(const storage::FileSystemURL& url); | 39 bool SupportsStreaming(const storage::FileSystemURL& url); |
| 40 | 40 |
| 41 // AsyncFileUtil overrides. | 41 // AsyncFileUtil overrides. |
| 42 virtual void CreateOrOpen( | 42 virtual void CreateOrOpen( |
| 43 scoped_ptr<storage::FileSystemOperationContext> context, | 43 scoped_ptr<storage::FileSystemOperationContext> context, |
| 44 const storage::FileSystemURL& url, | 44 const storage::FileSystemURL& url, |
| 45 int file_flags, | 45 int file_flags, |
| 46 const CreateOrOpenCallback& callback) OVERRIDE; | 46 const CreateOrOpenCallback& callback) override; |
| 47 virtual void EnsureFileExists( | 47 virtual void EnsureFileExists( |
| 48 scoped_ptr<storage::FileSystemOperationContext> context, | 48 scoped_ptr<storage::FileSystemOperationContext> context, |
| 49 const storage::FileSystemURL& url, | 49 const storage::FileSystemURL& url, |
| 50 const EnsureFileExistsCallback& callback) OVERRIDE; | 50 const EnsureFileExistsCallback& callback) override; |
| 51 virtual void CreateDirectory( | 51 virtual void CreateDirectory( |
| 52 scoped_ptr<storage::FileSystemOperationContext> context, | 52 scoped_ptr<storage::FileSystemOperationContext> context, |
| 53 const storage::FileSystemURL& url, | 53 const storage::FileSystemURL& url, |
| 54 bool exclusive, | 54 bool exclusive, |
| 55 bool recursive, | 55 bool recursive, |
| 56 const StatusCallback& callback) OVERRIDE; | 56 const StatusCallback& callback) override; |
| 57 virtual void GetFileInfo( | 57 virtual void GetFileInfo( |
| 58 scoped_ptr<storage::FileSystemOperationContext> context, | 58 scoped_ptr<storage::FileSystemOperationContext> context, |
| 59 const storage::FileSystemURL& url, | 59 const storage::FileSystemURL& url, |
| 60 const GetFileInfoCallback& callback) OVERRIDE; | 60 const GetFileInfoCallback& callback) override; |
| 61 virtual void ReadDirectory( | 61 virtual void ReadDirectory( |
| 62 scoped_ptr<storage::FileSystemOperationContext> context, | 62 scoped_ptr<storage::FileSystemOperationContext> context, |
| 63 const storage::FileSystemURL& url, | 63 const storage::FileSystemURL& url, |
| 64 const ReadDirectoryCallback& callback) OVERRIDE; | 64 const ReadDirectoryCallback& callback) override; |
| 65 virtual void Touch(scoped_ptr<storage::FileSystemOperationContext> context, | 65 virtual void Touch(scoped_ptr<storage::FileSystemOperationContext> context, |
| 66 const storage::FileSystemURL& url, | 66 const storage::FileSystemURL& url, |
| 67 const base::Time& last_access_time, | 67 const base::Time& last_access_time, |
| 68 const base::Time& last_modified_time, | 68 const base::Time& last_modified_time, |
| 69 const StatusCallback& callback) OVERRIDE; | 69 const StatusCallback& callback) override; |
| 70 virtual void Truncate(scoped_ptr<storage::FileSystemOperationContext> context, | 70 virtual void Truncate(scoped_ptr<storage::FileSystemOperationContext> context, |
| 71 const storage::FileSystemURL& url, | 71 const storage::FileSystemURL& url, |
| 72 int64 length, | 72 int64 length, |
| 73 const StatusCallback& callback) OVERRIDE; | 73 const StatusCallback& callback) override; |
| 74 virtual void CopyFileLocal( | 74 virtual void CopyFileLocal( |
| 75 scoped_ptr<storage::FileSystemOperationContext> context, | 75 scoped_ptr<storage::FileSystemOperationContext> context, |
| 76 const storage::FileSystemURL& src_url, | 76 const storage::FileSystemURL& src_url, |
| 77 const storage::FileSystemURL& dest_url, | 77 const storage::FileSystemURL& dest_url, |
| 78 CopyOrMoveOption option, | 78 CopyOrMoveOption option, |
| 79 const CopyFileProgressCallback& progress_callback, | 79 const CopyFileProgressCallback& progress_callback, |
| 80 const StatusCallback& callback) OVERRIDE; | 80 const StatusCallback& callback) override; |
| 81 virtual void MoveFileLocal( | 81 virtual void MoveFileLocal( |
| 82 scoped_ptr<storage::FileSystemOperationContext> context, | 82 scoped_ptr<storage::FileSystemOperationContext> context, |
| 83 const storage::FileSystemURL& src_url, | 83 const storage::FileSystemURL& src_url, |
| 84 const storage::FileSystemURL& dest_url, | 84 const storage::FileSystemURL& dest_url, |
| 85 CopyOrMoveOption option, | 85 CopyOrMoveOption option, |
| 86 const StatusCallback& callback) OVERRIDE; | 86 const StatusCallback& callback) override; |
| 87 virtual void CopyInForeignFile( | 87 virtual void CopyInForeignFile( |
| 88 scoped_ptr<storage::FileSystemOperationContext> context, | 88 scoped_ptr<storage::FileSystemOperationContext> context, |
| 89 const base::FilePath& src_file_path, | 89 const base::FilePath& src_file_path, |
| 90 const storage::FileSystemURL& dest_url, | 90 const storage::FileSystemURL& dest_url, |
| 91 const StatusCallback& callback) OVERRIDE; | 91 const StatusCallback& callback) override; |
| 92 virtual void DeleteFile( | 92 virtual void DeleteFile( |
| 93 scoped_ptr<storage::FileSystemOperationContext> context, | 93 scoped_ptr<storage::FileSystemOperationContext> context, |
| 94 const storage::FileSystemURL& url, | 94 const storage::FileSystemURL& url, |
| 95 const StatusCallback& callback) OVERRIDE; | 95 const StatusCallback& callback) override; |
| 96 virtual void DeleteDirectory( | 96 virtual void DeleteDirectory( |
| 97 scoped_ptr<storage::FileSystemOperationContext> context, | 97 scoped_ptr<storage::FileSystemOperationContext> context, |
| 98 const storage::FileSystemURL& url, | 98 const storage::FileSystemURL& url, |
| 99 const StatusCallback& callback) OVERRIDE; | 99 const StatusCallback& callback) override; |
| 100 virtual void DeleteRecursively( | 100 virtual void DeleteRecursively( |
| 101 scoped_ptr<storage::FileSystemOperationContext> context, | 101 scoped_ptr<storage::FileSystemOperationContext> context, |
| 102 const storage::FileSystemURL& url, | 102 const storage::FileSystemURL& url, |
| 103 const StatusCallback& callback) OVERRIDE; | 103 const StatusCallback& callback) override; |
| 104 virtual void CreateSnapshotFile( | 104 virtual void CreateSnapshotFile( |
| 105 scoped_ptr<storage::FileSystemOperationContext> context, | 105 scoped_ptr<storage::FileSystemOperationContext> context, |
| 106 const storage::FileSystemURL& url, | 106 const storage::FileSystemURL& url, |
| 107 const CreateSnapshotFileCallback& callback) OVERRIDE; | 107 const CreateSnapshotFileCallback& callback) override; |
| 108 | 108 |
| 109 // This method is called when existing Blobs are read. | 109 // This method is called when existing Blobs are read. |
| 110 // |expected_modification_time| indicates the expected snapshot state of the | 110 // |expected_modification_time| indicates the expected snapshot state of the |
| 111 // underlying storage. The returned FileStreamReader must return an error | 111 // underlying storage. The returned FileStreamReader must return an error |
| 112 // when the state of the underlying storage changes. Any errors associated | 112 // when the state of the underlying storage changes. Any errors associated |
| 113 // with reading this file are returned by the FileStreamReader itself. | 113 // with reading this file are returned by the FileStreamReader itself. |
| 114 virtual scoped_ptr<storage::FileStreamReader> GetFileStreamReader( | 114 virtual scoped_ptr<storage::FileStreamReader> GetFileStreamReader( |
| 115 const storage::FileSystemURL& url, | 115 const storage::FileSystemURL& url, |
| 116 int64 offset, | 116 int64 offset, |
| 117 const base::Time& expected_modification_time, | 117 const base::Time& expected_modification_time, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 scoped_refptr<MediaPathFilterWrapper> media_path_filter_wrapper_; | 158 scoped_refptr<MediaPathFilterWrapper> media_path_filter_wrapper_; |
| 159 | 159 |
| 160 // For callbacks that may run after destruction. | 160 // For callbacks that may run after destruction. |
| 161 base::WeakPtrFactory<DeviceMediaAsyncFileUtil> weak_ptr_factory_; | 161 base::WeakPtrFactory<DeviceMediaAsyncFileUtil> weak_ptr_factory_; |
| 162 | 162 |
| 163 DISALLOW_COPY_AND_ASSIGN(DeviceMediaAsyncFileUtil); | 163 DISALLOW_COPY_AND_ASSIGN(DeviceMediaAsyncFileUtil); |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_DEVICE_MEDIA_ASYNC_FILE_UTIL_H
_ | 166 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_DEVICE_MEDIA_ASYNC_FILE_UTIL_H
_ |
| OLD | NEW |