gpu: Drop GrContext cache after an idle period.

The renderer drops the GrContext cache after a second of idle period,
where idle period is identified as a continous period where the
ContextProvider backing a GrContext is not used. Implement the same
optimization for OOP raster in the GPU process.

[email protected]

Bug: 859419,859635
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Ic2ae533212b94320cd8c1b8b1149cf5ba4ce686e
Reviewed-on: https://chromium-review.googlesource.com/1123775
Reviewed-by: Eric Karl <[email protected]>
Reviewed-by: Antoine Labour <[email protected]>
Commit-Queue: Khushal <[email protected]>
Cr-Commit-Position: refs/heads/master@{#573871}
diff --git a/gpu/BUILD.gn b/gpu/BUILD.gn
index 4042760..0e9fa82 100644
--- a/gpu/BUILD.gn
+++ b/gpu/BUILD.gn
@@ -349,6 +349,7 @@
     "command_buffer/service/gpu_service_test.cc",
     "command_buffer/service/gpu_service_test.h",
     "command_buffer/service/gpu_tracer_unittest.cc",
+    "command_buffer/service/gr_cache_controller_unittest.cc",
     "command_buffer/service/id_manager_unittest.cc",
     "command_buffer/service/indexed_buffer_binding_host_unittest.cc",
     "command_buffer/service/mailbox_manager_unittest.cc",