Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(762)

Unified Diff: ppapi/shared_impl/file_type_conversion.cc

Issue 16140025: Pepper: Refactor FileInfo conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698