Chromium Code Reviews| Index: cc/resources/resource_pool.cc |
| diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc |
| index f4523d448f981d568bd229626fcb0fb1f284b3cd..193cc8c63b9568e0b75779261219ea270147a891 100644 |
| --- a/cc/resources/resource_pool.cc |
| +++ b/cc/resources/resource_pool.cc |
| @@ -453,4 +453,12 @@ bool ResourcePool::OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
| return true; |
| } |
| +void ResourcePool::OnMemoryStateChange( |
| + memory_coordinator::mojom::MemoryState state) { |
| + if (state == memory_coordinator::mojom::MemoryState::SUSPENDED) { |
| + while (!unused_resources_.empty()) |
| + DeleteResource(PopBack(&unused_resources_)); |
|
ericrk
2016/08/31 17:50:32
This doesn't free "busy" resources, which can safe
|
| + } |
| +} |
| + |
| } // namespace cc |