| 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/fileapi/local_file_util.h" | 5 #include "webkit/fileapi/local_file_util.h" |
| 6 | 6 |
| 7 #include "base/file_util_proxy.h" | 7 #include "base/file_util_proxy.h" |
| 8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
| 9 #include "webkit/fileapi/file_system_context.h" | 9 #include "webkit/fileapi/file_system_context.h" |
| 10 #include "webkit/fileapi/file_system_mount_point_provider.h" | 10 #include "webkit/fileapi/file_system_mount_point_provider.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 memset(&file_util_info_, 0, sizeof(file_util_info_)); | 28 memset(&file_util_info_, 0, sizeof(file_util_info_)); |
| 29 #endif // defined(OS_WIN) | 29 #endif // defined(OS_WIN) |
| 30 } | 30 } |
| 31 | 31 |
| 32 ~LocalFileEnumerator() {} | 32 ~LocalFileEnumerator() {} |
| 33 | 33 |
| 34 virtual FilePath Next() OVERRIDE; | 34 virtual FilePath Next() OVERRIDE; |
| 35 virtual int64 Size() OVERRIDE; | 35 virtual int64 Size() OVERRIDE; |
| 36 virtual base::Time LastModifiedTime() OVERRIDE; | 36 virtual base::Time LastModifiedTime() OVERRIDE; |
| 37 virtual bool IsDirectory() OVERRIDE; | 37 virtual bool IsDirectory() OVERRIDE; |
| 38 virtual bool IsLink() OVERRIDE; |
| 38 | 39 |
| 39 private: | 40 private: |
| 40 file_util::FileEnumerator file_enum_; | 41 file_util::FileEnumerator file_enum_; |
| 41 file_util::FileEnumerator::FindInfo file_util_info_; | 42 file_util::FileEnumerator::FindInfo file_util_info_; |
| 42 FilePath platform_root_path_; | 43 FilePath platform_root_path_; |
| 43 FilePath virtual_root_path_; | 44 FilePath virtual_root_path_; |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 FilePath LocalFileEnumerator::Next() { | 47 FilePath LocalFileEnumerator::Next() { |
| 47 FilePath next = file_enum_.Next(); | 48 FilePath next = file_enum_.Next(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 59 } | 60 } |
| 60 | 61 |
| 61 base::Time LocalFileEnumerator::LastModifiedTime() { | 62 base::Time LocalFileEnumerator::LastModifiedTime() { |
| 62 return file_util::FileEnumerator::GetLastModifiedTime(file_util_info_); | 63 return file_util::FileEnumerator::GetLastModifiedTime(file_util_info_); |
| 63 } | 64 } |
| 64 | 65 |
| 65 bool LocalFileEnumerator::IsDirectory() { | 66 bool LocalFileEnumerator::IsDirectory() { |
| 66 return file_util::FileEnumerator::IsDirectory(file_util_info_); | 67 return file_util::FileEnumerator::IsDirectory(file_util_info_); |
| 67 } | 68 } |
| 68 | 69 |
| 70 bool LocalFileEnumerator::IsLink() { |
| 71 return file_util::FileEnumerator::IsLink(file_util_info_); |
| 72 } |
| 73 |
| 69 LocalFileUtil::LocalFileUtil(FileSystemFileUtil* underlying_file_util) | 74 LocalFileUtil::LocalFileUtil(FileSystemFileUtil* underlying_file_util) |
| 70 : FileSystemFileUtil(underlying_file_util) { | 75 : FileSystemFileUtil(underlying_file_util) { |
| 71 } | 76 } |
| 72 | 77 |
| 73 LocalFileUtil::~LocalFileUtil() { | 78 LocalFileUtil::~LocalFileUtil() { |
| 74 } | 79 } |
| 75 | 80 |
| 76 PlatformFileError LocalFileUtil::CreateOrOpen( | 81 PlatformFileError LocalFileUtil::CreateOrOpen( |
| 77 FileSystemOperationContext* context, | 82 FileSystemOperationContext* context, |
| 78 const FileSystemPath& path, int file_flags, | 83 const FileSystemPath& path, int file_flags, |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 context->file_system_context()->GetMountPointProvider(path.type()); | 273 context->file_system_context()->GetMountPointProvider(path.type()); |
| 269 DCHECK(provider); | 274 DCHECK(provider); |
| 270 FilePath root = provider->GetFileSystemRootPathOnFileThread( | 275 FilePath root = provider->GetFileSystemRootPathOnFileThread( |
| 271 path.origin(), path.type(), path.internal_path(), false); | 276 path.origin(), path.type(), path.internal_path(), false); |
| 272 if (root.empty()) | 277 if (root.empty()) |
| 273 return FileSystemPath(); | 278 return FileSystemPath(); |
| 274 return path.WithInternalPath(root.Append(path.internal_path())); | 279 return path.WithInternalPath(root.Append(path.internal_path())); |
| 275 } | 280 } |
| 276 | 281 |
| 277 } // namespace fileapi | 282 } // namespace fileapi |
| OLD | NEW |