Commit f4544427 authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

Call blink::WebMemoryCoordinator::OnPurgeMemory in RenderThreadImpl::ReleaseFreeMemory

|WebMemoryCoordinator::OnPurgeMemory| has been only called in |RenderThreadImpl::OnPurgeMemory|,
and |RenderThreadImpl::OnPurgeMemory| is only able to be called by |base::MemoryCoordinatorClient|.
But, if there is no performance degradation, it would be good to purge used memory as much as
possible. |RenderThreadImpl::ReleaseFreeMemory| has been more called than |RenderThreadImpl::OnPurgeMemory|
from some callers. So we can free up more memory if we move |WebMemoryCoordinator::OnPurgeMemory|
from |RenderThreadImpl::OnPurgeMemory| to |RenderThreadImpl::ReleaseFreeMemory|.

TEST: Covered RenderThreadImplDiscardableMemoryBrowserTest.ReleaseFreeMemory

Bug: None
Change-Id: I225401bcd18f236265305aaf5eaf4b4219d9cde4
Reviewed-on: https://chromium-review.googlesource.com/1049414Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung.kim@lge.com>
Cr-Commit-Position: refs/heads/master@{#556728}
parent 5d1b216b
......@@ -2377,8 +2377,6 @@ void RenderThreadImpl::OnPurgeMemory() {
OnTrimMemoryImmediately();
ReleaseFreeMemory();
if (blink_platform_impl_)
blink::WebMemoryCoordinator::OnPurgeMemory();
}
void RenderThreadImpl::RecordPurgeMemory(RendererMemoryMetrics before) {
......@@ -2512,6 +2510,7 @@ void RenderThreadImpl::ReleaseFreeMemory() {
// Purge Skia font cache, resource cache, and image filter.
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