| 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 16 matching lines...) Expand all Loading... |
| 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 virtual ~LocalFileEnumerator() {} |
| 36 | 36 |
| 37 virtual base::FilePath Next() OVERRIDE; | 37 virtual base::FilePath Next() override; |
| 38 virtual int64 Size() OVERRIDE; | 38 virtual int64 Size() override; |
| 39 virtual base::Time LastModifiedTime() OVERRIDE; | 39 virtual base::Time LastModifiedTime() override; |
| 40 virtual bool IsDirectory() OVERRIDE; | 40 virtual 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 base::FilePath* platform_path) { | 256 base::FilePath* platform_path) { |
| 257 DCHECK(file_info); | 257 DCHECK(file_info); |
| 258 // We're just returning the local file information. | 258 // We're just returning the local file information. |
| 259 *error = GetFileInfo(context, url, file_info, platform_path); | 259 *error = GetFileInfo(context, url, file_info, platform_path); |
| 260 if (*error == base::File::FILE_OK && file_info->is_directory) | 260 if (*error == base::File::FILE_OK && file_info->is_directory) |
| 261 *error = base::File::FILE_ERROR_NOT_A_FILE; | 261 *error = base::File::FILE_ERROR_NOT_A_FILE; |
| 262 return storage::ScopedFile(); | 262 return storage::ScopedFile(); |
| 263 } | 263 } |
| 264 | 264 |
| 265 } // namespace storage | 265 } // namespace storage |
| OLD | NEW |