• Gyuyoung Kim's avatar
    Make RenderThreadImpl::ReleaseFreeMemory call RenderThreadImpl::ClearMemory · 7b96fa78
    Gyuyoung Kim authored
    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: default avatarKentaro Hara <haraken@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#540775}
    7b96fa78
render_thread_impl_browsertest.cc 14.9 KB