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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 2590073002: Disable suspending renderer when memory coordinator is enabled (Closed)
Patch Set: Created 4 years 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 | « no previous file | 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 28eb4e2dc9fa701c064f512c6bbe8afb78a37e34..febdb9809a092c912abe22bbad60fbfb516f2d92 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -1779,10 +1779,9 @@ void RenderThreadImpl::OnProcessPurgeAndSuspend() {
if (!RendererIsHidden())
return;
if (base::FeatureList::IsEnabled(features::kPurgeAndSuspend)) {
- // TODO(tasak): After enabling MemoryCoordinator, remove this Notify
- // and follow MemoryCoordinator's request.
- base::MemoryCoordinatorClientRegistry::GetInstance()->Notify(
- base::MemoryState::SUSPENDED);
+ // TODO(tasak,bashi): After enabling MemoryCoordinator, stop calling
+ // SuspendRenderer() here.
+ SuspendRenderer();
}
// Since purging is not a synchronous task (e.g. v8 GC, oilpan GC, ...),
// we need to wait until the task is finished. So wait 15 seconds and
@@ -1890,10 +1889,9 @@ void RenderThreadImpl::OnProcessResume() {
if (!RendererIsHidden())
return;
if (base::FeatureList::IsEnabled(features::kPurgeAndSuspend)) {
- // TODO(tasak): after enabling MemoryCoordinator, remove this Notify
- // and follow MemoryCoordinator's request.
- base::MemoryCoordinatorClientRegistry::GetInstance()->Notify(
- base::MemoryState::NORMAL);
+ // TODO(tasak,bashi): After enabling MemoryCoordinator, stop calling
+ // ResumeRenderer() here.
+ ResumeRenderer();
}
}
@@ -2260,10 +2258,10 @@ void RenderThreadImpl::OnMemoryStateChange(base::MemoryState state) {
}
switch (state) {
case base::MemoryState::NORMAL:
- ResumeRenderer();
+ // TODO(bashi): When the renderer is suspended, resume it.
break;
case base::MemoryState::THROTTLED:
- ResumeRenderer();
+ // TODO(bashi): When the renderer is suspended, resume it.
// TODO(bashi): Figure out what kind of strategy is suitable on
// THROTTLED state. crbug.com/674815
#if defined(OS_ANDROID)
@@ -2275,7 +2273,10 @@ void RenderThreadImpl::OnMemoryStateChange(base::MemoryState state) {
ReleaseFreeMemory();
break;
case base::MemoryState::SUSPENDED:
- SuspendRenderer();
+ // TODO(bashi): Suspend the renderer.
+ OnTrimMemoryImmediately();
+ ReleaseFreeMemory();
+ ClearMemory();
break;
case base::MemoryState::UNKNOWN:
NOTREACHED();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698