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 0b67020c370110e2a83448552ac0ab851a2b63cd..6b0cba67ac392af2775b03c8f5dce9f610c7109b 100644 |
--- a/content/browser/renderer_host/render_process_host_impl.cc |
+++ b/content/browser/renderer_host/render_process_host_impl.cc |
@@ -1066,8 +1066,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(), |
@@ -1078,7 +1077,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( |
@@ -1930,6 +1930,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 DocumentDetached IPC |
nhiroki
2016/08/17 06:58:03
waiting -> waiting for
horo
2016/08/17 07:15:54
Done.
|
+ // message. |
+ if (listeners_.IsEmpty()) |
+ shared_worker_message_filter_->DetachAllDocument(); |
+ |
// Keep the one renderer thread around forever in single process mode. |
if (run_renderer_in_process()) |
return; |