OLD | NEW |
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 "base/files/file_util_proxy.h" | 5 #include "base/files/file_util_proxy.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 return PLATFORM_FILE_ERROR_FAILED; | 206 return PLATFORM_FILE_ERROR_FAILED; |
207 } | 207 } |
208 return PLATFORM_FILE_OK; | 208 return PLATFORM_FILE_OK; |
209 } | 209 } |
210 | 210 |
211 PlatformFileError DeleteAdapter(const FilePath& file_path, bool recursive) { | 211 PlatformFileError DeleteAdapter(const FilePath& file_path, bool recursive) { |
212 if (!PathExists(file_path)) { | 212 if (!PathExists(file_path)) { |
213 return PLATFORM_FILE_ERROR_NOT_FOUND; | 213 return PLATFORM_FILE_ERROR_NOT_FOUND; |
214 } | 214 } |
215 if (!base::DeleteFile(file_path, recursive)) { | 215 if (!base::DeleteFile(file_path, recursive)) { |
216 if (!recursive && !file_util::IsDirectoryEmpty(file_path)) { | 216 if (!recursive && !base::IsDirectoryEmpty(file_path)) { |
217 return PLATFORM_FILE_ERROR_NOT_EMPTY; | 217 return PLATFORM_FILE_ERROR_NOT_EMPTY; |
218 } | 218 } |
219 return PLATFORM_FILE_ERROR_FAILED; | 219 return PLATFORM_FILE_ERROR_FAILED; |
220 } | 220 } |
221 return PLATFORM_FILE_OK; | 221 return PLATFORM_FILE_OK; |
222 } | 222 } |
223 | 223 |
224 } // namespace | 224 } // namespace |
225 | 225 |
226 // static | 226 // static |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 bool FileUtilProxy::RelayClose( | 405 bool FileUtilProxy::RelayClose( |
406 TaskRunner* task_runner, | 406 TaskRunner* task_runner, |
407 const CloseTask& close_task, | 407 const CloseTask& close_task, |
408 PlatformFile file_handle, | 408 PlatformFile file_handle, |
409 const StatusCallback& callback) { | 409 const StatusCallback& callback) { |
410 return base::PostTaskAndReplyWithResult( | 410 return base::PostTaskAndReplyWithResult( |
411 task_runner, FROM_HERE, Bind(close_task, file_handle), callback); | 411 task_runner, FROM_HERE, Bind(close_task, file_handle), callback); |
412 } | 412 } |
413 | 413 |
414 } // namespace base | 414 } // namespace base |
OLD | NEW |