diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-27 18:37:08 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-27 18:37:08 +0000 |
commit | c5a272dbd00c74dffe922523811a4ecbcd7f882b (patch) | |
tree | 90528ee8bec3657a531a2f5095aff97f5f0a3f18 /chrome/browser/worker_host | |
parent | 445028be1162ed994286addce0b27d0e6239382d (diff) | |
download | chromium_src-c5a272dbd00c74dffe922523811a4ecbcd7f882b.zip chromium_src-c5a272dbd00c74dffe922523811a4ecbcd7f882b.tar.gz chromium_src-c5a272dbd00c74dffe922523811a4ecbcd7f882b.tar.bz2 |
Add Worker support for FileSystem API.
(corresponds to https://bugs.webkit.org/show_bug.cgi?id=45808)
No support for shared workers yet.
BUG=32277
TEST=none; layout tests will be added later.
Review URL: http://codereview.chromium.org/3394003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60683 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/worker_host')
-rw-r--r-- | chrome/browser/worker_host/worker_process_host.cc | 13 | ||||
-rw-r--r-- | chrome/browser/worker_host/worker_process_host.h | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/chrome/browser/worker_host/worker_process_host.cc b/chrome/browser/worker_host/worker_process_host.cc index 32ce928..868ba6c 100644 --- a/chrome/browser/worker_host/worker_process_host.cc +++ b/chrome/browser/worker_host/worker_process_host.cc @@ -16,6 +16,7 @@ #include "chrome/browser/appcache/appcache_dispatcher_host.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/child_process_security_policy.h" +#include "chrome/browser/file_system/file_system_dispatcher_host.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/profile.h" #include "chrome/browser/renderer_host/blob_dispatcher_host.h" @@ -67,7 +68,11 @@ WorkerProcessHost::WorkerProcessHost( new AppCacheDispatcherHost(request_context)), ALLOW_THIS_IN_INITIALIZER_LIST(blob_dispatcher_host_( new BlobDispatcherHost( - this->id(), request_context->blob_storage_context()))) { + this->id(), request_context->blob_storage_context()))), + ALLOW_THIS_IN_INITIALIZER_LIST(file_system_dispatcher_host_( + new FileSystemDispatcherHost(this, + request_context->file_system_host_context(), + request_context->host_content_settings_map()))) { next_route_id_callback_.reset(NewCallbackWithReturnValue( WorkerService::GetInstance(), &WorkerService::next_worker_route_id)); db_dispatcher_host_ = new DatabaseDispatcherHost( @@ -83,6 +88,9 @@ WorkerProcessHost::~WorkerProcessHost() { // Shut down the blob dispatcher host. blob_dispatcher_host_->Shutdown(); + // Shut down the file system dispatcher host. + file_system_dispatcher_host_->Shutdown(); + // Let interested observers know we are being deleted. NotificationService::current()->Notify( NotificationType::WORKER_PROCESS_HOST_SHUTDOWN, @@ -129,6 +137,7 @@ bool WorkerProcessHost::Init() { #if defined(OS_WIN) switches::kDisableDesktopNotifications, #endif + switches::kEnableFileSystem, }; cmd_line->CopySwitchesFrom(*CommandLine::ForCurrentProcess(), kSwitchNames, arraysize(kSwitchNames)); @@ -241,6 +250,7 @@ void WorkerProcessHost::OnMessageReceived(const IPC::Message& message) { appcache_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) || db_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) || blob_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) || + file_system_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) || MessagePortDispatcher::GetInstance()->OnMessageReceived( message, this, next_route_id_callback_.get(), &msg_is_ok); @@ -289,6 +299,7 @@ void WorkerProcessHost::OnMessageReceived(const IPC::Message& message) { void WorkerProcessHost::OnProcessLaunched() { db_dispatcher_host_->Init(handle()); + file_system_dispatcher_host_->Init(handle()); } CallbackWithReturnValue<int>::Type* WorkerProcessHost::GetNextRouteIdCallback( diff --git a/chrome/browser/worker_host/worker_process_host.h b/chrome/browser/worker_host/worker_process_host.h index e009813..0bdc4ef 100644 --- a/chrome/browser/worker_host/worker_process_host.h +++ b/chrome/browser/worker_host/worker_process_host.h @@ -22,6 +22,7 @@ class BlobDispatcherHost; class ChromeURLRequestContext; class ChromeURLRequestContextGetter; class DatabaseDispatcherHost; +class FileSystemDispatcherHost; namespace webkit_database { class DatabaseTracker; } // namespace webkit_database @@ -197,6 +198,7 @@ class WorkerProcessHost : public BrowserChildProcessHost { scoped_ptr<AppCacheDispatcherHost> appcache_dispatcher_host_; scoped_refptr<DatabaseDispatcherHost> db_dispatcher_host_; scoped_ptr<BlobDispatcherHost> blob_dispatcher_host_; + scoped_refptr<FileSystemDispatcherHost> file_system_dispatcher_host_; // A callback to create a routing id for the associated worker process. scoped_ptr<CallbackWithReturnValue<int>::Type> next_route_id_callback_; |