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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 2731913002: NotForReview: Expose the global memory budget (chromium side)
Patch Set: Add --simulate-memory-pressure Created 3 years, 9 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 | « content/common/memory_coordinator.mojom ('k') | gin/public/v8_platform.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index b9613aed26ff5b880f64d6b0e4836730d7e3cdad..7414601d2f3d0663f381c57de7e91dcb958dd81b 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -624,6 +624,19 @@ void RenderThreadImpl::Init(
// Register this object as the main thread.
ChildProcess::current()->set_main_thread(this);
+ if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) {
+ // Disable MemoryPressureListener when memory coordinator is enabled.
+ base::MemoryPressureListener::SetNotificationsSuppressed(true);
+
+ // TODO(bashi): Revisit how to manage the lifetime of
+ // ChildMemoryCoordinatorImpl.
+ // https://codereview.chromium.org/2094583002/#msg52
+ mojom::MemoryCoordinatorHandlePtr parent_coordinator;
+ GetRemoteInterfaces()->GetInterface(mojo::MakeRequest(&parent_coordinator));
+ memory_coordinator_ =
+ CreateChildMemoryCoordinator(std::move(parent_coordinator), this);
+ }
+
if (IsRunningInMash()) {
gpu_ = ui::Gpu::Create(GetServiceManagerConnection()->GetConnector(),
GetIOTaskRunner());
@@ -826,19 +839,6 @@ void RenderThreadImpl::Init(
base::Bind(&RenderThreadImpl::OnSyncMemoryPressure,
base::Unretained(this))));
- if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) {
- // Disable MemoryPressureListener when memory coordinator is enabled.
- base::MemoryPressureListener::SetNotificationsSuppressed(true);
-
- // TODO(bashi): Revisit how to manage the lifetime of
- // ChildMemoryCoordinatorImpl.
- // https://codereview.chromium.org/2094583002/#msg52
- mojom::MemoryCoordinatorHandlePtr parent_coordinator;
- GetRemoteInterfaces()->GetInterface(mojo::MakeRequest(&parent_coordinator));
- memory_coordinator_ = CreateChildMemoryCoordinator(
- std::move(parent_coordinator), this);
- }
-
int num_raster_threads = 0;
std::string string_value =
command_line.GetSwitchValueASCII(switches::kNumRasterThreads);
« no previous file with comments | « content/common/memory_coordinator.mojom ('k') | gin/public/v8_platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698