Commit 67dc1b41 authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

Reland: Call blink::WebMemoryCoordinator::OnPurgeMemory in RenderThreadImpl::ReleaseFreeMemory - 2

This reverts commit cdd97e24.

After perf-bot reported a regression in timeToFirstMeaningfulPaint,
timeToFirstContentfulPaint, and timeToFirstPaint on android nexus5,
the original CL was reverted. However, the regression looks reasonable
because ReleaseMemory could be called before FCP and FMP came on low-end
devices if the website needs to use much memory. I guess that the regression
caused because the test website(edition.cnn.com) was consuming too much memory
on the mobile device.

Bug: 850977, 851868

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Icc8e5f24c114947fe8d186f699d0457ea82b7416
Reviewed-on: https://chromium-review.googlesource.com/1096921Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung.kim@lge.com>
Cr-Commit-Position: refs/heads/master@{#568023}
parent 59cd12c4
...@@ -2335,8 +2335,6 @@ void RenderThreadImpl::OnPurgeMemory() { ...@@ -2335,8 +2335,6 @@ void RenderThreadImpl::OnPurgeMemory() {
OnTrimMemoryImmediately(); OnTrimMemoryImmediately();
ReleaseFreeMemory(); ReleaseFreeMemory();
if (blink_platform_impl_)
blink::WebMemoryCoordinator::OnPurgeMemory();
} }
void RenderThreadImpl::RecordPurgeMemory(RendererMemoryMetrics before) { void RenderThreadImpl::RecordPurgeMemory(RendererMemoryMetrics before) {
...@@ -2470,7 +2468,7 @@ void RenderThreadImpl::ReleaseFreeMemory() { ...@@ -2470,7 +2468,7 @@ void RenderThreadImpl::ReleaseFreeMemory() {
if (blink_platform_impl_) { if (blink_platform_impl_) {
// Purge Skia font cache, resource cache, and image filter. // Purge Skia font cache, resource cache, and image filter.
SkGraphics::PurgeAllCaches(); SkGraphics::PurgeAllCaches();
blink::DecommitFreeableMemory(); blink::WebMemoryCoordinator::OnPurgeMemory();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment