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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2874163004: Add support in the network service for different contexts. (Closed)
Patch Set: review comment and clang fixes Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index d8afadb8756cb16edfc30060922dd2bca6bc41a4..f833223326238395c2dee7f054f7fd45df4cf55a 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -137,6 +137,7 @@
#include "content/common/content_switches_internal.h"
#include "content/common/frame_messages.h"
#include "content/common/in_process_child_thread_params.h"
+#include "content/common/network_service.mojom.h"
#include "content/common/render_process_messages.h"
#include "content/common/resource_messages.h"
#include "content/common/service_manager/child_connection.h"
@@ -1415,6 +1416,14 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
->AddInterface(base::Bind(&RenderProcessHostImpl::BindRouteProvider,
base::Unretained(this)));
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableNetworkService)) {
+ AddUIThreadInterface(
+ registry.get(),
+ base::Bind(&RenderProcessHostImpl::CreateURLLoaderFactory,
+ base::Unretained(this)));
+ }
+
ServiceManagerConnection* service_manager_connection =
BrowserContext::GetServiceManagerConnectionFor(browser_context_);
std::unique_ptr<ConnectionFilterImpl> connection_filter(
@@ -1488,6 +1497,18 @@ void RenderProcessHostImpl::CreateStoragePartitionService(
}
}
+void RenderProcessHostImpl::CreateURLLoaderFactory(
+ const service_manager::BindSourceInfo& source_info,
+ mojom::URLLoaderFactoryRequest request) {
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableNetworkService)) {
+ NOTREACHED();
+ return;
+ }
+ storage_partition_impl_->network_context()->CreateURLLoaderFactory(
+ std::move(request), id_);
+}
+
int RenderProcessHostImpl::GetNextRoutingID() {
return widget_helper_->GetNextRoutingID();
}
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698