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 "base/files/file.h" | 7 #include "base/files/file.h" |
8 #include "base/files/file_enumerator.h" | 8 #include "base/files/file_enumerator.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 class NativeFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator { | 76 class NativeFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator { |
77 public: | 77 public: |
78 NativeFileEnumerator(const base::FilePath& root_path, | 78 NativeFileEnumerator(const base::FilePath& root_path, |
79 bool recursive, | 79 bool recursive, |
80 int file_type) | 80 int file_type) |
81 : file_enum_(root_path, recursive, file_type) { | 81 : file_enum_(root_path, recursive, file_type) { |
82 } | 82 } |
83 | 83 |
84 virtual ~NativeFileEnumerator() {} | 84 virtual ~NativeFileEnumerator() {} |
85 | 85 |
86 virtual base::FilePath Next() OVERRIDE; | 86 virtual base::FilePath Next() override; |
87 virtual int64 Size() OVERRIDE; | 87 virtual int64 Size() override; |
88 virtual base::Time LastModifiedTime() OVERRIDE; | 88 virtual base::Time LastModifiedTime() override; |
89 virtual bool IsDirectory() OVERRIDE; | 89 virtual bool IsDirectory() override; |
90 | 90 |
91 private: | 91 private: |
92 base::FileEnumerator file_enum_; | 92 base::FileEnumerator file_enum_; |
93 base::FileEnumerator::FileInfo file_util_info_; | 93 base::FileEnumerator::FileInfo file_util_info_; |
94 }; | 94 }; |
95 | 95 |
96 base::FilePath NativeFileEnumerator::Next() { | 96 base::FilePath NativeFileEnumerator::Next() { |
97 base::FilePath rv = file_enum_.Next(); | 97 base::FilePath rv = file_enum_.Next(); |
98 if (!rv.empty()) | 98 if (!rv.empty()) |
99 file_util_info_ = file_enum_.GetInfo(); | 99 file_util_info_ = file_enum_.GetInfo(); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 if (!base::DirectoryExists(path)) | 306 if (!base::DirectoryExists(path)) |
307 return base::File::FILE_ERROR_NOT_A_DIRECTORY; | 307 return base::File::FILE_ERROR_NOT_A_DIRECTORY; |
308 if (!base::IsDirectoryEmpty(path)) | 308 if (!base::IsDirectoryEmpty(path)) |
309 return base::File::FILE_ERROR_NOT_EMPTY; | 309 return base::File::FILE_ERROR_NOT_EMPTY; |
310 if (!base::DeleteFile(path, false)) | 310 if (!base::DeleteFile(path, false)) |
311 return base::File::FILE_ERROR_FAILED; | 311 return base::File::FILE_ERROR_FAILED; |
312 return base::File::FILE_OK; | 312 return base::File::FILE_OK; |
313 } | 313 } |
314 | 314 |
315 } // namespace storage | 315 } // namespace storage |
OLD | NEW |