| 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 "storage/browser/fileapi/native_file_util.h" | 5 #include "storage/browser/fileapi/native_file_util.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 return base::File::FILE_ERROR_NOT_FOUND; | 204 return base::File::FILE_ERROR_NOT_FOUND; |
| 205 | 205 |
| 206 if (!base::GetFileInfo(path, file_info)) | 206 if (!base::GetFileInfo(path, file_info)) |
| 207 return base::File::FILE_ERROR_FAILED; | 207 return base::File::FILE_ERROR_FAILED; |
| 208 return base::File::FILE_OK; | 208 return base::File::FILE_OK; |
| 209 } | 209 } |
| 210 | 210 |
| 211 std::unique_ptr<FileSystemFileUtil::AbstractFileEnumerator> | 211 std::unique_ptr<FileSystemFileUtil::AbstractFileEnumerator> |
| 212 NativeFileUtil::CreateFileEnumerator(const base::FilePath& root_path, | 212 NativeFileUtil::CreateFileEnumerator(const base::FilePath& root_path, |
| 213 bool recursive) { | 213 bool recursive) { |
| 214 return base::WrapUnique(new NativeFileEnumerator( | 214 return base::MakeUnique<NativeFileEnumerator>( |
| 215 root_path, recursive, | 215 root_path, recursive, |
| 216 base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES)); | 216 base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES); |
| 217 } | 217 } |
| 218 | 218 |
| 219 base::File::Error NativeFileUtil::Touch( | 219 base::File::Error NativeFileUtil::Touch( |
| 220 const base::FilePath& path, | 220 const base::FilePath& path, |
| 221 const base::Time& last_access_time, | 221 const base::Time& last_access_time, |
| 222 const base::Time& last_modified_time) { | 222 const base::Time& last_modified_time) { |
| 223 if (!base::TouchFile(path, last_access_time, last_modified_time)) | 223 if (!base::TouchFile(path, last_access_time, last_modified_time)) |
| 224 return base::File::FILE_ERROR_FAILED; | 224 return base::File::FILE_ERROR_FAILED; |
| 225 return base::File::FILE_OK; | 225 return base::File::FILE_OK; |
| 226 } | 226 } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 if (!base::DirectoryExists(path)) | 311 if (!base::DirectoryExists(path)) |
| 312 return base::File::FILE_ERROR_NOT_A_DIRECTORY; | 312 return base::File::FILE_ERROR_NOT_A_DIRECTORY; |
| 313 if (!base::IsDirectoryEmpty(path)) | 313 if (!base::IsDirectoryEmpty(path)) |
| 314 return base::File::FILE_ERROR_NOT_EMPTY; | 314 return base::File::FILE_ERROR_NOT_EMPTY; |
| 315 if (!base::DeleteFile(path, false)) | 315 if (!base::DeleteFile(path, false)) |
| 316 return base::File::FILE_ERROR_FAILED; | 316 return base::File::FILE_ERROR_FAILED; |
| 317 return base::File::FILE_OK; | 317 return base::File::FILE_OK; |
| 318 } | 318 } |
| 319 | 319 |
| 320 } // namespace storage | 320 } // namespace storage |
| OLD | NEW |