Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: webkit/browser/fileapi/async_file_test_helper.cc

Issue 24030002: Adds callbacks to notify progress into Copy's API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/fileapi/fileapi_message_filter.cc ('k') | webkit/browser/fileapi/copy_or_move_operation_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698