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

Unified Diff: chrome/common/file_system/file_system_dispatcher.cc

Issue 3394003: Add Worker support for FileSystem API. (Closed)
Patch Set: '' Created 10 years, 3 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: chrome/common/file_system/file_system_dispatcher.cc
diff --git a/chrome/common/file_system/file_system_dispatcher.cc b/chrome/common/file_system/file_system_dispatcher.cc
index 8ae0c165b4efce85055cacdea0b5494f4b9f9b32..6f5d2a36f9242ed0e6075c5334c8a19e8b7524ae 100644
--- a/chrome/common/file_system/file_system_dispatcher.cc
+++ b/chrome/common/file_system/file_system_dispatcher.cc
@@ -8,7 +8,6 @@
#include "chrome/common/child_thread.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/render_messages_params.h"
-#include "webkit/glue/webkit_glue.h"
FileSystemDispatcher::FileSystemDispatcher() {
}
@@ -28,6 +27,8 @@ FileSystemDispatcher::~FileSystemDispatcher() {
bool FileSystemDispatcher::OnMessageReceived(const IPC::Message& msg) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(FileSystemDispatcher, msg)
+ IPC_MESSAGE_HANDLER(ViewMsg_OpenFileSystemRequest_Complete,
+ OnOpenFileSystemRequestComplete)
IPC_MESSAGE_HANDLER(ViewMsg_FileSystem_DidSucceed, DidSucceed)
IPC_MESSAGE_HANDLER(ViewMsg_FileSystem_DidReadDirectory, DidReadDirectory)
IPC_MESSAGE_HANDLER(ViewMsg_FileSystem_DidReadMetadata, DidReadMetadata)
@@ -37,6 +38,14 @@ bool FileSystemDispatcher::OnMessageReceived(const IPC::Message& msg) {
return handled;
}
+void FileSystemDispatcher::OpenFileSystem(
+ const GURL& origin_url, fileapi::FileSystemType type,
+ long long size, fileapi::FileSystemCallbackDispatcher* dispatcher) {
+ int request_id = dispatchers_.Add(dispatcher);
+ ChildThread::current()->Send(new ViewHostMsg_OpenFileSystemRequest(
+ request_id, origin_url, type, size));
+}
+
bool FileSystemDispatcher::Move(
const FilePath& src_path,
const FilePath& dest_path,
@@ -99,6 +108,19 @@ bool FileSystemDispatcher::ReadDirectory(
new ViewHostMsg_FileSystem_ReadDirectory(request_id, path));
}
+void FileSystemDispatcher::OnOpenFileSystemRequestComplete(
+ int request_id, bool accepted, const std::string& name,
+ const FilePath& root_path) {
+ fileapi::FileSystemCallbackDispatcher* dispatcher =
+ dispatchers_.Lookup(request_id);
+ DCHECK(dispatcher);
+ if (accepted)
+ dispatcher->DidOpenFileSystem(name, root_path);
+ else
+ dispatcher->DidFail(base::PLATFORM_FILE_ERROR_SECURITY);
+ dispatchers_.Remove(request_id);
+}
+
void FileSystemDispatcher::DidSucceed(int request_id) {
fileapi::FileSystemCallbackDispatcher* dispatcher =
dispatchers_.Lookup(request_id);
« no previous file with comments | « chrome/common/file_system/file_system_dispatcher.h ('k') | chrome/common/file_system/webfilesystem_callback_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698