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

Side by Side Diff: webkit/fileapi/file_system_file_util_proxy.cc

Issue 12051055: 2nd try: FileAPI: Split recursive remove into multiple tasks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 10 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/file_system_file_util_proxy.h" 5 #include "webkit/fileapi/file_system_file_util_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/sequenced_task_runner.h" 9 #include "base/sequenced_task_runner.h"
10 #include "base/task_runner_util.h" 10 #include "base/task_runner_util.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 private: 102 private:
103 base::PlatformFileError error_; 103 base::PlatformFileError error_;
104 std::vector<Proxy::Entry> entries_; 104 std::vector<Proxy::Entry> entries_;
105 DISALLOW_COPY_AND_ASSIGN(ReadDirectoryHelper); 105 DISALLOW_COPY_AND_ASSIGN(ReadDirectoryHelper);
106 }; 106 };
107 107
108 } // namespace 108 } // namespace
109 109
110 // static 110 // static
111 bool FileSystemFileUtilProxy::Delete( 111 bool FileSystemFileUtilProxy::DeleteFile(
112 FileSystemOperationContext* context, 112 FileSystemOperationContext* context,
113 FileSystemFileUtil* file_util, 113 FileSystemFileUtil* file_util,
114 const FileSystemURL& url, 114 const FileSystemURL& url,
115 bool recursive,
116 const StatusCallback& callback) { 115 const StatusCallback& callback) {
117 return base::PostTaskAndReplyWithResult( 116 return base::PostTaskAndReplyWithResult(
118 context->task_runner(), FROM_HERE, 117 context->task_runner(), FROM_HERE,
119 Bind(&FileUtilHelper::Delete, context, file_util, url, recursive), 118 Bind(&FileSystemFileUtil::DeleteFile, Unretained(file_util),
119 context, url),
120 callback); 120 callback);
121 } 121 }
122 122
123 // static
124 bool FileSystemFileUtilProxy::DeleteDirectory(
125 FileSystemOperationContext* context,
126 FileSystemFileUtil* file_util,
127 const FileSystemURL& url,
128 const StatusCallback& callback) {
129 return base::PostTaskAndReplyWithResult(
130 context->task_runner(), FROM_HERE,
131 Bind(&FileSystemFileUtil::DeleteDirectory, Unretained(file_util),
132 context, url),
133 callback);
134 }
135
123 // static 136 // static
124 bool FileSystemFileUtilProxy::CreateOrOpen( 137 bool FileSystemFileUtilProxy::CreateOrOpen(
125 FileSystemOperationContext* context, 138 FileSystemOperationContext* context,
126 FileSystemFileUtil* file_util, 139 FileSystemFileUtil* file_util,
127 const FileSystemURL& url, 140 const FileSystemURL& url,
128 int file_flags, 141 int file_flags,
129 const CreateOrOpenCallback& callback) { 142 const CreateOrOpenCallback& callback) {
130 return base::FileUtilProxy::RelayCreateOrOpen( 143 return base::FileUtilProxy::RelayCreateOrOpen(
131 context->task_runner(), 144 context->task_runner(),
132 Bind(&FileSystemFileUtil::CreateOrOpen, Unretained(file_util), 145 Bind(&FileSystemFileUtil::CreateOrOpen, Unretained(file_util),
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 int64 length, 287 int64 length,
275 const StatusCallback& callback) { 288 const StatusCallback& callback) {
276 return base::PostTaskAndReplyWithResult( 289 return base::PostTaskAndReplyWithResult(
277 context->task_runner(), FROM_HERE, 290 context->task_runner(), FROM_HERE,
278 Bind(&FileSystemFileUtil::Truncate, Unretained(file_util), 291 Bind(&FileSystemFileUtil::Truncate, Unretained(file_util),
279 context, url, length), 292 context, url, length),
280 callback); 293 callback);
281 } 294 }
282 295
283 } // namespace fileapi 296 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_file_util_proxy.h ('k') | webkit/fileapi/local_file_system_operation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698