| 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/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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "webkit/fileapi/file_system_operation_context.h" | 9 #include "webkit/browser/fileapi/file_system_operation_context.h" |
| 10 | 10 |
| 11 namespace fileapi { | 11 namespace fileapi { |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 // Sets permissions on directory at |dir_path| based on the target platform. | 15 // Sets permissions on directory at |dir_path| based on the target platform. |
| 16 // Returns true on success, or false otherwise. | 16 // Returns true on success, or false otherwise. |
| 17 // | 17 // |
| 18 // TODO(benchan): Find a better place outside webkit to host this function. | 18 // TODO(benchan): Find a better place outside webkit to host this function. |
| 19 bool SetPlatformSpecificDirectoryPermissions(const base::FilePath& dir_path) { | 19 bool SetPlatformSpecificDirectoryPermissions(const base::FilePath& dir_path) { |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 if (!file_util::DirectoryExists(path)) | 255 if (!file_util::DirectoryExists(path)) |
| 256 return base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY; | 256 return base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY; |
| 257 if (!file_util::IsDirectoryEmpty(path)) | 257 if (!file_util::IsDirectoryEmpty(path)) |
| 258 return base::PLATFORM_FILE_ERROR_NOT_EMPTY; | 258 return base::PLATFORM_FILE_ERROR_NOT_EMPTY; |
| 259 if (!file_util::Delete(path, false)) | 259 if (!file_util::Delete(path, false)) |
| 260 return base::PLATFORM_FILE_ERROR_FAILED; | 260 return base::PLATFORM_FILE_ERROR_FAILED; |
| 261 return base::PLATFORM_FILE_OK; | 261 return base::PLATFORM_FILE_OK; |
| 262 } | 262 } |
| 263 | 263 |
| 264 } // namespace fileapi | 264 } // namespace fileapi |
| OLD | NEW |