| 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 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1683 GetContentClient()->browser()->ExposeInterfacesToRenderer( | 1683 GetContentClient()->browser()->ExposeInterfacesToRenderer( |
| 1684 registry.get(), associated_interfaces_.get(), this); | 1684 registry.get(), associated_interfaces_.get(), this); |
| 1685 static_cast<AssociatedInterfaceRegistry*>(associated_interfaces_.get()) | 1685 static_cast<AssociatedInterfaceRegistry*>(associated_interfaces_.get()) |
| 1686 ->AddInterface(base::Bind(&RenderProcessHostImpl::BindRouteProvider, | 1686 ->AddInterface(base::Bind(&RenderProcessHostImpl::BindRouteProvider, |
| 1687 base::Unretained(this))); | 1687 base::Unretained(this))); |
| 1688 | 1688 |
| 1689 AddUIThreadInterface(registry.get(), | 1689 AddUIThreadInterface(registry.get(), |
| 1690 base::Bind(&RenderProcessHostImpl::CreateRendererHost, | 1690 base::Bind(&RenderProcessHostImpl::CreateRendererHost, |
| 1691 base::Unretained(this))); | 1691 base::Unretained(this))); |
| 1692 | 1692 |
| 1693 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1693 if (base::FeatureList::IsEnabled(features::kNetworkService)) { |
| 1694 switches::kEnableNetworkService)) { | |
| 1695 AddUIThreadInterface( | 1694 AddUIThreadInterface( |
| 1696 registry.get(), | 1695 registry.get(), |
| 1697 base::Bind(&RenderProcessHostImpl::CreateURLLoaderFactory, | 1696 base::Bind(&RenderProcessHostImpl::CreateURLLoaderFactory, |
| 1698 base::Unretained(this))); | 1697 base::Unretained(this))); |
| 1699 } | 1698 } |
| 1700 | 1699 |
| 1701 if (base::FeatureList::IsEnabled(features::kMojoBlobs)) { | 1700 if (base::FeatureList::IsEnabled(features::kMojoBlobs)) { |
| 1702 registry->AddInterface(base::Bind( | 1701 registry->AddInterface(base::Bind( |
| 1703 &ChromeBlobStorageContext::BindBlobRegistry, | 1702 &ChromeBlobStorageContext::BindBlobRegistry, |
| 1704 base::Unretained(ChromeBlobStorageContext::GetFor(browser_context_)))); | 1703 base::Unretained(ChromeBlobStorageContext::GetFor(browser_context_)))); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1734 mojom::AssociatedInterfaceAssociatedRequest request) { | 1733 mojom::AssociatedInterfaceAssociatedRequest request) { |
| 1735 int32_t routing_id = | 1734 int32_t routing_id = |
| 1736 associated_interface_provider_bindings_.dispatch_context(); | 1735 associated_interface_provider_bindings_.dispatch_context(); |
| 1737 IPC::Listener* listener = listeners_.Lookup(routing_id); | 1736 IPC::Listener* listener = listeners_.Lookup(routing_id); |
| 1738 if (listener) | 1737 if (listener) |
| 1739 listener->OnAssociatedInterfaceRequest(name, request.PassHandle()); | 1738 listener->OnAssociatedInterfaceRequest(name, request.PassHandle()); |
| 1740 } | 1739 } |
| 1741 | 1740 |
| 1742 void RenderProcessHostImpl::GetBlobURLLoaderFactory( | 1741 void RenderProcessHostImpl::GetBlobURLLoaderFactory( |
| 1743 mojom::URLLoaderFactoryRequest request) { | 1742 mojom::URLLoaderFactoryRequest request) { |
| 1744 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 1743 if (!base::FeatureList::IsEnabled(features::kNetworkService)) { |
| 1745 switches::kEnableNetworkService)) { | |
| 1746 NOTREACHED(); | 1744 NOTREACHED(); |
| 1747 return; | 1745 return; |
| 1748 } | 1746 } |
| 1749 storage_partition_impl_->GetBlobURLLoaderFactory()->HandleRequest( | 1747 storage_partition_impl_->GetBlobURLLoaderFactory()->HandleRequest( |
| 1750 std::move(request)); | 1748 std::move(request)); |
| 1751 } | 1749 } |
| 1752 | 1750 |
| 1753 void RenderProcessHostImpl::CreateMusGpuRequest( | 1751 void RenderProcessHostImpl::CreateMusGpuRequest( |
| 1754 const service_manager::BindSourceInfo& source_info, | 1752 const service_manager::BindSourceInfo& source_info, |
| 1755 ui::mojom::GpuRequest request) { | 1753 ui::mojom::GpuRequest request) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1789 | 1787 |
| 1790 void RenderProcessHostImpl::CreateRendererHost( | 1788 void RenderProcessHostImpl::CreateRendererHost( |
| 1791 const service_manager::BindSourceInfo& source_info, | 1789 const service_manager::BindSourceInfo& source_info, |
| 1792 mojom::RendererHostRequest request) { | 1790 mojom::RendererHostRequest request) { |
| 1793 renderer_host_binding_.Bind(std::move(request)); | 1791 renderer_host_binding_.Bind(std::move(request)); |
| 1794 } | 1792 } |
| 1795 | 1793 |
| 1796 void RenderProcessHostImpl::CreateURLLoaderFactory( | 1794 void RenderProcessHostImpl::CreateURLLoaderFactory( |
| 1797 const service_manager::BindSourceInfo& source_info, | 1795 const service_manager::BindSourceInfo& source_info, |
| 1798 mojom::URLLoaderFactoryRequest request) { | 1796 mojom::URLLoaderFactoryRequest request) { |
| 1799 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 1797 if (!base::FeatureList::IsEnabled(features::kNetworkService)) { |
| 1800 switches::kEnableNetworkService)) { | |
| 1801 NOTREACHED(); | 1798 NOTREACHED(); |
| 1802 return; | 1799 return; |
| 1803 } | 1800 } |
| 1804 storage_partition_impl_->network_context()->CreateURLLoaderFactory( | 1801 storage_partition_impl_->network_context()->CreateURLLoaderFactory( |
| 1805 std::move(request), id_); | 1802 std::move(request), id_); |
| 1806 } | 1803 } |
| 1807 | 1804 |
| 1808 int RenderProcessHostImpl::GetNextRoutingID() { | 1805 int RenderProcessHostImpl::GetNextRoutingID() { |
| 1809 return widget_helper_->GetNextRoutingID(); | 1806 return widget_helper_->GetNextRoutingID(); |
| 1810 } | 1807 } |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2292 switches::kEnableGPUClientLogging, | 2289 switches::kEnableGPUClientLogging, |
| 2293 switches::kEnableGpuClientTracing, | 2290 switches::kEnableGpuClientTracing, |
| 2294 switches::kEnableGpuMemoryBufferVideoFrames, | 2291 switches::kEnableGpuMemoryBufferVideoFrames, |
| 2295 switches::kEnableGPUServiceLogging, | 2292 switches::kEnableGPUServiceLogging, |
| 2296 switches::kEnableLowResTiling, | 2293 switches::kEnableLowResTiling, |
| 2297 switches::kEnableMediaSuspend, | 2294 switches::kEnableMediaSuspend, |
| 2298 switches::kEnableInbandTextTracks, | 2295 switches::kEnableInbandTextTracks, |
| 2299 switches::kEnableLCDText, | 2296 switches::kEnableLCDText, |
| 2300 switches::kEnableLogging, | 2297 switches::kEnableLogging, |
| 2301 switches::kEnableNetworkInformation, | 2298 switches::kEnableNetworkInformation, |
| 2302 switches::kEnableNetworkService, | |
| 2303 switches::kEnablePinch, | 2299 switches::kEnablePinch, |
| 2304 switches::kEnablePluginPlaceholderTesting, | 2300 switches::kEnablePluginPlaceholderTesting, |
| 2305 switches::kEnablePreciseMemoryInfo, | 2301 switches::kEnablePreciseMemoryInfo, |
| 2306 switches::kEnablePrintBrowser, | 2302 switches::kEnablePrintBrowser, |
| 2307 switches::kEnablePreferCompositingToLCDText, | 2303 switches::kEnablePreferCompositingToLCDText, |
| 2308 switches::kEnableRGBA4444Textures, | 2304 switches::kEnableRGBA4444Textures, |
| 2309 switches::kEnableSkiaBenchmarking, | 2305 switches::kEnableSkiaBenchmarking, |
| 2310 switches::kEnableSlimmingPaintV2, | 2306 switches::kEnableSlimmingPaintV2, |
| 2311 switches::kEnableSlimmingPaintInvalidation, | 2307 switches::kEnableSlimmingPaintInvalidation, |
| 2312 switches::kEnableSmoothScrolling, | 2308 switches::kEnableSmoothScrolling, |
| (...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3787 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3783 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 3788 | 3784 |
| 3789 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3785 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. |
| 3790 // Capture the error message in a crash key value. | 3786 // Capture the error message in a crash key value. |
| 3791 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3787 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); |
| 3792 bad_message::ReceivedBadMessage(render_process_id, | 3788 bad_message::ReceivedBadMessage(render_process_id, |
| 3793 bad_message::RPH_MOJO_PROCESS_ERROR); | 3789 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 3794 } | 3790 } |
| 3795 | 3791 |
| 3796 } // namespace content | 3792 } // namespace content |
| OLD | NEW |