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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2249173003: Removes the references to shared workers from the all documents in being deleted frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated nhiroki's comment Created 4 years, 4 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
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;

Powered by Google App Engine
This is Rietveld 408576698