OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 #include "content/browser/renderer_host/render_view_host_impl.h" | 90 #include "content/browser/renderer_host/render_view_host_impl.h" |
91 #include "content/browser/renderer_host/render_widget_helper.h" | 91 #include "content/browser/renderer_host/render_widget_helper.h" |
92 #include "content/browser/renderer_host/render_widget_host_impl.h" | 92 #include "content/browser/renderer_host/render_widget_host_impl.h" |
93 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" | 93 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" |
94 #include "content/browser/renderer_host/text_input_client_message_filter.h" | 94 #include "content/browser/renderer_host/text_input_client_message_filter.h" |
95 #include "content/browser/renderer_host/websocket_dispatcher_host.h" | 95 #include "content/browser/renderer_host/websocket_dispatcher_host.h" |
96 #include "content/browser/resolve_proxy_msg_helper.h" | 96 #include "content/browser/resolve_proxy_msg_helper.h" |
97 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host.
h" | 97 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host.
h" |
98 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 98 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
99 #include "content/browser/service_worker/service_worker_dispatcher_host.h" | 99 #include "content/browser/service_worker/service_worker_dispatcher_host.h" |
| 100 #include "content/browser/shared_worker/shared_worker_message_filter.h" |
100 #include "content/browser/speech/input_tag_speech_dispatcher_host.h" | 101 #include "content/browser/speech/input_tag_speech_dispatcher_host.h" |
101 #include "content/browser/speech/speech_recognition_dispatcher_host.h" | 102 #include "content/browser/speech/speech_recognition_dispatcher_host.h" |
102 #include "content/browser/storage_partition_impl.h" | 103 #include "content/browser/storage_partition_impl.h" |
103 #include "content/browser/streams/stream_context.h" | 104 #include "content/browser/streams/stream_context.h" |
104 #include "content/browser/tracing/trace_message_filter.h" | 105 #include "content/browser/tracing/trace_message_filter.h" |
105 #include "content/browser/vibration/vibration_message_filter.h" | 106 #include "content/browser/vibration/vibration_message_filter.h" |
106 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 107 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
107 #include "content/browser/worker_host/worker_message_filter.h" | 108 #include "content/browser/worker_host/worker_message_filter.h" |
108 #include "content/browser/worker_host/worker_storage_partition.h" | 109 #include "content/browser/worker_host/worker_storage_partition.h" |
109 #include "content/common/child_process_host_impl.h" | 110 #include "content/common/child_process_host_impl.h" |
110 #include "content/common/child_process_messages.h" | 111 #include "content/common/child_process_messages.h" |
111 #include "content/common/content_switches_internal.h" | 112 #include "content/common/content_switches_internal.h" |
112 #include "content/common/gpu/gpu_messages.h" | 113 #include "content/common/gpu/gpu_messages.h" |
113 #include "content/common/resource_messages.h" | 114 #include "content/common/resource_messages.h" |
114 #include "content/common/view_messages.h" | 115 #include "content/common/view_messages.h" |
115 #include "content/port/browser/render_widget_host_view_frame_subscriber.h" | 116 #include "content/port/browser/render_widget_host_view_frame_subscriber.h" |
116 #include "content/public/browser/browser_context.h" | 117 #include "content/public/browser/browser_context.h" |
117 #include "content/public/browser/content_browser_client.h" | 118 #include "content/public/browser/content_browser_client.h" |
118 #include "content/public/browser/notification_service.h" | 119 #include "content/public/browser/notification_service.h" |
119 #include "content/public/browser/notification_types.h" | 120 #include "content/public/browser/notification_types.h" |
120 #include "content/public/browser/render_process_host_factory.h" | 121 #include "content/public/browser/render_process_host_factory.h" |
121 #include "content/public/browser/render_process_host_observer.h" | 122 #include "content/public/browser/render_process_host_observer.h" |
122 #include "content/public/browser/render_widget_host.h" | 123 #include "content/public/browser/render_widget_host.h" |
123 #include "content/public/browser/render_widget_host_iterator.h" | 124 #include "content/public/browser/render_widget_host_iterator.h" |
124 #include "content/public/browser/resource_context.h" | 125 #include "content/public/browser/resource_context.h" |
125 #include "content/public/browser/user_metrics.h" | 126 #include "content/public/browser/user_metrics.h" |
| 127 #include "content/public/browser/worker_service.h" |
126 #include "content/public/common/content_constants.h" | 128 #include "content/public/common/content_constants.h" |
127 #include "content/public/common/content_switches.h" | 129 #include "content/public/common/content_switches.h" |
128 #include "content/public/common/process_type.h" | 130 #include "content/public/common/process_type.h" |
129 #include "content/public/common/result_codes.h" | 131 #include "content/public/common/result_codes.h" |
130 #include "content/public/common/url_constants.h" | 132 #include "content/public/common/url_constants.h" |
131 #include "gpu/command_buffer/service/gpu_switches.h" | 133 #include "gpu/command_buffer/service/gpu_switches.h" |
132 #include "ipc/ipc_channel.h" | 134 #include "ipc/ipc_channel.h" |
133 #include "ipc/ipc_logging.h" | 135 #include "ipc/ipc_logging.h" |
134 #include "ipc/ipc_switches.h" | 136 #include "ipc/ipc_switches.h" |
135 #include "media/base/media_switches.h" | 137 #include "media/base/media_switches.h" |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 base::Bind(&GetRequestContext, request_context, | 751 base::Bind(&GetRequestContext, request_context, |
750 media_request_context, ResourceType::SUB_RESOURCE)); | 752 media_request_context, ResourceType::SUB_RESOURCE)); |
751 | 753 |
752 AddFilter(new WebSocketDispatcherHost(websocket_request_context_callback)); | 754 AddFilter(new WebSocketDispatcherHost(websocket_request_context_callback)); |
753 | 755 |
754 message_port_message_filter_ = new MessagePortMessageFilter( | 756 message_port_message_filter_ = new MessagePortMessageFilter( |
755 base::Bind(&RenderWidgetHelper::GetNextRoutingID, | 757 base::Bind(&RenderWidgetHelper::GetNextRoutingID, |
756 base::Unretained(widget_helper_.get()))); | 758 base::Unretained(widget_helper_.get()))); |
757 AddFilter(message_port_message_filter_); | 759 AddFilter(message_port_message_filter_); |
758 | 760 |
759 AddFilter(new WorkerMessageFilter( | 761 // If "--enable-embedded-shared-worker" is set, we use |
760 GetID(), | 762 // SharedWorkerMessageFilter in stead of WorkerMessageFilter. |
761 resource_context, | 763 if (WorkerService::EmbeddedSharedWorkerEnabled()) { |
762 WorkerStoragePartition( | 764 AddFilter(new SharedWorkerMessageFilter( |
763 storage_partition_impl_->GetURLRequestContext(), | 765 GetID(), |
764 storage_partition_impl_->GetMediaURLRequestContext(), | 766 resource_context, |
765 storage_partition_impl_->GetAppCacheService(), | 767 WorkerStoragePartition( |
766 storage_partition_impl_->GetQuotaManager(), | 768 storage_partition_impl_->GetURLRequestContext(), |
767 storage_partition_impl_->GetFileSystemContext(), | 769 storage_partition_impl_->GetMediaURLRequestContext(), |
768 storage_partition_impl_->GetDatabaseTracker(), | 770 storage_partition_impl_->GetAppCacheService(), |
769 storage_partition_impl_->GetIndexedDBContext()), | 771 storage_partition_impl_->GetQuotaManager(), |
770 message_port_message_filter_)); | 772 storage_partition_impl_->GetFileSystemContext(), |
| 773 storage_partition_impl_->GetDatabaseTracker(), |
| 774 storage_partition_impl_->GetIndexedDBContext()), |
| 775 message_port_message_filter_)); |
| 776 } else { |
| 777 AddFilter(new WorkerMessageFilter( |
| 778 GetID(), |
| 779 resource_context, |
| 780 WorkerStoragePartition( |
| 781 storage_partition_impl_->GetURLRequestContext(), |
| 782 storage_partition_impl_->GetMediaURLRequestContext(), |
| 783 storage_partition_impl_->GetAppCacheService(), |
| 784 storage_partition_impl_->GetQuotaManager(), |
| 785 storage_partition_impl_->GetFileSystemContext(), |
| 786 storage_partition_impl_->GetDatabaseTracker(), |
| 787 storage_partition_impl_->GetIndexedDBContext()), |
| 788 message_port_message_filter_)); |
| 789 } |
771 | 790 |
772 #if defined(ENABLE_WEBRTC) | 791 #if defined(ENABLE_WEBRTC) |
773 AddFilter(new P2PSocketDispatcherHost( | 792 AddFilter(new P2PSocketDispatcherHost( |
774 resource_context, | 793 resource_context, |
775 browser_context->GetRequestContextForRenderProcess(GetID()))); | 794 browser_context->GetRequestContextForRenderProcess(GetID()))); |
776 #endif | 795 #endif |
777 | 796 |
778 AddFilter(new TraceMessageFilter()); | 797 AddFilter(new TraceMessageFilter()); |
779 AddFilter(new ResolveProxyMsgHelper( | 798 AddFilter(new ResolveProxyMsgHelper( |
780 browser_context->GetRequestContextForRenderProcess(GetID()))); | 799 browser_context->GetRequestContextForRenderProcess(GetID()))); |
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2090 | 2109 |
2091 void RenderProcessHostImpl::DecrementWorkerRefCount() { | 2110 void RenderProcessHostImpl::DecrementWorkerRefCount() { |
2092 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 2111 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
2093 DCHECK_GT(worker_ref_count_, 0); | 2112 DCHECK_GT(worker_ref_count_, 0); |
2094 --worker_ref_count_; | 2113 --worker_ref_count_; |
2095 if (worker_ref_count_ == 0) | 2114 if (worker_ref_count_ == 0) |
2096 Cleanup(); | 2115 Cleanup(); |
2097 } | 2116 } |
2098 | 2117 |
2099 } // namespace content | 2118 } // namespace content |
OLD | NEW |