Chromium Code Reviews| 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_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 | 132 |
| 133 // Called when ReadDirectory method call failed to enumerate the directory | 133 // Called when ReadDirectory method call failed to enumerate the directory |
| 134 // objects. |callback| is invoked to notify the caller about the |error| | 134 // objects. |callback| is invoked to notify the caller about the |error| |
| 135 // that occured while reading the directory objects. | 135 // that occured while reading the directory objects. |
| 136 void OnReadDirectoryError( | 136 void OnReadDirectoryError( |
| 137 const AsyncFileUtil::ReadDirectoryCallback& callback, | 137 const AsyncFileUtil::ReadDirectoryCallback& callback, |
| 138 base::PlatformFileError error); | 138 base::PlatformFileError error); |
| 139 | 139 |
| 140 // Called when the snapshot file specified by the |platform_path| is | 140 // Called when the snapshot file specified by the |platform_path| is |
| 141 // successfully created. |file_info| contains the device media file details | 141 // successfully created. |file_info| contains the device media file details |
| 142 // for which the snapshot file is created. |callback| is invoked to complete | 142 // for which the snapshot file is created. |
| 143 // the CreateSnapshotFile request. | |
| 144 void OnDidCreateSnapshotFile( | 143 void OnDidCreateSnapshotFile( |
| 145 const AsyncFileUtil::CreateSnapshotFileCallback& callback, | 144 const AsyncFileUtil::CreateSnapshotFileCallback& callback, |
| 146 base::SequencedTaskRunner* media_task_runner, | 145 base::SequencedTaskRunner* media_task_runner, |
| 147 const base::PlatformFileInfo& file_info, | 146 const base::PlatformFileInfo& file_info, |
| 148 const base::FilePath& platform_path); | 147 const base::FilePath& platform_path); |
| 149 | 148 |
| 149 // Called after OnDidCreateSnapshotFile finishes media check. | |
| 150 // |callback| is invoked to complete the CreateSnapshotFile request. | |
| 151 // It is called with |*error| regardless of result. | |
| 152 void OnDidCheckMediaRunTask( | |
|
vandebo (ex-Chrome)
2013/04/30 21:20:36
nit: I think this should be just OnDidCheckMedia.
Kevin Bailey
2013/05/02 00:54:02
Done.
| |
| 153 const AsyncFileUtil::CreateSnapshotFileCallback& callback, | |
| 154 base::SequencedTaskRunner* media_task_runner, | |
| 155 const base::PlatformFileInfo& file_info, | |
| 156 const base::FilePath& platform_path, | |
| 157 base::PlatformFileError* error); | |
| 158 | |
| 150 // Called when CreateSnapshotFile method call fails. |callback| is invoked to | 159 // Called when CreateSnapshotFile method call fails. |callback| is invoked to |
| 151 // notify the caller about the |error|. | 160 // notify the caller about the |error|. |
| 152 void OnCreateSnapshotFileError( | 161 void OnCreateSnapshotFileError( |
| 153 const AsyncFileUtil::CreateSnapshotFileCallback& callback, | 162 const AsyncFileUtil::CreateSnapshotFileCallback& callback, |
| 154 base::PlatformFileError error); | 163 base::PlatformFileError error); |
| 155 | 164 |
| 156 // Called when the snapshot file specified by the |snapshot_file_path| is | 165 // Called when the snapshot file specified by the |snapshot_file_path| is |
| 157 // created to hold the contents of the |device_file_path|. If the snapshot | 166 // created to hold the contents of the |device_file_path|. If the snapshot |
| 158 // file is successfully created, |snapshot_file_path| will be an non-empty | 167 // file is successfully created, |snapshot_file_path| will be an non-empty |
| 159 // file path. In case of failure, |snapshot_file_path| will be an empty file | 168 // file path. In case of failure, |snapshot_file_path| will be an empty file |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 170 | 179 |
| 171 // For callbacks that may run after destruction. | 180 // For callbacks that may run after destruction. |
| 172 base::WeakPtrFactory<DeviceMediaAsyncFileUtil> weak_ptr_factory_; | 181 base::WeakPtrFactory<DeviceMediaAsyncFileUtil> weak_ptr_factory_; |
| 173 | 182 |
| 174 DISALLOW_COPY_AND_ASSIGN(DeviceMediaAsyncFileUtil); | 183 DISALLOW_COPY_AND_ASSIGN(DeviceMediaAsyncFileUtil); |
| 175 }; | 184 }; |
| 176 | 185 |
| 177 } // namespace chrome | 186 } // namespace chrome |
| 178 | 187 |
| 179 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_DEVICE_MEDIA_ASYNC_FILE_UTIL_H _ | 188 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_DEVICE_MEDIA_ASYNC_FILE_UTIL_H _ |
| OLD | NEW |