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

Unified Diff: content/renderer/renderer_webkitplatformsupport_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
Index: content/renderer/renderer_webkitplatformsupport_impl.cc
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc
index f4b7d6e56a111d73beaa835dedf6ae4a09bf1cd1..580b11c185bde219805bf326b93efba279a47a99 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc
@@ -34,6 +34,7 @@
#include "googleurl/src/gurl.h"
#include "ipc/ipc_sync_message_filter.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegistry.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h"
@@ -79,6 +80,7 @@
using WebKit::WebAudioDevice;
using WebKit::WebBlobRegistry;
+using WebKit::WebFileInfo;
using WebKit::WebFileSystem;
using WebKit::WebFrame;
using WebKit::WebGamepads;
@@ -115,6 +117,7 @@ class RendererWebKitPlatformSupportImpl::FileUtilities
virtual bool getFileSize(const WebKit::WebString& path, long long& result);
virtual bool getFileModificationTime(const WebKit::WebString& path,
double& result);
+ virtual bool getFileInfo(const WebString& path, WebFileInfo& result);
virtual base::PlatformFile openFile(const WebKit::WebString& path,
int mode);
};
@@ -432,6 +435,21 @@ bool RendererWebKitPlatformSupportImpl::FileUtilities::getFileModificationTime(
return false;
}
+bool RendererWebKitPlatformSupportImpl::FileUtilities::getFileInfo(
+ const WebString& path,
+ WebFileInfo& web_file_info) {
+ base::PlatformFileInfo file_info;
+ base::PlatformFileError status;
+ if (!SendSyncMessageFromAnyThread(new FileUtilitiesMsg_GetFileInfo(
+ webkit_glue::WebStringToFilePath(path), &file_info, &status)) ||
+ status != base::PLATFORM_FILE_OK) {
+ return false;
+ }
+ webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info);
+ web_file_info.platformPath = path;
+ return true;
+}
+
base::PlatformFile RendererWebKitPlatformSupportImpl::FileUtilities::openFile(
const WebString& path,
int mode) {
« no previous file with comments | « content/common/fileapi/webfilesystem_callback_dispatcher.cc ('k') | content/worker/worker_webkitplatformsupport_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698