Avoid using TaskObserver at MemoryCache
We want to avoid TaskObserver since this binds the current message loop's default task runner and a class tightly. This CL makes MemoryCache not be a TaskObserver and actual pruning is deferred by posting a task. This changes the behavior that the pruning task is enqueued to the end of the task runner. This should not affect actual memory usages so much. This CL also replaces the default task runner usages in the tests with the test task runner since we also want to avoid the default task runner in the test as much as possible. Bug: 870606 Change-Id: I6865ffe2a02800b5106b6da8605e7624498d6316 Reviewed-on: https://chromium-review.googlesource.com/c/1258805Reviewed-by:Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by:
Kentaro Hara <haraken@chromium.org> Reviewed-by:
Alexander Timin <altimin@chromium.org> Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org> Cr-Commit-Position: refs/heads/master@{#596476}
Showing
Please register or sign in to comment