Make RenderThreadImpl::ReleaseFreeMemory call RenderThreadImpl::ClearMemory
Most of the callers of ReleaseFreeMemory() have been usually invoking ClearMemory() together. So it would be good if we call ClearMemory() inside ReleaseFreeMemory(). It will help to return more free memory through ReleaseFreeMemory(). This CL makes ReleaseFreeMemory() purge more free memory through calling ClearMemory(). But this CL just calls SkGraphics::PurgeAllCaches() directly, since ClearMemory() doesn't do much stuff. And, this CL removes ClearMemory() that is no longer needed. The test case is implemented by referring to RenderThreadImplDiscardableMemoryBrowserTest.ReleaseFreeDiscardableMemory(). It calls RenderThreadImpl::ReleaseFreeMemory through a fake memory pressure notification. Besides RenderThreadImplClearMemoryBrowserTest.MAYBE_ClearMemory should be also removed because ClearMemory() is removed. Test: RenderThreadImplDiscardableMemoryBrowserTest.ReleaseFreeMemory() Bug: None Change-Id: If82e204b6d8785e8d97cd57fe7eac9f0f852a7a8 Reviewed-on: https://chromium-review.googlesource.com/945748 Commit-Queue: Gyuyoung Kim <gyuyoung.kim@lge.com> Reviewed-by:Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#540775}
Showing
Please register or sign in to comment