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/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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 if (!file_util::DirectoryExists(path)) | 256 if (!file_util::DirectoryExists(path)) |
257 return base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY; | 257 return base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY; |
258 if (!file_util::IsDirectoryEmpty(path)) | 258 if (!file_util::IsDirectoryEmpty(path)) |
259 return base::PLATFORM_FILE_ERROR_NOT_EMPTY; | 259 return base::PLATFORM_FILE_ERROR_NOT_EMPTY; |
260 if (!file_util::Delete(path, false)) | 260 if (!file_util::Delete(path, false)) |
261 return base::PLATFORM_FILE_ERROR_FAILED; | 261 return base::PLATFORM_FILE_ERROR_FAILED; |
262 return base::PLATFORM_FILE_OK; | 262 return base::PLATFORM_FILE_OK; |
263 } | 263 } |
264 | 264 |
265 } // namespace fileapi | 265 } // namespace fileapi |
OLD | NEW |