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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h" | 79 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h" |
80 #include "content/browser/renderer_host/media/midi_dispatcher_host.h" | 80 #include "content/browser/renderer_host/media/midi_dispatcher_host.h" |
81 #include "content/browser/renderer_host/media/midi_host.h" | 81 #include "content/browser/renderer_host/media/midi_host.h" |
82 #include "content/browser/renderer_host/media/peer_connection_tracker_host.h" | 82 #include "content/browser/renderer_host/media/peer_connection_tracker_host.h" |
83 #include "content/browser/renderer_host/media/video_capture_host.h" | 83 #include "content/browser/renderer_host/media/video_capture_host.h" |
84 #include "content/browser/renderer_host/memory_benchmark_message_filter.h" | 84 #include "content/browser/renderer_host/memory_benchmark_message_filter.h" |
85 #include "content/browser/renderer_host/p2p/socket_dispatcher_host.h" | 85 #include "content/browser/renderer_host/p2p/socket_dispatcher_host.h" |
86 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" | 86 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" |
87 #include "content/browser/renderer_host/pepper/pepper_renderer_connection.h" | 87 #include "content/browser/renderer_host/pepper/pepper_renderer_connection.h" |
88 #include "content/browser/renderer_host/render_message_filter.h" | 88 #include "content/browser/renderer_host/render_message_filter.h" |
| 89 #include "content/browser/renderer_host/render_process_host_mojo_impl.h" |
89 #include "content/browser/renderer_host/render_view_host_delegate.h" | 90 #include "content/browser/renderer_host/render_view_host_delegate.h" |
90 #include "content/browser/renderer_host/render_view_host_impl.h" | 91 #include "content/browser/renderer_host/render_view_host_impl.h" |
91 #include "content/browser/renderer_host/render_widget_helper.h" | 92 #include "content/browser/renderer_host/render_widget_helper.h" |
92 #include "content/browser/renderer_host/render_widget_host_impl.h" | 93 #include "content/browser/renderer_host/render_widget_host_impl.h" |
93 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" | 94 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" |
94 #include "content/browser/renderer_host/text_input_client_message_filter.h" | 95 #include "content/browser/renderer_host/text_input_client_message_filter.h" |
95 #include "content/browser/renderer_host/websocket_dispatcher_host.h" | 96 #include "content/browser/renderer_host/websocket_dispatcher_host.h" |
96 #include "content/browser/resolve_proxy_msg_helper.h" | 97 #include "content/browser/resolve_proxy_msg_helper.h" |
97 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host.
h" | 98 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host.
h" |
98 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 99 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 #include "content/common/sandbox_win.h" | 154 #include "content/common/sandbox_win.h" |
154 #endif | 155 #endif |
155 | 156 |
156 #if defined(ENABLE_WEBRTC) | 157 #if defined(ENABLE_WEBRTC) |
157 #include "content/browser/media/webrtc_internals.h" | 158 #include "content/browser/media/webrtc_internals.h" |
158 #include "content/browser/renderer_host/media/media_stream_track_metrics_host.h" | 159 #include "content/browser/renderer_host/media/media_stream_track_metrics_host.h" |
159 #include "content/browser/renderer_host/media/webrtc_identity_service_host.h" | 160 #include "content/browser/renderer_host/media/webrtc_identity_service_host.h" |
160 #include "content/common/media/media_stream_messages.h" | 161 #include "content/common/media/media_stream_messages.h" |
161 #endif | 162 #endif |
162 | 163 |
163 #if defined(USE_MOJO) | |
164 #include "content/browser/renderer_host/render_process_host_mojo_impl.h" | |
165 #endif | |
166 | |
167 extern bool g_exited_main_message_loop; | 164 extern bool g_exited_main_message_loop; |
168 | 165 |
169 static const char* kSiteProcessMapKeyName = "content_site_process_map"; | 166 static const char* kSiteProcessMapKeyName = "content_site_process_map"; |
170 | 167 |
171 namespace content { | 168 namespace content { |
172 namespace { | 169 namespace { |
173 | 170 |
174 void CacheShaderInfo(int32 id, base::FilePath path) { | 171 void CacheShaderInfo(int32 id, base::FilePath path) { |
175 ShaderCacheFactory::GetInstance()->SetCacheInfo(id, path); | 172 ShaderCacheFactory::GetInstance()->SetCacheInfo(id, path); |
176 } | 173 } |
(...skipping 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1926 while (!iter.IsAtEnd()) { | 1923 while (!iter.IsAtEnd()) { |
1927 iter.GetCurrentValue()->OnMessageReceived( | 1924 iter.GetCurrentValue()->OnMessageReceived( |
1928 ViewHostMsg_RenderProcessGone(iter.GetCurrentKey(), | 1925 ViewHostMsg_RenderProcessGone(iter.GetCurrentKey(), |
1929 static_cast<int>(status), | 1926 static_cast<int>(status), |
1930 exit_code)); | 1927 exit_code)); |
1931 iter.Advance(); | 1928 iter.Advance(); |
1932 } | 1929 } |
1933 | 1930 |
1934 ClearTransportDIBCache(); | 1931 ClearTransportDIBCache(); |
1935 | 1932 |
1936 #if defined(USE_MOJO) | |
1937 render_process_host_mojo_.reset(); | 1933 render_process_host_mojo_.reset(); |
1938 #endif | |
1939 | 1934 |
1940 // It's possible that one of the calls out to the observers might have caused | 1935 // It's possible that one of the calls out to the observers might have caused |
1941 // this object to be no longer needed. | 1936 // this object to be no longer needed. |
1942 if (delayed_cleanup_needed_) | 1937 if (delayed_cleanup_needed_) |
1943 Cleanup(); | 1938 Cleanup(); |
1944 | 1939 |
1945 // This object is not deleted at this point and might be reused later. | 1940 // This object is not deleted at this point and might be reused later. |
1946 // TODO(darin): clean this up | 1941 // TODO(darin): clean this up |
1947 } | 1942 } |
1948 | 1943 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2073 while (!queued_messages_.empty()) { | 2068 while (!queued_messages_.empty()) { |
2074 Send(queued_messages_.front()); | 2069 Send(queued_messages_.front()); |
2075 queued_messages_.pop(); | 2070 queued_messages_.pop(); |
2076 } | 2071 } |
2077 | 2072 |
2078 #if defined(ENABLE_WEBRTC) | 2073 #if defined(ENABLE_WEBRTC) |
2079 if (WebRTCInternals::GetInstance()->aec_dump_enabled()) | 2074 if (WebRTCInternals::GetInstance()->aec_dump_enabled()) |
2080 EnableAecDump(WebRTCInternals::GetInstance()->aec_dump_file_path()); | 2075 EnableAecDump(WebRTCInternals::GetInstance()->aec_dump_file_path()); |
2081 #endif | 2076 #endif |
2082 | 2077 |
2083 #if defined(USE_MOJO) | |
2084 if (render_process_host_mojo_.get()) | 2078 if (render_process_host_mojo_.get()) |
2085 render_process_host_mojo_->OnProcessLaunched(); | 2079 render_process_host_mojo_->OnProcessLaunched(); |
2086 #endif | |
2087 } | 2080 } |
2088 | 2081 |
2089 scoped_refptr<AudioRendererHost> | 2082 scoped_refptr<AudioRendererHost> |
2090 RenderProcessHostImpl::audio_renderer_host() const { | 2083 RenderProcessHostImpl::audio_renderer_host() const { |
2091 return audio_renderer_host_; | 2084 return audio_renderer_host_; |
2092 } | 2085 } |
2093 | 2086 |
2094 void RenderProcessHostImpl::OnUserMetricsRecordAction( | 2087 void RenderProcessHostImpl::OnUserMetricsRecordAction( |
2095 const std::string& action) { | 2088 const std::string& action) { |
2096 RecordComputedAction(action); | 2089 RecordComputedAction(action); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2150 } | 2143 } |
2151 | 2144 |
2152 void RenderProcessHostImpl::DecrementWorkerRefCount() { | 2145 void RenderProcessHostImpl::DecrementWorkerRefCount() { |
2153 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 2146 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
2154 DCHECK_GT(worker_ref_count_, 0); | 2147 DCHECK_GT(worker_ref_count_, 0); |
2155 --worker_ref_count_; | 2148 --worker_ref_count_; |
2156 if (worker_ref_count_ == 0) | 2149 if (worker_ref_count_ == 0) |
2157 Cleanup(); | 2150 Cleanup(); |
2158 } | 2151 } |
2159 | 2152 |
2160 #if defined(USE_MOJO) | |
2161 void RenderProcessHostImpl::SetWebUIHandle( | 2153 void RenderProcessHostImpl::SetWebUIHandle( |
2162 int32 view_routing_id, | 2154 int32 view_routing_id, |
2163 mojo::ScopedMessagePipeHandle handle) { | 2155 mojo::ScopedMessagePipeHandle handle) { |
2164 if (!render_process_host_mojo_) | 2156 if (!render_process_host_mojo_) |
2165 render_process_host_mojo_.reset(new RenderProcessHostMojoImpl(this)); | 2157 render_process_host_mojo_.reset(new RenderProcessHostMojoImpl(this)); |
2166 render_process_host_mojo_->SetWebUIHandle(view_routing_id, handle.Pass()); | 2158 render_process_host_mojo_->SetWebUIHandle(view_routing_id, handle.Pass()); |
2167 } | 2159 } |
2168 #endif | |
2169 | 2160 |
2170 } // namespace content | 2161 } // namespace content |
OLD | NEW |