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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 2094583002: Add MemoryCoordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment 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/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 304c589e7c69caf194802ab4eaaeb0913aafa6e7..4daf2bacc634a7c70819b077391847d2b6d653bd 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"
@@ -814,6 +815,14 @@ void RenderThreadImpl::Init(
base::Bind(&RenderThreadImpl::OnSyncMemoryPressure,
base::Unretained(this))));
+ if (memory_coordinator::IsEnabled()) {
+ memory_coordinator_.reset(
+ new memory_coordinator::ChildMemoryCoordinatorImpl());
+ GetInterfaceRegistry()->AddInterface(
+ base::Bind(&memory_coordinator::ChildMemoryCoordinatorImpl::Bind,
+ base::Unretained(memory_coordinator_.get())));
dcheng 2016/07/08 07:10:35 Does it make sense to just have memory_coordinator
bashi 2016/07/08 07:32:39 I didn't know base::Owned(). Thanks. Probably we c
+ }
+
int num_raster_threads = 0;
std::string string_value =
command_line.GetSwitchValueASCII(switches::kNumRasterThreads);

Powered by Google App Engine
This is Rietveld 408576698