Index: content/browser/renderer_host/render_process_host_impl.cc |
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc |
index 646cd3d7c457a9ec5cee0cbb2bbcd833e46275b5..4239fc56b3b3865b13bf4185e8d5c8f9a05e520a 100644 |
--- a/content/browser/renderer_host/render_process_host_impl.cc |
+++ b/content/browser/renderer_host/render_process_host_impl.cc |
@@ -1062,8 +1062,7 @@ void RenderProcessHostImpl::CreateMessageFilters() { |
service_worker_filter->Init( |
storage_partition_impl_->GetServiceWorkerContext()); |
AddFilter(service_worker_filter.get()); |
- |
- AddFilter(new SharedWorkerMessageFilter( |
+ shared_worker_message_filter_ = new SharedWorkerMessageFilter( |
GetID(), resource_context, |
WorkerStoragePartition( |
storage_partition_impl_->GetURLRequestContext(), |
@@ -1074,7 +1073,8 @@ void RenderProcessHostImpl::CreateMessageFilters() { |
storage_partition_impl_->GetDatabaseTracker(), |
storage_partition_impl_->GetIndexedDBContext(), |
storage_partition_impl_->GetServiceWorkerContext()), |
- message_port_message_filter_.get())); |
+ message_port_message_filter_.get()); |
+ AddFilter(shared_worker_message_filter_.get()); |
#if defined(ENABLE_WEBRTC) |
p2p_socket_dispatcher_host_ = new P2PSocketDispatcherHost( |
@@ -1926,6 +1926,12 @@ bool RenderProcessHostImpl::IgnoreInputEvents() const { |
void RenderProcessHostImpl::Cleanup() { |
DCHECK_CURRENTLY_ON(BrowserThread::UI); |
+ // If there is no listeners, remove the reference from the all documents in |
+ // the renderer process to shared workers without waiting for DocumentDetached |
nhiroki
2016/08/17 07:34:06
"the reference to shared workers" ?
horo
2016/08/17 07:38:46
Done.
|
+ // IPC message. |
+ if (listeners_.IsEmpty()) |
+ shared_worker_message_filter_->DetachAllDocuments(); |
+ |
// Keep the one renderer thread around forever in single process mode. |
if (run_renderer_in_process()) |
return; |