| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "content/public/test/async_file_test_helper.h" | 9 #include "content/public/test/async_file_test_helper.h" |
| 10 #include "storage/browser/fileapi/file_system_backend.h" | 10 #include "storage/browser/fileapi/file_system_backend.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 return CopyWithProgress(context, src, dest, CopyProgressCallback()); | 97 return CopyWithProgress(context, src, dest, CopyProgressCallback()); |
| 98 } | 98 } |
| 99 | 99 |
| 100 base::File::Error AsyncFileTestHelper::CopyWithProgress( | 100 base::File::Error AsyncFileTestHelper::CopyWithProgress( |
| 101 storage::FileSystemContext* context, | 101 storage::FileSystemContext* context, |
| 102 const storage::FileSystemURL& src, | 102 const storage::FileSystemURL& src, |
| 103 const storage::FileSystemURL& dest, | 103 const storage::FileSystemURL& dest, |
| 104 const CopyProgressCallback& progress_callback) { | 104 const CopyProgressCallback& progress_callback) { |
| 105 base::File::Error result = base::File::FILE_ERROR_FAILED; | 105 base::File::Error result = base::File::FILE_ERROR_FAILED; |
| 106 base::RunLoop run_loop; | 106 base::RunLoop run_loop; |
| 107 context->operation_runner()->Copy(src, | 107 context->operation_runner()->Copy( |
| 108 dest, | 108 src, dest, storage::FileSystemOperation::OPTION_NONE, |
| 109 storage::FileSystemOperation::OPTION_NONE, | 109 storage::FileSystemOperation::ERROR_BEHAVIOR_TERMINATE, progress_callback, |
| 110 progress_callback, | 110 AssignAndQuitCallback(&run_loop, &result)); |
| 111 AssignAndQuitCallback(&run_loop, &result)); | |
| 112 run_loop.Run(); | 111 run_loop.Run(); |
| 113 return result; | 112 return result; |
| 114 } | 113 } |
| 115 | 114 |
| 116 base::File::Error AsyncFileTestHelper::Move( | 115 base::File::Error AsyncFileTestHelper::Move( |
| 117 storage::FileSystemContext* context, | 116 storage::FileSystemContext* context, |
| 118 const storage::FileSystemURL& src, | 117 const storage::FileSystemURL& src, |
| 119 const storage::FileSystemURL& dest) { | 118 const storage::FileSystemURL& dest) { |
| 120 base::File::Error result = base::File::FILE_ERROR_FAILED; | 119 base::File::Error result = base::File::FILE_ERROR_FAILED; |
| 121 base::RunLoop run_loop; | 120 base::RunLoop run_loop; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 storage::QuotaStatusCode status = storage::kQuotaStatusUnknown; | 261 storage::QuotaStatusCode status = storage::kQuotaStatusUnknown; |
| 263 quota_manager->GetUsageAndQuota( | 262 quota_manager->GetUsageAndQuota( |
| 264 origin, | 263 origin, |
| 265 FileSystemTypeToQuotaStorageType(type), | 264 FileSystemTypeToQuotaStorageType(type), |
| 266 base::Bind(&DidGetUsageAndQuota, &status, usage, quota)); | 265 base::Bind(&DidGetUsageAndQuota, &status, usage, quota)); |
| 267 base::RunLoop().RunUntilIdle(); | 266 base::RunLoop().RunUntilIdle(); |
| 268 return status; | 267 return status; |
| 269 } | 268 } |
| 270 | 269 |
| 271 } // namespace storage | 270 } // namespace storage |
| OLD | NEW |