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

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

Issue 2094583002: Add MemoryCoordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Create handle per child Created 4 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 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 c4b72a3241682e420e1aee06434c9c44cbaf6003..b37efcd300cb48a1328b7c12d03ed6b6d3b576c4 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -44,6 +44,8 @@
#include "base/tracked_objects.h"
#include "build/build_config.h"
#include "cc/base/switches.h"
+#include "components/memory_coordinator/browser/memory_coordinator.h"
+#include "components/memory_coordinator/common/memory_coordinator_features.h"
#include "components/scheduler/common/scheduler_switches.h"
#include "components/tracing/common/tracing_switches.h"
#include "components/webmessaging/broadcast_channel_provider.h"
@@ -448,6 +450,13 @@ std::string UintVectorToString(const std::vector<unsigned>& vector) {
return str;
}
+void CreateMemoryCoordinatorHandle(
+ int id,
+ memory_coordinator::mojom::MemoryCoordinatorHandleRequest request) {
+ BrowserMainLoop::GetInstance()->memory_coordinator()->CreateHandle(
+ id, std::move(request));
+}
+
} // namespace
RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL;
@@ -1091,6 +1100,11 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
GetInterfaceRegistry()->AddInterface(
base::Bind(&DeviceOrientationAbsoluteHost::Create), io_task_runner);
+ if (memory_coordinator::IsEnabled()) {
+ GetInterfaceRegistry()->AddInterface(
+ base::Bind(&CreateMemoryCoordinatorHandle, GetID()));
+ }
+
#if defined(OS_ANDROID)
ServiceRegistrarAndroid::RegisterProcessHostServices(
mojo_child_connection_->service_registry_android());

Powered by Google App Engine
This is Rietveld 408576698