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/local_file_util.h" | 5 #include "storage/browser/fileapi/local_file_util.h" |
6 | 6 |
7 #include "base/files/file_enumerator.h" | 7 #include "base/files/file_enumerator.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/files/file_util_proxy.h" | 9 #include "base/files/file_util_proxy.h" |
10 #include "storage/browser/fileapi/async_file_util_adapter.h" | 10 #include "storage/browser/fileapi/async_file_util_adapter.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 class LocalFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator { | 25 class LocalFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator { |
26 public: | 26 public: |
27 LocalFileEnumerator(const base::FilePath& platform_root_path, | 27 LocalFileEnumerator(const base::FilePath& platform_root_path, |
28 const base::FilePath& virtual_root_path, | 28 const base::FilePath& virtual_root_path, |
29 int file_type) | 29 int file_type) |
30 : file_enum_(platform_root_path, false /* recursive */, file_type), | 30 : file_enum_(platform_root_path, false /* recursive */, file_type), |
31 platform_root_path_(platform_root_path), | 31 platform_root_path_(platform_root_path), |
32 virtual_root_path_(virtual_root_path) { | 32 virtual_root_path_(virtual_root_path) { |
33 } | 33 } |
34 | 34 |
35 virtual ~LocalFileEnumerator() {} | 35 ~LocalFileEnumerator() override {} |
36 | 36 |
37 virtual base::FilePath Next() override; | 37 base::FilePath Next() override; |
38 virtual int64 Size() override; | 38 int64 Size() override; |
39 virtual base::Time LastModifiedTime() override; | 39 base::Time LastModifiedTime() override; |
40 virtual bool IsDirectory() override; | 40 bool IsDirectory() override; |
41 | 41 |
42 private: | 42 private: |
43 base::FileEnumerator file_enum_; | 43 base::FileEnumerator file_enum_; |
44 base::FileEnumerator::FileInfo file_util_info_; | 44 base::FileEnumerator::FileInfo file_util_info_; |
45 base::FilePath platform_root_path_; | 45 base::FilePath platform_root_path_; |
46 base::FilePath virtual_root_path_; | 46 base::FilePath virtual_root_path_; |
47 }; | 47 }; |
48 | 48 |
49 base::FilePath LocalFileEnumerator::Next() { | 49 base::FilePath LocalFileEnumerator::Next() { |
50 base::FilePath next = file_enum_.Next(); | 50 base::FilePath next = file_enum_.Next(); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 base::FilePath* platform_path) { | 255 base::FilePath* platform_path) { |
256 DCHECK(file_info); | 256 DCHECK(file_info); |
257 // We're just returning the local file information. | 257 // We're just returning the local file information. |
258 *error = GetFileInfo(context, url, file_info, platform_path); | 258 *error = GetFileInfo(context, url, file_info, platform_path); |
259 if (*error == base::File::FILE_OK && file_info->is_directory) | 259 if (*error == base::File::FILE_OK && file_info->is_directory) |
260 *error = base::File::FILE_ERROR_NOT_A_FILE; | 260 *error = base::File::FILE_ERROR_NOT_A_FILE; |
261 return storage::ScopedFile(); | 261 return storage::ScopedFile(); |
262 } | 262 } |
263 | 263 |
264 } // namespace storage | 264 } // namespace storage |
OLD | NEW |