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

Unified Diff: chrome/browser/worker_host/worker_process_host.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
« no previous file with comments | « chrome/browser/worker_host/worker_process_host.h ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/worker_host/worker_process_host.cc
diff --git a/chrome/browser/worker_host/worker_process_host.cc b/chrome/browser/worker_host/worker_process_host.cc
index 1a9d167c4e7b43f4ee5a0360f5165b30911334f0..8e9f193d2971fdfcc9316d05885d7d54ceb1abc0 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/database_dispatcher_host.h"
@@ -63,7 +64,11 @@ WorkerProcessHost::WorkerProcessHost(
: BrowserChildProcessHost(WORKER_PROCESS, resource_dispatcher_host),
request_context_(request_context),
appcache_dispatcher_host_(
- new AppCacheDispatcherHost(request_context)) {
+ new AppCacheDispatcherHost(request_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(
@@ -76,6 +81,9 @@ WorkerProcessHost::~WorkerProcessHost() {
// Shut down the database dispatcher host.
db_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,
@@ -122,6 +130,7 @@ bool WorkerProcessHost::Init() {
#if defined(OS_WIN)
switches::kDisableDesktopNotifications,
#endif
+ switches::kEnableFileSystem,
};
cmd_line->CopySwitchesFrom(*CommandLine::ForCurrentProcess(), kSwitchNames,
arraysize(kSwitchNames));
@@ -233,6 +242,7 @@ void WorkerProcessHost::OnMessageReceived(const IPC::Message& message) {
bool handled =
appcache_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) ||
db_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);
@@ -281,6 +291,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(
« no previous file with comments | « chrome/browser/worker_host/worker_process_host.h ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698