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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 2260433006: Add delegate and factory function for ChildMemoryCoordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: export Created 4 years, 4 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/renderer/render_thread_impl.h ('k') | no next file » | 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 38cb251b3d7a7e93b83c01d0ba36643ce2d1c1d9..796e9b92a6c76ec2feb6c6595998f6a2006bee5c 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -821,9 +821,8 @@ void RenderThreadImpl::Init(
// https://codereview.chromium.org/2094583002/#msg52
memory_coordinator::mojom::MemoryCoordinatorHandlePtr parent_coordinator;
GetRemoteInterfaces()->GetInterface(mojo::GetProxy(&parent_coordinator));
- memory_coordinator_.reset(
- new memory_coordinator::ChildMemoryCoordinatorImpl(
- std::move(parent_coordinator)));
+ memory_coordinator_ = memory_coordinator::CreateChildMemoryCoordinator(
+ std::move(parent_coordinator), this);
}
int num_raster_threads = 0;
@@ -2216,4 +2215,16 @@ void RenderThreadImpl::OnSyncMemoryPressure(
v8_memory_pressure_level);
}
+// Note that this would be called only when memory_coordinator is enabled.
+// OnSyncMemoryPressure() is never called in that case.
+void RenderThreadImpl::OnTrimMemoryImmediately() {
+ if (blink::mainThreadIsolate()) {
+ blink::mainThreadIsolate()->MemoryPressureNotification(
+ v8::MemoryPressureLevel::kCritical);
+ blink::MemoryPressureNotificationToWorkerThreadIsolates(
+ v8::MemoryPressureLevel::kCritical);
+ }
+}
+
+
} // namespace content
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698