Index: content/renderer/render_thread_impl.cc |
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc |
index ed37e5ebe2b5cd39365a554dd33d38ee8d1fceaa..cc719b903a4c1411066601699ed58b03e02a788e 100644 |
--- a/content/renderer/render_thread_impl.cc |
+++ b/content/renderer/render_thread_impl.cc |
@@ -46,6 +46,7 @@ |
#include "cc/raster/task_graph_runner.h" |
#include "cc/trees/layer_tree_host_common.h" |
#include "cc/trees/layer_tree_settings.h" |
+#include "components/memory_coordinator/child/child_memory_coordinator_impl.h" |
#include "components/scheduler/child/compositor_worker_scheduler.h" |
#include "components/scheduler/child/webthread_base.h" |
#include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" |
@@ -798,10 +799,15 @@ void RenderThreadImpl::Init( |
} |
#endif |
- memory_pressure_listener_.reset(new base::MemoryPressureListener( |
- base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)), |
- base::Bind(&RenderThreadImpl::OnSyncMemoryPressure, |
- base::Unretained(this)))); |
+ if (memory_coordinator::IsEnabled()) { |
+ GetInterfaceRegistry()->AddInterface( |
+ base::Bind(memory_coordinator::ChildMemoryCoordinatorImpl::Create)); |
+ } else { |
+ memory_pressure_listener_.reset(new base::MemoryPressureListener( |
+ base::Bind(&RenderThreadImpl::OnMemoryPressure, base::Unretained(this)), |
+ base::Bind(&RenderThreadImpl::OnSyncMemoryPressure, |
+ base::Unretained(this)))); |
+ } |
int num_raster_threads = 0; |
std::string string_value = |