| 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 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 AddUIThreadInterface(registry.get(), base::Bind(&ImageCaptureImpl::Create)); | 1211 AddUIThreadInterface(registry.get(), base::Bind(&ImageCaptureImpl::Create)); |
| 1212 | 1212 |
| 1213 AddUIThreadInterface( | 1213 AddUIThreadInterface( |
| 1214 registry.get(), | 1214 registry.get(), |
| 1215 base::Bind(&PaymentAppContextImpl::CreatePaymentAppManager, | 1215 base::Bind(&PaymentAppContextImpl::CreatePaymentAppManager, |
| 1216 base::Unretained( | 1216 base::Unretained( |
| 1217 storage_partition_impl_->GetPaymentAppContext()))); | 1217 storage_partition_impl_->GetPaymentAppContext()))); |
| 1218 | 1218 |
| 1219 AddUIThreadInterface( | 1219 AddUIThreadInterface( |
| 1220 registry.get(), | 1220 registry.get(), |
| 1221 base::Bind(&OffscreenCanvasCompositorFrameSinkProviderImpl::Create)); | 1221 base::Bind(&RenderProcessHostImpl:: |
| 1222 CreateOffscreenCanvasCompositorFrameSinkProvider, |
| 1223 base::Unretained(this))); |
| 1224 |
| 1222 AddUIThreadInterface(registry.get(), | 1225 AddUIThreadInterface(registry.get(), |
| 1223 base::Bind(&OffscreenCanvasSurfaceFactoryImpl::Create)); | 1226 base::Bind(&OffscreenCanvasSurfaceFactoryImpl::Create)); |
| 1224 AddUIThreadInterface( | 1227 AddUIThreadInterface( |
| 1225 registry.get(), | 1228 registry.get(), |
| 1226 base::Bind(&BackgroundSyncContext::CreateService, | 1229 base::Bind(&BackgroundSyncContext::CreateService, |
| 1227 base::Unretained( | 1230 base::Unretained( |
| 1228 storage_partition_impl_->GetBackgroundSyncContext()))); | 1231 storage_partition_impl_->GetBackgroundSyncContext()))); |
| 1229 AddUIThreadInterface( | 1232 AddUIThreadInterface( |
| 1230 registry.get(), | 1233 registry.get(), |
| 1231 base::Bind(&PlatformNotificationContextImpl::CreateService, | 1234 base::Bind(&PlatformNotificationContextImpl::CreateService, |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1334 listener->OnAssociatedInterfaceRequest(name, request.PassHandle()); | 1337 listener->OnAssociatedInterfaceRequest(name, request.PassHandle()); |
| 1335 } | 1338 } |
| 1336 | 1339 |
| 1337 void RenderProcessHostImpl::CreateMusGpuRequest(ui::mojom::GpuRequest request) { | 1340 void RenderProcessHostImpl::CreateMusGpuRequest(ui::mojom::GpuRequest request) { |
| 1338 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1341 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 1339 if (!gpu_client_) | 1342 if (!gpu_client_) |
| 1340 gpu_client_.reset(new GpuClient(GetID())); | 1343 gpu_client_.reset(new GpuClient(GetID())); |
| 1341 gpu_client_->Add(std::move(request)); | 1344 gpu_client_->Add(std::move(request)); |
| 1342 } | 1345 } |
| 1343 | 1346 |
| 1347 void RenderProcessHostImpl::CreateOffscreenCanvasCompositorFrameSinkProvider( |
| 1348 blink::mojom::OffscreenCanvasCompositorFrameSinkProviderRequest request) { |
| 1349 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1350 if (!offscreen_canvas_provider_) { |
| 1351 offscreen_canvas_provider_.reset( |
| 1352 new OffscreenCanvasCompositorFrameSinkProviderImpl()); |
| 1353 } |
| 1354 offscreen_canvas_provider_->Add(std::move(request)); |
| 1355 } |
| 1356 |
| 1344 void RenderProcessHostImpl::CreateStoragePartitionService( | 1357 void RenderProcessHostImpl::CreateStoragePartitionService( |
| 1345 mojo::InterfaceRequest<mojom::StoragePartitionService> request) { | 1358 mojo::InterfaceRequest<mojom::StoragePartitionService> request) { |
| 1346 // DO NOT REMOVE THIS COMMAND LINE CHECK WITHOUT SECURITY REVIEW! | 1359 // DO NOT REMOVE THIS COMMAND LINE CHECK WITHOUT SECURITY REVIEW! |
| 1347 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1360 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1348 switches::kMojoLocalStorage)) { | 1361 switches::kMojoLocalStorage)) { |
| 1349 storage_partition_impl_->Bind(std::move(request)); | 1362 storage_partition_impl_->Bind(std::move(request)); |
| 1350 } | 1363 } |
| 1351 } | 1364 } |
| 1352 | 1365 |
| 1353 int RenderProcessHostImpl::GetNextRoutingID() { | 1366 int RenderProcessHostImpl::GetNextRoutingID() { |
| (...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3003 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3016 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 3004 | 3017 |
| 3005 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3018 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. |
| 3006 // Capture the error message in a crash key value. | 3019 // Capture the error message in a crash key value. |
| 3007 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3020 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); |
| 3008 bad_message::ReceivedBadMessage(render_process_id, | 3021 bad_message::ReceivedBadMessage(render_process_id, |
| 3009 bad_message::RPH_MOJO_PROCESS_ERROR); | 3022 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 3010 } | 3023 } |
| 3011 | 3024 |
| 3012 } // namespace content | 3025 } // namespace content |
| OLD | NEW |