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

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

Issue 9616033: Merge CrossFileUtilHelper to FileUtilHelper as Copy() and Move(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 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/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "webkit/fileapi/cross_file_util_helper.h"
11 #include "webkit/fileapi/file_system_file_util.h" 10 #include "webkit/fileapi/file_system_file_util.h"
12 #include "webkit/fileapi/file_system_operation_context.h" 11 #include "webkit/fileapi/file_system_operation_context.h"
13 #include "webkit/fileapi/file_util_helper.h" 12 #include "webkit/fileapi/file_util_helper.h"
14 13
15 namespace fileapi { 14 namespace fileapi {
16 15
17 using base::Bind; 16 using base::Bind;
18 using base::Callback; 17 using base::Callback;
19 using base::Owned; 18 using base::Owned;
20 using base::PlatformFileError; 19 using base::PlatformFileError;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 123
125 // static 124 // static
126 bool FileSystemFileUtilProxy::Copy( 125 bool FileSystemFileUtilProxy::Copy(
127 MessageLoopProxy* message_loop_proxy, 126 MessageLoopProxy* message_loop_proxy,
128 FileSystemOperationContext* context, 127 FileSystemOperationContext* context,
129 FileSystemFileUtil* src_util, 128 FileSystemFileUtil* src_util,
130 FileSystemFileUtil* dest_util, 129 FileSystemFileUtil* dest_util,
131 const FileSystemPath& src_path, 130 const FileSystemPath& src_path,
132 const FileSystemPath& dest_path, 131 const FileSystemPath& dest_path,
133 const StatusCallback& callback) { 132 const StatusCallback& callback) {
134 CrossFileUtilHelper* helper =
135 new CrossFileUtilHelper(
136 context, src_util, dest_util, src_path, dest_path,
137 CrossFileUtilHelper::OPERATION_COPY);
138
139 return base::FileUtilProxy::RelayFileTask( 133 return base::FileUtilProxy::RelayFileTask(
140 message_loop_proxy, FROM_HERE, 134 message_loop_proxy, FROM_HERE,
141 Bind(&CrossFileUtilHelper::DoWork, Owned(helper)), 135 Bind(&FileUtilHelper::Copy,
136 context, src_util, dest_util, src_path, dest_path),
142 callback); 137 callback);
143 } 138 }
144 139
145 // static 140 // static
146 bool FileSystemFileUtilProxy::Move( 141 bool FileSystemFileUtilProxy::Move(
147 MessageLoopProxy* message_loop_proxy, 142 MessageLoopProxy* message_loop_proxy,
148 FileSystemOperationContext* context, 143 FileSystemOperationContext* context,
149 FileSystemFileUtil* src_util, 144 FileSystemFileUtil* src_util,
150 FileSystemFileUtil* dest_util, 145 FileSystemFileUtil* dest_util,
151 const FileSystemPath& src_path, 146 const FileSystemPath& src_path,
152 const FileSystemPath& dest_path, 147 const FileSystemPath& dest_path,
153 const StatusCallback& callback) { 148 const StatusCallback& callback) {
154 CrossFileUtilHelper* helper =
155 new CrossFileUtilHelper(
156 context, src_util, dest_util, src_path, dest_path,
157 CrossFileUtilHelper::OPERATION_MOVE);
158 return base::FileUtilProxy::RelayFileTask( 149 return base::FileUtilProxy::RelayFileTask(
159 message_loop_proxy, FROM_HERE, 150 message_loop_proxy, FROM_HERE,
160 Bind(&CrossFileUtilHelper::DoWork, Owned(helper)), 151 Bind(&FileUtilHelper::Move,
152 context, src_util, dest_util, src_path, dest_path),
161 callback); 153 callback);
162 } 154 }
163 155
164 // static 156 // static
165 bool FileSystemFileUtilProxy::EnsureFileExists( 157 bool FileSystemFileUtilProxy::EnsureFileExists(
166 MessageLoopProxy* message_loop_proxy, 158 MessageLoopProxy* message_loop_proxy,
167 FileSystemOperationContext* context, 159 FileSystemOperationContext* context,
168 FileSystemFileUtil* file_util, 160 FileSystemFileUtil* file_util,
169 const FileSystemPath& path, 161 const FileSystemPath& path,
170 const EnsureFileExistsCallback& callback) { 162 const EnsureFileExistsCallback& callback) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 int64 length, 239 int64 length,
248 const StatusCallback& callback) { 240 const StatusCallback& callback) {
249 return base::FileUtilProxy::RelayFileTask( 241 return base::FileUtilProxy::RelayFileTask(
250 message_loop_proxy, FROM_HERE, 242 message_loop_proxy, FROM_HERE,
251 Bind(&FileSystemFileUtil::Truncate, Unretained(file_util), 243 Bind(&FileSystemFileUtil::Truncate, Unretained(file_util),
252 context, path, length), 244 context, path, length),
253 callback); 245 callback);
254 } 246 }
255 247
256 } // namespace fileapi 248 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/cross_file_util_helper.cc ('k') | webkit/fileapi/file_system_file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698