Chromium Code Reviews| Index: ppapi/shared_impl/file_type_conversion.cc |
| diff --git a/ppapi/shared_impl/file_type_conversion.cc b/ppapi/shared_impl/file_type_conversion.cc |
| index 5185daa704c921f29c23c16fcf57b35f1de3f998..8022d2685490e1dfd3438874dca89b9e9fec51b0 100644 |
| --- a/ppapi/shared_impl/file_type_conversion.cc |
| +++ b/ppapi/shared_impl/file_type_conversion.cc |
| @@ -4,8 +4,10 @@ |
| #include "ppapi/shared_impl/file_type_conversion.h" |
| +#include "base/logging.h" |
| #include "ppapi/c/pp_errors.h" |
| #include "ppapi/c/ppb_file_io.h" |
| +#include "ppapi/shared_impl/time_conversion.h" |
| namespace ppapi { |
| @@ -73,4 +75,21 @@ bool PepperFileOpenFlagsToPlatformFileFlags(int32_t pp_open_flags, |
| return true; |
| } |
| +void PlatformFileInfoToPepperFileInfo(const base::PlatformFileInfo& info, |
| + PP_FileSystemType fs_type, |
| + PP_FileInfo *info_out) { |
|
yzshen1
2013/06/04 05:22:28
nit: '*' should be adjacent to PP_FileInfo.
|
| + DCHECK(info_out); |
| + info_out->size = info.size; |
| + info_out->creation_time = TimeToPPTime(info.creation_time); |
| + info_out->last_access_time = TimeToPPTime(info.last_accessed); |
| + info_out->last_modified_time = TimeToPPTime(info.last_modified); |
| + info_out->system_type = fs_type; |
| + if (info.is_directory) |
| + info_out->type = PP_FILETYPE_DIRECTORY; |
| + else if (info.is_symbolic_link) |
| + info_out->type = PP_FILETYPE_OTHER; |
| + else |
| + info_out->type = PP_FILETYPE_REGULAR; |
| +} |
| + |
| } // namespace ppapi |