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

Side by Side 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: Keep WorkerStoragePartitionId in SharedWorkerMessageFilter 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Represents the browser side of the browser <--> renderer communication 5 // Represents the browser side of the browser <--> renderer communication
6 // channel. There will be one RenderProcessHost per renderer process. 6 // channel. There will be one RenderProcessHost per renderer process.
7 7
8 #include "content/browser/renderer_host/render_process_host_impl.h" 8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 new CacheStorageDispatcherHost(); 1059 new CacheStorageDispatcherHost();
1060 cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext()); 1060 cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext());
1061 AddFilter(cache_storage_filter.get()); 1061 AddFilter(cache_storage_filter.get());
1062 1062
1063 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = 1063 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter =
1064 new ServiceWorkerDispatcherHost( 1064 new ServiceWorkerDispatcherHost(
1065 GetID(), message_port_message_filter_.get(), resource_context); 1065 GetID(), message_port_message_filter_.get(), resource_context);
1066 service_worker_filter->Init( 1066 service_worker_filter->Init(
1067 storage_partition_impl_->GetServiceWorkerContext()); 1067 storage_partition_impl_->GetServiceWorkerContext());
1068 AddFilter(service_worker_filter.get()); 1068 AddFilter(service_worker_filter.get());
1069 1069 shared_worker_message_filter_ = new SharedWorkerMessageFilter(
1070 AddFilter(new SharedWorkerMessageFilter(
1071 GetID(), resource_context, 1070 GetID(), resource_context,
1072 WorkerStoragePartition( 1071 WorkerStoragePartition(
1073 storage_partition_impl_->GetURLRequestContext(), 1072 storage_partition_impl_->GetURLRequestContext(),
1074 storage_partition_impl_->GetMediaURLRequestContext(), 1073 storage_partition_impl_->GetMediaURLRequestContext(),
1075 storage_partition_impl_->GetAppCacheService(), 1074 storage_partition_impl_->GetAppCacheService(),
1076 storage_partition_impl_->GetQuotaManager(), 1075 storage_partition_impl_->GetQuotaManager(),
1077 storage_partition_impl_->GetFileSystemContext(), 1076 storage_partition_impl_->GetFileSystemContext(),
1078 storage_partition_impl_->GetDatabaseTracker(), 1077 storage_partition_impl_->GetDatabaseTracker(),
1079 storage_partition_impl_->GetIndexedDBContext(), 1078 storage_partition_impl_->GetIndexedDBContext(),
1080 storage_partition_impl_->GetServiceWorkerContext()), 1079 storage_partition_impl_->GetServiceWorkerContext()),
1081 message_port_message_filter_.get())); 1080 message_port_message_filter_.get());
1081 AddFilter(shared_worker_message_filter_.get());
1082 1082
1083 #if defined(ENABLE_WEBRTC) 1083 #if defined(ENABLE_WEBRTC)
1084 p2p_socket_dispatcher_host_ = new P2PSocketDispatcherHost( 1084 p2p_socket_dispatcher_host_ = new P2PSocketDispatcherHost(
1085 resource_context, request_context.get()); 1085 resource_context, request_context.get());
1086 AddFilter(p2p_socket_dispatcher_host_.get()); 1086 AddFilter(p2p_socket_dispatcher_host_.get());
1087 #endif 1087 #endif
1088 1088
1089 AddFilter(new TraceMessageFilter(GetID())); 1089 AddFilter(new TraceMessageFilter(GetID()));
1090 AddFilter(new ResolveProxyMsgHelper(request_context.get())); 1090 AddFilter(new ResolveProxyMsgHelper(request_context.get()));
1091 AddFilter(new QuotaDispatcherHost( 1091 AddFilter(new QuotaDispatcherHost(
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
1923 void RenderProcessHostImpl::SetIgnoreInputEvents(bool ignore_input_events) { 1923 void RenderProcessHostImpl::SetIgnoreInputEvents(bool ignore_input_events) {
1924 ignore_input_events_ = ignore_input_events; 1924 ignore_input_events_ = ignore_input_events;
1925 } 1925 }
1926 1926
1927 bool RenderProcessHostImpl::IgnoreInputEvents() const { 1927 bool RenderProcessHostImpl::IgnoreInputEvents() const {
1928 return ignore_input_events_; 1928 return ignore_input_events_;
1929 } 1929 }
1930 1930
1931 void RenderProcessHostImpl::Cleanup() { 1931 void RenderProcessHostImpl::Cleanup() {
1932 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1932 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1933 // If there is no listeners, remove the reference from the all documents in
1934 // 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.
1935 // message.
1936 if (listeners_.IsEmpty())
1937 shared_worker_message_filter_->DetachAllDocument();
1938
1933 // Keep the one renderer thread around forever in single process mode. 1939 // Keep the one renderer thread around forever in single process mode.
1934 if (run_renderer_in_process()) 1940 if (run_renderer_in_process())
1935 return; 1941 return;
1936 1942
1937 // If within_process_died_observer_ is true, one of our observers performed an 1943 // If within_process_died_observer_ is true, one of our observers performed an
1938 // action that caused us to die (e.g. http://crbug.com/339504). Therefore, 1944 // action that caused us to die (e.g. http://crbug.com/339504). Therefore,
1939 // delay the destruction until all of the observer callbacks have been made, 1945 // delay the destruction until all of the observer callbacks have been made,
1940 // and guarantee that the RenderProcessHostDestroyed observer callback is 1946 // and guarantee that the RenderProcessHostDestroyed observer callback is
1941 // always the last callback fired. 1947 // always the last callback fired.
1942 if (within_process_died_observer_) { 1948 if (within_process_died_observer_) {
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
2843 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 2849 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
2844 2850
2845 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias 2851 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias
2846 // enough information here so that we can determine what the bad message was. 2852 // enough information here so that we can determine what the bad message was.
2847 base::debug::Alias(&error); 2853 base::debug::Alias(&error);
2848 bad_message::ReceivedBadMessage(process.get(), 2854 bad_message::ReceivedBadMessage(process.get(),
2849 bad_message::RPH_MOJO_PROCESS_ERROR); 2855 bad_message::RPH_MOJO_PROCESS_ERROR);
2850 } 2856 }
2851 2857
2852 } // namespace content 2858 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698