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 "webkit/browser/fileapi/native_file_util.h" | 5 #include "webkit/browser/fileapi/native_file_util.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_enumerator.h" | 8 #include "base/files/file_enumerator.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "webkit/browser/fileapi/file_system_operation_context.h" | 10 #include "webkit/browser/fileapi/file_system_operation_context.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 if (!base::DeleteFile(path, false)) | 257 if (!base::DeleteFile(path, false)) |
258 return base::PLATFORM_FILE_ERROR_FAILED; | 258 return base::PLATFORM_FILE_ERROR_FAILED; |
259 return base::PLATFORM_FILE_OK; | 259 return base::PLATFORM_FILE_OK; |
260 } | 260 } |
261 | 261 |
262 PlatformFileError NativeFileUtil::DeleteDirectory(const base::FilePath& path) { | 262 PlatformFileError NativeFileUtil::DeleteDirectory(const base::FilePath& path) { |
263 if (!base::PathExists(path)) | 263 if (!base::PathExists(path)) |
264 return base::PLATFORM_FILE_ERROR_NOT_FOUND; | 264 return base::PLATFORM_FILE_ERROR_NOT_FOUND; |
265 if (!base::DirectoryExists(path)) | 265 if (!base::DirectoryExists(path)) |
266 return base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY; | 266 return base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY; |
267 if (!file_util::IsDirectoryEmpty(path)) | 267 if (!base::IsDirectoryEmpty(path)) |
268 return base::PLATFORM_FILE_ERROR_NOT_EMPTY; | 268 return base::PLATFORM_FILE_ERROR_NOT_EMPTY; |
269 if (!base::DeleteFile(path, false)) | 269 if (!base::DeleteFile(path, false)) |
270 return base::PLATFORM_FILE_ERROR_FAILED; | 270 return base::PLATFORM_FILE_ERROR_FAILED; |
271 return base::PLATFORM_FILE_OK; | 271 return base::PLATFORM_FILE_OK; |
272 } | 272 } |
273 | 273 |
274 } // namespace fileapi | 274 } // namespace fileapi |
OLD | NEW |