| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/file_util.h" | 6 #include "base/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 "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "webkit/browser/fileapi/async_file_test_helper.h" | 10 #include "webkit/browser/fileapi/async_file_test_helper.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 const int64 AsyncFileTestHelper::kDontCheckSize = -1; | 91 const int64 AsyncFileTestHelper::kDontCheckSize = -1; |
| 92 | 92 |
| 93 base::PlatformFileError AsyncFileTestHelper::Copy( | 93 base::PlatformFileError AsyncFileTestHelper::Copy( |
| 94 FileSystemContext* context, | 94 FileSystemContext* context, |
| 95 const FileSystemURL& src, | 95 const FileSystemURL& src, |
| 96 const FileSystemURL& dest) { | 96 const FileSystemURL& dest) { |
| 97 base::PlatformFileError result = base::PLATFORM_FILE_ERROR_FAILED; | 97 base::PlatformFileError result = base::PLATFORM_FILE_ERROR_FAILED; |
| 98 base::RunLoop run_loop; | 98 base::RunLoop run_loop; |
| 99 context->operation_runner()->Copy( | 99 context->operation_runner()->Copy( |
| 100 src, dest, AssignAndQuitCallback(&run_loop, &result)); | 100 src, dest, FileSystemOperationRunner::CopyProgressCallback(), |
| 101 AssignAndQuitCallback(&run_loop, &result)); |
| 101 run_loop.Run(); | 102 run_loop.Run(); |
| 102 return result; | 103 return result; |
| 103 } | 104 } |
| 104 | 105 |
| 105 base::PlatformFileError AsyncFileTestHelper::Move( | 106 base::PlatformFileError AsyncFileTestHelper::Move( |
| 106 FileSystemContext* context, | 107 FileSystemContext* context, |
| 107 const FileSystemURL& src, | 108 const FileSystemURL& src, |
| 108 const FileSystemURL& dest) { | 109 const FileSystemURL& dest) { |
| 109 base::PlatformFileError result = base::PLATFORM_FILE_ERROR_FAILED; | 110 base::PlatformFileError result = base::PLATFORM_FILE_ERROR_FAILED; |
| 110 base::RunLoop run_loop; | 111 base::RunLoop run_loop; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 quota::QuotaStatusCode status = quota::kQuotaStatusUnknown; | 252 quota::QuotaStatusCode status = quota::kQuotaStatusUnknown; |
| 252 quota_manager->GetUsageAndQuota( | 253 quota_manager->GetUsageAndQuota( |
| 253 origin, | 254 origin, |
| 254 FileSystemTypeToQuotaStorageType(type), | 255 FileSystemTypeToQuotaStorageType(type), |
| 255 base::Bind(&DidGetUsageAndQuota, &status, usage, quota)); | 256 base::Bind(&DidGetUsageAndQuota, &status, usage, quota)); |
| 256 base::MessageLoop::current()->RunUntilIdle(); | 257 base::MessageLoop::current()->RunUntilIdle(); |
| 257 return status; | 258 return status; |
| 258 } | 259 } |
| 259 | 260 |
| 260 } // namespace fileapi | 261 } // namespace fileapi |
| OLD | NEW |