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

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

Issue 2959383002: [GRC] Hook up the process-level CoordinationUnit (Closed)
Patch Set: Address comments Created 3 years, 6 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
« no previous file with comments | « no previous file | content/public/app/mojo/content_browser_manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 67c5e5d64a18b8230867611b904860f3603a688c..d0399aa9d410fb8d0d1b20a67449f833cfb49e9d 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -186,6 +186,7 @@
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "net/url_request/url_request_context_getter.h"
#include "ppapi/features/features.h"
+#include "services/resource_coordinator/public/cpp/resource_coordinator_features.h"
#include "services/resource_coordinator/public/cpp/resource_coordinator_interface.h"
#include "services/service_manager/embedder/switches.h"
#include "services/service_manager/public/cpp/binder_registry.h"
@@ -528,6 +529,14 @@ void CreateMemoryCoordinatorHandle(
std::move(request));
}
+void CreateResourceCoordinatorProcessInterface(
+ RenderProcessHostImpl* render_process_host,
+ const service_manager::BindSourceInfo& source_info,
+ resource_coordinator::mojom::CoordinationUnitRequest request) {
+ render_process_host->GetProcessResourceCoordinator()->service()->AddBinding(
+ std::move(request));
+}
+
// Forwards service requests to Service Manager since the renderer cannot launch
// out-of-process services on is own.
template <typename R>
@@ -1662,6 +1671,11 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
registry->AddInterface(
base::Bind(&metrics::CreateSingleSampleMetricsProvider));
+ if (base::FeatureList::IsEnabled(features::kGlobalResourceCoordinator)) {
+ registry->AddInterface(base::Bind(
+ &CreateResourceCoordinatorProcessInterface, base::Unretained(this)));
+ }
+
if (base::FeatureList::IsEnabled(features::kOffMainThreadFetch)) {
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context(
static_cast<ServiceWorkerContextWrapper*>(
« no previous file with comments | « no previous file | content/public/app/mojo/content_browser_manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698