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

Unified Diff: webkit/glue/webfileutilities_impl.cc

Issue 10441016: Add FileUtilities::GetFileInfo() to capture file metadata with single IPC (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « webkit/glue/webfileutilities_impl.h ('k') | webkit/glue/webkit_glue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webfileutilities_impl.cc
diff --git a/webkit/glue/webfileutilities_impl.cc b/webkit/glue/webfileutilities_impl.cc
index aefecf272a05cce0bc160ee217a025b98a54babc..76dc1c2bfa4c000901d537148e3406063c0ae1a2 100644
--- a/webkit/glue/webfileutilities_impl.cc
+++ b/webkit/glue/webfileutilities_impl.cc
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "net/base/file_stream.h"
#include "net/base/net_util.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
#include "webkit/glue/webkit_glue.h"
@@ -62,6 +63,21 @@ bool WebFileUtilitiesImpl::getFileModificationTime(const WebString& path,
return true;
}
+bool WebFileUtilitiesImpl::getFileInfo(const WebString& path,
+ WebKit::WebFileInfo& web_file_info) {
+ if (sandbox_enabled_) {
+ NOTREACHED();
+ return false;
+ }
+ base::PlatformFileInfo file_info;
+ if (!file_util::GetFileInfo(WebStringToFilePath(path), &file_info))
+ return false;
+
+ webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info);
+ web_file_info.platformPath = path;
+ return true;
+}
+
WebString WebFileUtilitiesImpl::directoryName(const WebString& path) {
FilePath file_path(WebStringToFilePathString(path));
return FilePathToWebString(file_path.DirName());
« no previous file with comments | « webkit/glue/webfileutilities_impl.h ('k') | webkit/glue/webkit_glue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698