| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 #include "content/browser/push_messaging/push_messaging_manager.h" | 102 #include "content/browser/push_messaging/push_messaging_manager.h" |
| 103 #include "content/browser/quota_dispatcher_host.h" | 103 #include "content/browser/quota_dispatcher_host.h" |
| 104 #include "content/browser/renderer_host/clipboard_message_filter.h" | 104 #include "content/browser/renderer_host/clipboard_message_filter.h" |
| 105 #include "content/browser/renderer_host/database_message_filter.h" | 105 #include "content/browser/renderer_host/database_message_filter.h" |
| 106 #include "content/browser/renderer_host/file_utilities_message_filter.h" | 106 #include "content/browser/renderer_host/file_utilities_message_filter.h" |
| 107 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" | 107 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" |
| 108 #include "content/browser/renderer_host/media/audio_renderer_host.h" | 108 #include "content/browser/renderer_host/media/audio_renderer_host.h" |
| 109 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h" | 109 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h" |
| 110 #include "content/browser/renderer_host/media/peer_connection_tracker_host.h" | 110 #include "content/browser/renderer_host/media/peer_connection_tracker_host.h" |
| 111 #include "content/browser/renderer_host/media/video_capture_host.h" | 111 #include "content/browser/renderer_host/media/video_capture_host.h" |
| 112 #include "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink_p
rovider_impl.h" | 112 #include "content/browser/renderer_host/offscreen_canvas_provider_impl.h" |
| 113 #include "content/browser/renderer_host/offscreen_canvas_surface_factory_impl.h" | |
| 114 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" | 113 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" |
| 115 #include "content/browser/renderer_host/pepper/pepper_renderer_connection.h" | 114 #include "content/browser/renderer_host/pepper/pepper_renderer_connection.h" |
| 116 #include "content/browser/renderer_host/render_message_filter.h" | 115 #include "content/browser/renderer_host/render_message_filter.h" |
| 117 #include "content/browser/renderer_host/render_view_host_delegate.h" | 116 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 118 #include "content/browser/renderer_host/render_view_host_impl.h" | 117 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 119 #include "content/browser/renderer_host/render_widget_helper.h" | 118 #include "content/browser/renderer_host/render_widget_helper.h" |
| 120 #include "content/browser/renderer_host/render_widget_host_impl.h" | 119 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 121 #include "content/browser/renderer_host/render_widget_host_view_frame_subscriber
.h" | 120 #include "content/browser/renderer_host/render_widget_host_view_frame_subscriber
.h" |
| 122 #include "content/browser/renderer_host/text_input_client_message_filter.h" | 121 #include "content/browser/renderer_host/text_input_client_message_filter.h" |
| 123 #include "content/browser/resolve_proxy_msg_helper.h" | 122 #include "content/browser/resolve_proxy_msg_helper.h" |
| (...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1242 AddUIThreadInterface(registry.get(), base::Bind(&ImageCaptureImpl::Create)); | 1241 AddUIThreadInterface(registry.get(), base::Bind(&ImageCaptureImpl::Create)); |
| 1243 | 1242 |
| 1244 AddUIThreadInterface( | 1243 AddUIThreadInterface( |
| 1245 registry.get(), | 1244 registry.get(), |
| 1246 base::Bind( | 1245 base::Bind( |
| 1247 &PaymentAppContextImpl::CreatePaymentManager, | 1246 &PaymentAppContextImpl::CreatePaymentManager, |
| 1248 base::Unretained(storage_partition_impl_->GetPaymentAppContext()))); | 1247 base::Unretained(storage_partition_impl_->GetPaymentAppContext()))); |
| 1249 | 1248 |
| 1250 AddUIThreadInterface( | 1249 AddUIThreadInterface( |
| 1251 registry.get(), | 1250 registry.get(), |
| 1252 base::Bind(&RenderProcessHostImpl:: | 1251 base::Bind(&RenderProcessHostImpl::CreateOffscreenCanvasProvider, |
| 1253 CreateOffscreenCanvasCompositorFrameSinkProvider, | |
| 1254 base::Unretained(this))); | 1252 base::Unretained(this))); |
| 1255 | 1253 |
| 1256 AddUIThreadInterface(registry.get(), | |
| 1257 base::Bind(&OffscreenCanvasSurfaceFactoryImpl::Create)); | |
| 1258 AddUIThreadInterface( | 1254 AddUIThreadInterface( |
| 1259 registry.get(), | 1255 registry.get(), |
| 1260 base::Bind(&BackgroundSyncContext::CreateService, | 1256 base::Bind(&BackgroundSyncContext::CreateService, |
| 1261 base::Unretained( | 1257 base::Unretained( |
| 1262 storage_partition_impl_->GetBackgroundSyncContext()))); | 1258 storage_partition_impl_->GetBackgroundSyncContext()))); |
| 1263 AddUIThreadInterface( | 1259 AddUIThreadInterface( |
| 1264 registry.get(), | 1260 registry.get(), |
| 1265 base::Bind(&PlatformNotificationContextImpl::CreateService, | 1261 base::Bind(&PlatformNotificationContextImpl::CreateService, |
| 1266 base::Unretained( | 1262 base::Unretained( |
| 1267 storage_partition_impl_->GetPlatformNotificationContext()), | 1263 storage_partition_impl_->GetPlatformNotificationContext()), |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1363 listener->OnAssociatedInterfaceRequest(name, request.PassHandle()); | 1359 listener->OnAssociatedInterfaceRequest(name, request.PassHandle()); |
| 1364 } | 1360 } |
| 1365 | 1361 |
| 1366 void RenderProcessHostImpl::CreateMusGpuRequest(ui::mojom::GpuRequest request) { | 1362 void RenderProcessHostImpl::CreateMusGpuRequest(ui::mojom::GpuRequest request) { |
| 1367 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1363 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 1368 if (!gpu_client_) | 1364 if (!gpu_client_) |
| 1369 gpu_client_.reset(new GpuClient(GetID())); | 1365 gpu_client_.reset(new GpuClient(GetID())); |
| 1370 gpu_client_->Add(std::move(request)); | 1366 gpu_client_->Add(std::move(request)); |
| 1371 } | 1367 } |
| 1372 | 1368 |
| 1373 void RenderProcessHostImpl::CreateOffscreenCanvasCompositorFrameSinkProvider( | 1369 void RenderProcessHostImpl::CreateOffscreenCanvasProvider( |
| 1374 blink::mojom::OffscreenCanvasCompositorFrameSinkProviderRequest request) { | 1370 blink::mojom::OffscreenCanvasProviderRequest request) { |
| 1375 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1371 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1376 if (!offscreen_canvas_provider_) { | 1372 if (!offscreen_canvas_provider_) |
| 1377 offscreen_canvas_provider_.reset( | 1373 offscreen_canvas_provider_.reset(new OffscreenCanvasProviderImpl()); |
| 1378 new OffscreenCanvasCompositorFrameSinkProviderImpl()); | |
| 1379 } | |
| 1380 offscreen_canvas_provider_->Add(std::move(request)); | 1374 offscreen_canvas_provider_->Add(std::move(request)); |
| 1381 } | 1375 } |
| 1382 | 1376 |
| 1383 void RenderProcessHostImpl::CreateStoragePartitionService( | 1377 void RenderProcessHostImpl::CreateStoragePartitionService( |
| 1384 mojo::InterfaceRequest<mojom::StoragePartitionService> request) { | 1378 mojo::InterfaceRequest<mojom::StoragePartitionService> request) { |
| 1385 // DO NOT REMOVE THIS COMMAND LINE CHECK WITHOUT SECURITY REVIEW! | 1379 // DO NOT REMOVE THIS COMMAND LINE CHECK WITHOUT SECURITY REVIEW! |
| 1386 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1380 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1387 switches::kMojoLocalStorage)) { | 1381 switches::kMojoLocalStorage)) { |
| 1388 storage_partition_impl_->Bind(std::move(request)); | 1382 storage_partition_impl_->Bind(std::move(request)); |
| 1389 } | 1383 } |
| (...skipping 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3071 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3065 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 3072 | 3066 |
| 3073 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3067 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. |
| 3074 // Capture the error message in a crash key value. | 3068 // Capture the error message in a crash key value. |
| 3075 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3069 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); |
| 3076 bad_message::ReceivedBadMessage(render_process_id, | 3070 bad_message::ReceivedBadMessage(render_process_id, |
| 3077 bad_message::RPH_MOJO_PROCESS_ERROR); | 3071 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 3078 } | 3072 } |
| 3079 | 3073 |
| 3080 } // namespace content | 3074 } // namespace content |
| OLD | NEW |