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

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: gyp Created 4 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
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 2fc1b165e66f19102e73f88d982b7ddd9c21485d..27d4f7f90c3e34e6a13dbe173c4b43dd79bc0152 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -44,6 +44,7 @@
#include "base/tracked_objects.h"
#include "build/build_config.h"
#include "cc/base/switches.h"
+#include "components/memory_coordinator/browser/memory_state_notifier.h"
#include "components/scheduler/common/scheduler_switches.h"
#include "components/tracing/common/tracing_switches.h"
#include "content/browser/appcache/appcache_dispatcher_host.h"
@@ -1404,6 +1405,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kEnableIconNtp,
switches::kEnableLowResTiling,
switches::kEnableMediaSuspend,
+ switches::kEnableMemoryCoordinator,
switches::kEnableInbandTextTracks,
switches::kEnableLCDText,
switches::kEnableLogging,
@@ -2556,6 +2558,16 @@ void RenderProcessHostImpl::OnProcessLaunched() {
child_process_launcher_->GetProcess().Handle());
}
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableMemoryCoordinator) &&
+ mojo_application_host_) {
+ memory_coordinator::mojom::ChildMemoryCoordinatorPtr coordinator;
+ GetServiceRegistry()->ConnectToRemoteService(
+ mojo::GetProxy(&coordinator));
+ BrowserMainLoop::GetInstance()->memory_state_notifier()->AddChild(
+ std::move(coordinator));
+ }
+
// Not all platforms launch processes in the same backgrounded state. Make
// sure |is_process_backgrounded_| reflects this platform's initial process
// state.

Powered by Google App Engine
This is Rietveld 408576698