OLD | NEW |
---|---|
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 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1055 new CacheStorageDispatcherHost(); | 1055 new CacheStorageDispatcherHost(); |
1056 cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext()); | 1056 cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext()); |
1057 AddFilter(cache_storage_filter.get()); | 1057 AddFilter(cache_storage_filter.get()); |
1058 | 1058 |
1059 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = | 1059 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = |
1060 new ServiceWorkerDispatcherHost( | 1060 new ServiceWorkerDispatcherHost( |
1061 GetID(), message_port_message_filter_.get(), resource_context); | 1061 GetID(), message_port_message_filter_.get(), resource_context); |
1062 service_worker_filter->Init( | 1062 service_worker_filter->Init( |
1063 storage_partition_impl_->GetServiceWorkerContext()); | 1063 storage_partition_impl_->GetServiceWorkerContext()); |
1064 AddFilter(service_worker_filter.get()); | 1064 AddFilter(service_worker_filter.get()); |
1065 | 1065 shared_worker_message_filter_ = new SharedWorkerMessageFilter( |
1066 AddFilter(new SharedWorkerMessageFilter( | |
1067 GetID(), resource_context, | 1066 GetID(), resource_context, |
1068 WorkerStoragePartition( | 1067 WorkerStoragePartition( |
1069 storage_partition_impl_->GetURLRequestContext(), | 1068 storage_partition_impl_->GetURLRequestContext(), |
1070 storage_partition_impl_->GetMediaURLRequestContext(), | 1069 storage_partition_impl_->GetMediaURLRequestContext(), |
1071 storage_partition_impl_->GetAppCacheService(), | 1070 storage_partition_impl_->GetAppCacheService(), |
1072 storage_partition_impl_->GetQuotaManager(), | 1071 storage_partition_impl_->GetQuotaManager(), |
1073 storage_partition_impl_->GetFileSystemContext(), | 1072 storage_partition_impl_->GetFileSystemContext(), |
1074 storage_partition_impl_->GetDatabaseTracker(), | 1073 storage_partition_impl_->GetDatabaseTracker(), |
1075 storage_partition_impl_->GetIndexedDBContext(), | 1074 storage_partition_impl_->GetIndexedDBContext(), |
1076 storage_partition_impl_->GetServiceWorkerContext()), | 1075 storage_partition_impl_->GetServiceWorkerContext()), |
1077 message_port_message_filter_.get())); | 1076 message_port_message_filter_.get()); |
1077 AddFilter(shared_worker_message_filter_.get()); | |
1078 | 1078 |
1079 #if defined(ENABLE_WEBRTC) | 1079 #if defined(ENABLE_WEBRTC) |
1080 p2p_socket_dispatcher_host_ = new P2PSocketDispatcherHost( | 1080 p2p_socket_dispatcher_host_ = new P2PSocketDispatcherHost( |
1081 resource_context, request_context.get()); | 1081 resource_context, request_context.get()); |
1082 AddFilter(p2p_socket_dispatcher_host_.get()); | 1082 AddFilter(p2p_socket_dispatcher_host_.get()); |
1083 #endif | 1083 #endif |
1084 | 1084 |
1085 AddFilter(new TraceMessageFilter(GetID())); | 1085 AddFilter(new TraceMessageFilter(GetID())); |
1086 AddFilter(new ResolveProxyMsgHelper(request_context.get())); | 1086 AddFilter(new ResolveProxyMsgHelper(request_context.get())); |
1087 AddFilter(new QuotaDispatcherHost( | 1087 AddFilter(new QuotaDispatcherHost( |
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1919 void RenderProcessHostImpl::SetIgnoreInputEvents(bool ignore_input_events) { | 1919 void RenderProcessHostImpl::SetIgnoreInputEvents(bool ignore_input_events) { |
1920 ignore_input_events_ = ignore_input_events; | 1920 ignore_input_events_ = ignore_input_events; |
1921 } | 1921 } |
1922 | 1922 |
1923 bool RenderProcessHostImpl::IgnoreInputEvents() const { | 1923 bool RenderProcessHostImpl::IgnoreInputEvents() const { |
1924 return ignore_input_events_; | 1924 return ignore_input_events_; |
1925 } | 1925 } |
1926 | 1926 |
1927 void RenderProcessHostImpl::Cleanup() { | 1927 void RenderProcessHostImpl::Cleanup() { |
1928 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1928 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1929 // If there is no listeners, remove the reference from the all documents in | |
1930 // 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.
| |
1931 // IPC message. | |
1932 if (listeners_.IsEmpty()) | |
1933 shared_worker_message_filter_->DetachAllDocuments(); | |
1934 | |
1929 // Keep the one renderer thread around forever in single process mode. | 1935 // Keep the one renderer thread around forever in single process mode. |
1930 if (run_renderer_in_process()) | 1936 if (run_renderer_in_process()) |
1931 return; | 1937 return; |
1932 | 1938 |
1933 // If within_process_died_observer_ is true, one of our observers performed an | 1939 // If within_process_died_observer_ is true, one of our observers performed an |
1934 // action that caused us to die (e.g. http://crbug.com/339504). Therefore, | 1940 // action that caused us to die (e.g. http://crbug.com/339504). Therefore, |
1935 // delay the destruction until all of the observer callbacks have been made, | 1941 // delay the destruction until all of the observer callbacks have been made, |
1936 // and guarantee that the RenderProcessHostDestroyed observer callback is | 1942 // and guarantee that the RenderProcessHostDestroyed observer callback is |
1937 // always the last callback fired. | 1943 // always the last callback fired. |
1938 if (within_process_died_observer_) { | 1944 if (within_process_died_observer_) { |
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2839 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2845 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
2840 | 2846 |
2841 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2847 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
2842 // enough information here so that we can determine what the bad message was. | 2848 // enough information here so that we can determine what the bad message was. |
2843 base::debug::Alias(&error); | 2849 base::debug::Alias(&error); |
2844 bad_message::ReceivedBadMessage(process.get(), | 2850 bad_message::ReceivedBadMessage(process.get(), |
2845 bad_message::RPH_MOJO_PROCESS_ERROR); | 2851 bad_message::RPH_MOJO_PROCESS_ERROR); |
2846 } | 2852 } |
2847 | 2853 |
2848 } // namespace content | 2854 } // namespace content |
OLD | NEW |