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 #include "webkit/fileapi/media/device_media_async_file_util.h" | 5 #include "webkit/fileapi/media/device_media_async_file_util.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "webkit/fileapi/file_system_context.h" | 10 #include "webkit/fileapi/file_system_context.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 const base::FilePath& platform_path) { | 309 const base::FilePath& platform_path) { |
310 if (!callback.is_null()) | 310 if (!callback.is_null()) |
311 callback.Run(base::PLATFORM_FILE_OK, file_info, platform_path, | 311 callback.Run(base::PLATFORM_FILE_OK, file_info, platform_path, |
312 kSnapshotFileTemporary); | 312 kSnapshotFileTemporary); |
313 } | 313 } |
314 | 314 |
315 void DeviceMediaAsyncFileUtil::OnCreateSnapshotFileError( | 315 void DeviceMediaAsyncFileUtil::OnCreateSnapshotFileError( |
316 const AsyncFileUtil::CreateSnapshotFileCallback& callback, | 316 const AsyncFileUtil::CreateSnapshotFileCallback& callback, |
317 base::PlatformFileError error) { | 317 base::PlatformFileError error) { |
318 if (!callback.is_null()) | 318 if (!callback.is_null()) |
319 callback.Run(error, base::PlatformFileInfo(), FilePath(), | 319 callback.Run(error, base::PlatformFileInfo(), base::FilePath(), |
320 kSnapshotFileTemporary); | 320 kSnapshotFileTemporary); |
321 } | 321 } |
322 | 322 |
323 void DeviceMediaAsyncFileUtil::OnSnapshotFileCreatedRunTask( | 323 void DeviceMediaAsyncFileUtil::OnSnapshotFileCreatedRunTask( |
324 FileSystemOperationContext* context, | 324 FileSystemOperationContext* context, |
325 const AsyncFileUtil::CreateSnapshotFileCallback& callback, | 325 const AsyncFileUtil::CreateSnapshotFileCallback& callback, |
326 const base::FilePath& device_file_path, | 326 const base::FilePath& device_file_path, |
327 base::FilePath* snapshot_file_path) { | 327 base::FilePath* snapshot_file_path) { |
328 DCHECK(IsOnIOThread(context)); | 328 DCHECK(IsOnIOThread(context)); |
329 if (!snapshot_file_path || snapshot_file_path->empty()) { | 329 if (!snapshot_file_path || snapshot_file_path->empty()) { |
(...skipping 10 matching lines...) Expand all Loading... |
340 *snapshot_file_path, | 340 *snapshot_file_path, |
341 base::Bind(&DeviceMediaAsyncFileUtil::OnDidCreateSnapshotFile, | 341 base::Bind(&DeviceMediaAsyncFileUtil::OnDidCreateSnapshotFile, |
342 weak_ptr_factory_.GetWeakPtr(), | 342 weak_ptr_factory_.GetWeakPtr(), |
343 callback), | 343 callback), |
344 base::Bind(&DeviceMediaAsyncFileUtil::OnCreateSnapshotFileError, | 344 base::Bind(&DeviceMediaAsyncFileUtil::OnCreateSnapshotFileError, |
345 weak_ptr_factory_.GetWeakPtr(), | 345 weak_ptr_factory_.GetWeakPtr(), |
346 callback)); | 346 callback)); |
347 } | 347 } |
348 | 348 |
349 } // namespace fileapi | 349 } // namespace fileapi |
OLD | NEW |