diff options
author | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-27 22:43:19 +0000 |
---|---|---|
committer | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-27 22:43:19 +0000 |
commit | e5390a4d7d04cf148ace753239662a1bb32e5e4a (patch) | |
tree | 53192f394861d20aa36f80a96ced884f4ae3893d /chrome/browser/appcache | |
parent | fdb244d98291c7f801bb0a36c06de4a71b4895ae (diff) | |
download | chromium_src-e5390a4d7d04cf148ace753239662a1bb32e5e4a.zip chromium_src-e5390a4d7d04cf148ace753239662a1bb32e5e4a.tar.gz chromium_src-e5390a4d7d04cf148ace753239662a1bb32e5e4a.tar.bz2 |
Fully connect the dots between workers and appcache resource loading.
* Split WorkerService CreateWorker into distinct methods for 'shared' vs 'dedicated' workers.
* Include additional appcache params in WorkerService CreateSharedWorker and CreateDedicatedWorker methods.
* Store those additional params in WorkerInstance object.
* Pass those additional params to the worker process.
* Use those additional params when initiating the appcache host for the worker when calling SelectCacheForWorker and SelectCacheForSharedWorker.
* Add browser process message handlers and dispatching for the SelectCacheForWorker and SelectCacheForSharedWorker IPC messages.
* Runtime enable the appcache feature in the worker processes.
BUG=39368
TEST=manual for now, but i need to create layout tests for this
Review URL: http://codereview.chromium.org/2238001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48441 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/appcache')
-rw-r--r-- | chrome/browser/appcache/appcache_dispatcher_host.cc | 28 | ||||
-rw-r--r-- | chrome/browser/appcache/appcache_dispatcher_host.h | 3 |
2 files changed, 31 insertions, 0 deletions
diff --git a/chrome/browser/appcache/appcache_dispatcher_host.cc b/chrome/browser/appcache/appcache_dispatcher_host.cc index 2ef6fca..2edb22f 100644 --- a/chrome/browser/appcache/appcache_dispatcher_host.cc +++ b/chrome/browser/appcache/appcache_dispatcher_host.cc @@ -63,6 +63,10 @@ bool AppCacheDispatcherHost::OnMessageReceived(const IPC::Message& msg, IPC_MESSAGE_HANDLER(AppCacheMsg_RegisterHost, OnRegisterHost); IPC_MESSAGE_HANDLER(AppCacheMsg_UnregisterHost, OnUnregisterHost); IPC_MESSAGE_HANDLER(AppCacheMsg_SelectCache, OnSelectCache); + IPC_MESSAGE_HANDLER(AppCacheMsg_SelectCacheForWorker, + OnSelectCacheForWorker); + IPC_MESSAGE_HANDLER(AppCacheMsg_SelectCacheForSharedWorker, + OnSelectCacheForSharedWorker); IPC_MESSAGE_HANDLER(AppCacheMsg_MarkAsForeignEntry, OnMarkAsForeignEntry); IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheMsg_GetStatus, OnGetStatus); IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheMsg_StartUpdate, OnStartUpdate); @@ -104,6 +108,30 @@ void AppCacheDispatcherHost::OnSelectCache( } } +void AppCacheDispatcherHost::OnSelectCacheForWorker( + int host_id, int parent_process_id, int parent_host_id) { + if (appcache_service_.get()) { + if (!backend_impl_.SelectCacheForWorker( + host_id, parent_process_id, parent_host_id)) { + ReceivedBadMessage(AppCacheMsg_SelectCacheForWorker::ID); + } + } else { + frontend_proxy_.OnCacheSelected( + host_id, appcache::kNoCacheId, appcache::UNCACHED); + } +} + +void AppCacheDispatcherHost::OnSelectCacheForSharedWorker( + int host_id, int64 appcache_id) { + if (appcache_service_.get()) { + if (!backend_impl_.SelectCacheForSharedWorker(host_id, appcache_id)) + ReceivedBadMessage(AppCacheMsg_SelectCacheForSharedWorker::ID); + } else { + frontend_proxy_.OnCacheSelected( + host_id, appcache::kNoCacheId, appcache::UNCACHED); + } +} + void AppCacheDispatcherHost::OnMarkAsForeignEntry( int host_id, const GURL& document_url, int64 cache_document_was_loaded_from) { diff --git a/chrome/browser/appcache/appcache_dispatcher_host.h b/chrome/browser/appcache/appcache_dispatcher_host.h index c4831a4..887a9af 100644 --- a/chrome/browser/appcache/appcache_dispatcher_host.h +++ b/chrome/browser/appcache/appcache_dispatcher_host.h @@ -50,6 +50,9 @@ class AppCacheDispatcherHost { void OnSelectCache(int host_id, const GURL& document_url, int64 cache_document_was_loaded_from, const GURL& opt_manifest_url); + void OnSelectCacheForWorker(int host_id, int parent_process_id, + int parent_host_id); + void OnSelectCacheForSharedWorker(int host_id, int64 appcache_id); void OnMarkAsForeignEntry(int host_id, const GURL& document_url, int64 cache_document_was_loaded_from); void OnGetStatus(int host_id, IPC::Message* reply_msg); |