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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 #if defined(OS_POSIX) | 217 #if defined(OS_POSIX) |
218 #include "content/browser/zygote_host/zygote_communication_linux.h" | 218 #include "content/browser/zygote_host/zygote_communication_linux.h" |
219 #include "content/browser/zygote_host/zygote_host_impl_linux.h" | 219 #include "content/browser/zygote_host/zygote_host_impl_linux.h" |
220 #include "content/public/browser/zygote_handle_linux.h" | 220 #include "content/public/browser/zygote_handle_linux.h" |
221 #endif // defined(OS_POSIX) | 221 #endif // defined(OS_POSIX) |
222 | 222 |
223 #if defined(USE_OZONE) | 223 #if defined(USE_OZONE) |
224 #include "ui/ozone/public/ozone_switches.h" | 224 #include "ui/ozone/public/ozone_switches.h" |
225 #endif | 225 #endif |
226 | 226 |
227 #if defined(ENABLE_BROWSER_CDMS) | |
228 #include "content/browser/media/cdm/browser_cdm_manager.h" | |
229 #endif | |
230 | |
231 #if defined(ENABLE_PLUGINS) | 227 #if defined(ENABLE_PLUGINS) |
232 #include "content/browser/plugin_service_impl.h" | 228 #include "content/browser/plugin_service_impl.h" |
233 #endif | 229 #endif |
234 | 230 |
235 #if defined(ENABLE_WEBRTC) | 231 #if defined(ENABLE_WEBRTC) |
236 #include "content/browser/renderer_host/media/media_stream_track_metrics_host.h" | 232 #include "content/browser/renderer_host/media/media_stream_track_metrics_host.h" |
237 #include "content/browser/renderer_host/p2p/socket_dispatcher_host.h" | 233 #include "content/browser/renderer_host/p2p/socket_dispatcher_host.h" |
238 #include "content/browser/webrtc/webrtc_internals.h" | 234 #include "content/browser/webrtc/webrtc_internals.h" |
239 #include "content/common/media/aec_dump_messages.h" | 235 #include "content/common/media/aec_dump_messages.h" |
240 #include "content/common/media/media_stream_messages.h" | 236 #include "content/common/media/media_stream_messages.h" |
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 AddFilter(new TextInputClientMessageFilter()); | 1135 AddFilter(new TextInputClientMessageFilter()); |
1140 #elif defined(OS_WIN) | 1136 #elif defined(OS_WIN) |
1141 AddFilter(new DWriteFontProxyMessageFilter()); | 1137 AddFilter(new DWriteFontProxyMessageFilter()); |
1142 | 1138 |
1143 // The FontCacheDispatcher is required only when we're using GDI rendering. | 1139 // The FontCacheDispatcher is required only when we're using GDI rendering. |
1144 // TODO(scottmg): pdf/ppapi still require the renderer to be able to precache | 1140 // TODO(scottmg): pdf/ppapi still require the renderer to be able to precache |
1145 // GDI fonts (http://crbug.com/383227), even when using DirectWrite. This | 1141 // GDI fonts (http://crbug.com/383227), even when using DirectWrite. This |
1146 // should eventually be if (!ShouldUseDirectWrite()) guarded. | 1142 // should eventually be if (!ShouldUseDirectWrite()) guarded. |
1147 channel_->AddFilter(new FontCacheDispatcher()); | 1143 channel_->AddFilter(new FontCacheDispatcher()); |
1148 #endif | 1144 #endif |
1149 #if defined(ENABLE_BROWSER_CDMS) | |
1150 AddFilter(new BrowserCdmManager(GetID(), NULL)); | |
1151 #endif | |
1152 | 1145 |
1153 message_port_message_filter_ = new MessagePortMessageFilter( | 1146 message_port_message_filter_ = new MessagePortMessageFilter( |
1154 base::Bind(&RenderWidgetHelper::GetNextRoutingID, | 1147 base::Bind(&RenderWidgetHelper::GetNextRoutingID, |
1155 base::Unretained(widget_helper_.get()))); | 1148 base::Unretained(widget_helper_.get()))); |
1156 AddFilter(message_port_message_filter_.get()); | 1149 AddFilter(message_port_message_filter_.get()); |
1157 | 1150 |
1158 scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter = | 1151 scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter = |
1159 new CacheStorageDispatcherHost(); | 1152 new CacheStorageDispatcherHost(); |
1160 cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext()); | 1153 cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext()); |
1161 AddFilter(cache_storage_filter.get()); | 1154 AddFilter(cache_storage_filter.get()); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1353 std::unique_ptr<base::SharedPersistentMemoryAllocator> | 1346 std::unique_ptr<base::SharedPersistentMemoryAllocator> |
1354 RenderProcessHostImpl::TakeMetricsAllocator() { | 1347 RenderProcessHostImpl::TakeMetricsAllocator() { |
1355 return std::move(metrics_allocator_); | 1348 return std::move(metrics_allocator_); |
1356 } | 1349 } |
1357 | 1350 |
1358 const base::TimeTicks& RenderProcessHostImpl::GetInitTimeForNavigationMetrics() | 1351 const base::TimeTicks& RenderProcessHostImpl::GetInitTimeForNavigationMetrics() |
1359 const { | 1352 const { |
1360 return init_time_; | 1353 return init_time_; |
1361 } | 1354 } |
1362 | 1355 |
1363 #if defined(ENABLE_BROWSER_CDMS) | |
1364 scoped_refptr<media::MediaKeys> RenderProcessHostImpl::GetCdm( | |
1365 int render_frame_id, | |
1366 int cdm_id) const { | |
1367 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
1368 BrowserCdmManager* manager = BrowserCdmManager::FromProcess(GetID()); | |
1369 if (!manager) | |
1370 return nullptr; | |
1371 return manager->GetCdm(render_frame_id, cdm_id); | |
1372 } | |
1373 #endif | |
1374 | |
1375 bool RenderProcessHostImpl::IsProcessBackgrounded() const { | 1356 bool RenderProcessHostImpl::IsProcessBackgrounded() const { |
1376 return is_process_backgrounded_; | 1357 return is_process_backgrounded_; |
1377 } | 1358 } |
1378 | 1359 |
1379 void RenderProcessHostImpl::IncrementServiceWorkerRefCount() { | 1360 void RenderProcessHostImpl::IncrementServiceWorkerRefCount() { |
1380 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1361 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1381 DCHECK(!is_worker_ref_count_disabled_); | 1362 DCHECK(!is_worker_ref_count_disabled_); |
1382 ++service_worker_ref_count_; | 1363 ++service_worker_ref_count_; |
1383 if (worker_ref_count() > max_worker_count_) | 1364 if (worker_ref_count() > max_worker_count_) |
1384 max_worker_count_ = worker_ref_count(); | 1365 max_worker_count_ = worker_ref_count(); |
(...skipping 1650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3035 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3016 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
3036 | 3017 |
3037 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 3018 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
3038 // enough information here so that we can determine what the bad message was. | 3019 // enough information here so that we can determine what the bad message was. |
3039 base::debug::Alias(&error); | 3020 base::debug::Alias(&error); |
3040 bad_message::ReceivedBadMessage(process.get(), | 3021 bad_message::ReceivedBadMessage(process.get(), |
3041 bad_message::RPH_MOJO_PROCESS_ERROR); | 3022 bad_message::RPH_MOJO_PROCESS_ERROR); |
3042 } | 3023 } |
3043 | 3024 |
3044 } // namespace content | 3025 } // namespace content |
OLD | NEW |