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

Unified Diff: content/browser/file_system/file_system_dispatcher_host.cc

Issue 7618039: PPB_URLRequestInfo::AppendFileToBody using sync ipc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 4 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/browser/file_system/file_system_dispatcher_host.h ('k') | content/common/file_system_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/file_system/file_system_dispatcher_host.cc
diff --git a/content/browser/file_system/file_system_dispatcher_host.cc b/content/browser/file_system/file_system_dispatcher_host.cc
index a66e9f88eb95a772391ac6ceaa9e98e687132e97..8d886dcc54bd1c4c0015a4bfa43eabec68612d25 100644
--- a/content/browser/file_system/file_system_dispatcher_host.cc
+++ b/content/browser/file_system/file_system_dispatcher_host.cc
@@ -25,7 +25,9 @@
#include "webkit/fileapi/file_system_util.h"
using fileapi::FileSystemCallbackDispatcher;
+using fileapi::FileSystemFileUtil;
using fileapi::FileSystemOperation;
+using fileapi::FileSystemOperationContext;
class BrowserFileSystemCallbackDispatcher
: public FileSystemCallbackDispatcher {
@@ -126,6 +128,13 @@ void FileSystemDispatcherHost::OnChannelConnected(int32 peer_pid) {
DCHECK(context_);
}
+void FileSystemDispatcherHost::OverrideThreadForMessage(
+ const IPC::Message& message,
+ BrowserThread::ID* thread) {
+ if (message.type() == FileSystemHostMsg_SyncGetPlatformPath::ID)
+ *thread = BrowserThread::FILE;
+}
+
bool FileSystemDispatcherHost::OnMessageReceived(
const IPC::Message& message, bool* message_was_ok) {
*message_was_ok = true;
@@ -146,6 +155,8 @@ bool FileSystemDispatcherHost::OnMessageReceived(
IPC_MESSAGE_HANDLER(FileSystemHostMsg_OpenFile, OnOpenFile)
IPC_MESSAGE_HANDLER(FileSystemHostMsg_WillUpdate, OnWillUpdate)
IPC_MESSAGE_HANDLER(FileSystemHostMsg_DidUpdate, OnDidUpdate)
+ IPC_MESSAGE_HANDLER(FileSystemHostMsg_SyncGetPlatformPath,
+ OnSyncGetPlatformPath)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP_EX()
return handled;
@@ -269,6 +280,28 @@ void FileSystemDispatcherHost::OnDidUpdate(const GURL& path, int64 delta) {
quota_util->proxy()->EndUpdateOrigin(origin_url, type);
}
+void FileSystemDispatcherHost::OnSyncGetPlatformPath(
+ const GURL& path, FilePath* platform_path) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK(platform_path);
+ *platform_path = FilePath();
+ base::PlatformFileInfo info;
+ GURL origin_url;
+ fileapi::FileSystemType type;
+ FilePath virtual_path;
+ if (!CrackFileSystemURL(path, &origin_url, &type, &virtual_path))
+ return;
+ FileSystemFileUtil* file_util =
+ context_->path_manager()->GetFileSystemFileUtil(type);
+ if (!file_util)
+ return;
+ FileSystemOperationContext operation_context(context_, file_util);
+ operation_context.set_src_origin_url(origin_url);
+ operation_context.set_src_type(type);
+ file_util->GetFileInfo(&operation_context, virtual_path,
+ &info, platform_path);
+}
+
FileSystemOperation* FileSystemDispatcherHost::GetNewOperation(
int request_id) {
BrowserFileSystemCallbackDispatcher* dispatcher =
« no previous file with comments | « content/browser/file_system/file_system_dispatcher_host.h ('k') | content/common/file_system_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698