diff options
Diffstat (limited to 'chrome/worker/worker_thread.cc')
-rw-r--r-- | chrome/worker/worker_thread.cc | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/chrome/worker/worker_thread.cc b/chrome/worker/worker_thread.cc index 8f32a6a..3e4a1d1 100644 --- a/chrome/worker/worker_thread.cc +++ b/chrome/worker/worker_thread.cc @@ -7,6 +7,7 @@ #include "base/command_line.h" #include "base/lazy_instance.h" #include "base/thread_local.h" +#include "chrome/common/appcache/appcache_dispatcher.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/db_message_filter.h" #include "chrome/common/web_database_observer_impl.h" @@ -29,16 +30,22 @@ WorkerThread::WorkerThread() { webkit_client_.reset(new WorkerWebKitClientImpl); WebKit::initialize(webkit_client_.get()); + appcache_dispatcher_.reset(new AppCacheDispatcher(this)); + web_database_observer_impl_.reset(new WebDatabaseObserverImpl(this)); WebKit::WebDatabase::setObserver(web_database_observer_impl_.get()); + db_message_filter_ = new DBMessageFilter(); + channel()->AddFilter(db_message_filter_.get()); const CommandLine& command_line = *CommandLine::ForCurrentProcess(); WebKit::WebRuntimeFeatures::enableDatabase( !command_line.HasSwitch(switches::kDisableDatabases)); - db_message_filter_ = new DBMessageFilter(); - channel()->AddFilter(db_message_filter_.get()); + // TODO(michaeln): Enable once the browser process is ready to receive + // the appcache messages. + WebKit::WebRuntimeFeatures::enableApplicationCache(false && + !command_line.HasSwitch(switches::kDisableApplicationCache)); #if defined(OS_WIN) // We don't yet support notifications on non-Windows, so hide it from pages. @@ -64,20 +71,27 @@ WorkerThread* WorkerThread::current() { } void WorkerThread::OnControlMessageReceived(const IPC::Message& msg) { + // Appcache messages are handled by a delegate. + if (appcache_dispatcher_->OnMessageReceived(msg)) + return; + IPC_BEGIN_MESSAGE_MAP(WorkerThread, msg) IPC_MESSAGE_HANDLER(WorkerProcessMsg_CreateWorker, OnCreateWorker) IPC_END_MESSAGE_MAP() } -void WorkerThread::OnCreateWorker(const GURL& url, - bool is_shared, - const string16& name, - int route_id) { +void WorkerThread::OnCreateWorker( + const WorkerProcessMsg_CreateWorker_Params& params) { + WorkerAppCacheInitInfo appcache_init_info( + params.is_shared, params.creator_process_id, + params.creator_appcache_host_id, + params.shared_worker_appcache_id); + // WebWorkerStub and WebSharedWorkerStub own themselves. - if (is_shared) - new WebSharedWorkerStub(name, route_id); + if (params.is_shared) + new WebSharedWorkerStub(params.name, params.route_id, appcache_init_info); else - new WebWorkerStub(url, route_id); + new WebWorkerStub(params.url, params.route_id, appcache_init_info); } // The browser process is likely dead. Terminate all workers. |