Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2960703003: Add a feature flag for network service and about:flags entry for it. (Closed)
Patch Set: merge Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after
1701 GetContentClient()->browser()->ExposeInterfacesToRenderer( 1701 GetContentClient()->browser()->ExposeInterfacesToRenderer(
1702 registry.get(), associated_interfaces_.get(), this); 1702 registry.get(), associated_interfaces_.get(), this);
1703 static_cast<AssociatedInterfaceRegistry*>(associated_interfaces_.get()) 1703 static_cast<AssociatedInterfaceRegistry*>(associated_interfaces_.get())
1704 ->AddInterface(base::Bind(&RenderProcessHostImpl::BindRouteProvider, 1704 ->AddInterface(base::Bind(&RenderProcessHostImpl::BindRouteProvider,
1705 base::Unretained(this))); 1705 base::Unretained(this)));
1706 1706
1707 AddUIThreadInterface(registry.get(), 1707 AddUIThreadInterface(registry.get(),
1708 base::Bind(&RenderProcessHostImpl::CreateRendererHost, 1708 base::Bind(&RenderProcessHostImpl::CreateRendererHost,
1709 base::Unretained(this))); 1709 base::Unretained(this)));
1710 1710
1711 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 1711 if (base::FeatureList::IsEnabled(features::kNetworkService)) {
1712 switches::kEnableNetworkService)) {
1713 AddUIThreadInterface( 1712 AddUIThreadInterface(
1714 registry.get(), 1713 registry.get(),
1715 base::Bind(&RenderProcessHostImpl::CreateURLLoaderFactory, 1714 base::Bind(&RenderProcessHostImpl::CreateURLLoaderFactory,
1716 base::Unretained(this))); 1715 base::Unretained(this)));
1717 } 1716 }
1718 1717
1719 if (base::FeatureList::IsEnabled(features::kMojoBlobs)) { 1718 if (base::FeatureList::IsEnabled(features::kMojoBlobs)) {
1720 registry->AddInterface(base::Bind( 1719 registry->AddInterface(base::Bind(
1721 &ChromeBlobStorageContext::BindBlobRegistry, 1720 &ChromeBlobStorageContext::BindBlobRegistry,
1722 base::Unretained(ChromeBlobStorageContext::GetFor(browser_context_)))); 1721 base::Unretained(ChromeBlobStorageContext::GetFor(browser_context_))));
(...skipping 29 matching lines...) Expand all
1752 mojom::AssociatedInterfaceAssociatedRequest request) { 1751 mojom::AssociatedInterfaceAssociatedRequest request) {
1753 int32_t routing_id = 1752 int32_t routing_id =
1754 associated_interface_provider_bindings_.dispatch_context(); 1753 associated_interface_provider_bindings_.dispatch_context();
1755 IPC::Listener* listener = listeners_.Lookup(routing_id); 1754 IPC::Listener* listener = listeners_.Lookup(routing_id);
1756 if (listener) 1755 if (listener)
1757 listener->OnAssociatedInterfaceRequest(name, request.PassHandle()); 1756 listener->OnAssociatedInterfaceRequest(name, request.PassHandle());
1758 } 1757 }
1759 1758
1760 void RenderProcessHostImpl::GetBlobURLLoaderFactory( 1759 void RenderProcessHostImpl::GetBlobURLLoaderFactory(
1761 mojom::URLLoaderFactoryRequest request) { 1760 mojom::URLLoaderFactoryRequest request) {
1762 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 1761 if (!base::FeatureList::IsEnabled(features::kNetworkService)) {
1763 switches::kEnableNetworkService)) {
1764 NOTREACHED(); 1762 NOTREACHED();
1765 return; 1763 return;
1766 } 1764 }
1767 storage_partition_impl_->GetBlobURLLoaderFactory()->HandleRequest( 1765 storage_partition_impl_->GetBlobURLLoaderFactory()->HandleRequest(
1768 std::move(request)); 1766 std::move(request));
1769 } 1767 }
1770 1768
1771 void RenderProcessHostImpl::CreateMusGpuRequest( 1769 void RenderProcessHostImpl::CreateMusGpuRequest(
1772 const service_manager::BindSourceInfo& source_info, 1770 const service_manager::BindSourceInfo& source_info,
1773 ui::mojom::GpuRequest request) { 1771 ui::mojom::GpuRequest request) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1807 1805
1808 void RenderProcessHostImpl::CreateRendererHost( 1806 void RenderProcessHostImpl::CreateRendererHost(
1809 const service_manager::BindSourceInfo& source_info, 1807 const service_manager::BindSourceInfo& source_info,
1810 mojom::RendererHostRequest request) { 1808 mojom::RendererHostRequest request) {
1811 renderer_host_binding_.Bind(std::move(request)); 1809 renderer_host_binding_.Bind(std::move(request));
1812 } 1810 }
1813 1811
1814 void RenderProcessHostImpl::CreateURLLoaderFactory( 1812 void RenderProcessHostImpl::CreateURLLoaderFactory(
1815 const service_manager::BindSourceInfo& source_info, 1813 const service_manager::BindSourceInfo& source_info,
1816 mojom::URLLoaderFactoryRequest request) { 1814 mojom::URLLoaderFactoryRequest request) {
1817 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 1815 if (!base::FeatureList::IsEnabled(features::kNetworkService)) {
1818 switches::kEnableNetworkService)) {
1819 NOTREACHED(); 1816 NOTREACHED();
1820 return; 1817 return;
1821 } 1818 }
1822 storage_partition_impl_->network_context()->CreateURLLoaderFactory( 1819 storage_partition_impl_->network_context()->CreateURLLoaderFactory(
1823 std::move(request), id_); 1820 std::move(request), id_);
1824 } 1821 }
1825 1822
1826 int RenderProcessHostImpl::GetNextRoutingID() { 1823 int RenderProcessHostImpl::GetNextRoutingID() {
1827 return widget_helper_->GetNextRoutingID(); 1824 return widget_helper_->GetNextRoutingID();
1828 } 1825 }
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
2310 switches::kEnableGPUClientLogging, 2307 switches::kEnableGPUClientLogging,
2311 switches::kEnableGpuClientTracing, 2308 switches::kEnableGpuClientTracing,
2312 switches::kEnableGpuMemoryBufferVideoFrames, 2309 switches::kEnableGpuMemoryBufferVideoFrames,
2313 switches::kEnableGPUServiceLogging, 2310 switches::kEnableGPUServiceLogging,
2314 switches::kEnableLowResTiling, 2311 switches::kEnableLowResTiling,
2315 switches::kEnableMediaSuspend, 2312 switches::kEnableMediaSuspend,
2316 switches::kEnableInbandTextTracks, 2313 switches::kEnableInbandTextTracks,
2317 switches::kEnableLCDText, 2314 switches::kEnableLCDText,
2318 switches::kEnableLogging, 2315 switches::kEnableLogging,
2319 switches::kEnableNetworkInformation, 2316 switches::kEnableNetworkInformation,
2320 switches::kEnableNetworkService,
2321 switches::kEnablePinch, 2317 switches::kEnablePinch,
2322 switches::kEnablePluginPlaceholderTesting, 2318 switches::kEnablePluginPlaceholderTesting,
2323 switches::kEnablePreciseMemoryInfo, 2319 switches::kEnablePreciseMemoryInfo,
2324 switches::kEnablePrintBrowser, 2320 switches::kEnablePrintBrowser,
2325 switches::kEnablePreferCompositingToLCDText, 2321 switches::kEnablePreferCompositingToLCDText,
2326 switches::kEnableRGBA4444Textures, 2322 switches::kEnableRGBA4444Textures,
2327 switches::kEnableSkiaBenchmarking, 2323 switches::kEnableSkiaBenchmarking,
2328 switches::kEnableSlimmingPaintV2, 2324 switches::kEnableSlimmingPaintV2,
2329 switches::kEnableSlimmingPaintInvalidation, 2325 switches::kEnableSlimmingPaintInvalidation,
2330 switches::kEnableSmoothScrolling, 2326 switches::kEnableSmoothScrolling,
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after
3805 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3801 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3806 3802
3807 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3803 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3808 // Capture the error message in a crash key value. 3804 // Capture the error message in a crash key value.
3809 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3805 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3810 bad_message::ReceivedBadMessage(render_process_id, 3806 bad_message::ReceivedBadMessage(render_process_id,
3811 bad_message::RPH_MOJO_PROCESS_ERROR); 3807 bad_message::RPH_MOJO_PROCESS_ERROR);
3812 } 3808 }
3813 3809
3814 } // namespace content 3810 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/navigation_url_loader.cc ('k') | content/browser/service_manager/service_manager_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698