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

Unified Diff: content/worker/worker_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
« no previous file with comments | « content/renderer/renderer_webkitplatformsupport_impl.cc ('k') | webkit/glue/webfileutilities_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/worker/worker_webkitplatformsupport_impl.cc
diff --git a/content/worker/worker_webkitplatformsupport_impl.cc b/content/worker/worker_webkitplatformsupport_impl.cc
index 45a2552bb74aa34b23be485cf75b074e43269373..2f03da85c172a1310c989812f0c9cc76caf5cd77 100644
--- a/content/worker/worker_webkitplatformsupport_impl.cc
+++ b/content/worker/worker_webkitplatformsupport_impl.cc
@@ -5,6 +5,7 @@
#include "content/worker/worker_webkitplatformsupport_impl.h"
#include "base/logging.h"
+#include "base/platform_file.h"
#include "base/utf_string_conversions.h"
#include "content/common/database_util.h"
#include "content/common/fileapi/webblobregistry_impl.h"
@@ -16,6 +17,7 @@
#include "content/worker/worker_thread.h"
#include "ipc/ipc_sync_message_filter.h"
#include "net/base/mime_util.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegistry.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
@@ -24,6 +26,7 @@
using WebKit::WebBlobRegistry;
using WebKit::WebClipboard;
+using WebKit::WebFileInfo;
using WebKit::WebFileSystem;
using WebKit::WebFileUtilities;
using WebKit::WebKitPlatformSupport;
@@ -43,6 +46,7 @@ class WorkerWebKitPlatformSupportImpl::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);
};
static bool SendSyncMessageFromAnyThread(IPC::SyncMessage* msg) {
@@ -81,6 +85,21 @@ bool WorkerWebKitPlatformSupportImpl::FileUtilities::getFileModificationTime(
return false;
}
+bool WorkerWebKitPlatformSupportImpl::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;
+}
+
//------------------------------------------------------------------------------
WorkerWebKitPlatformSupportImpl::WorkerWebKitPlatformSupportImpl() {
« no previous file with comments | « content/renderer/renderer_webkitplatformsupport_impl.cc ('k') | webkit/glue/webfileutilities_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698