| Index: cc/resources/resource_pool.cc
|
| diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc
|
| index 61a7ae3f9fdc6519376a1b473631a73bc7cd3d40..54e33c5f5bbdab328b6e3f9606ca23ed12c2e0ef 100644
|
| --- a/cc/resources/resource_pool.cc
|
| +++ b/cc/resources/resource_pool.cc
|
| @@ -481,22 +481,17 @@ bool ResourcePool::OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
|
| }
|
|
|
| void ResourcePool::OnMemoryStateChange(base::MemoryState state) {
|
| - switch (state) {
|
| - case base::MemoryState::NORMAL:
|
| - // TODO(tasak): go back to normal state.
|
| - break;
|
| - case base::MemoryState::THROTTLED:
|
| - // TODO(tasak): make the limits of this component's caches smaller to
|
| - // save memory usage.
|
| - break;
|
| - case base::MemoryState::SUSPENDED:
|
| - // Release all resources, regardless of how recently they were used.
|
| - EvictResourcesNotUsedSince(base::TimeTicks() + base::TimeDelta::Max());
|
| - break;
|
| - case base::MemoryState::UNKNOWN:
|
| - // NOT_REACHED.
|
| - break;
|
| - }
|
| + // TODO(bashi): We are going to separate purging from state changes and we
|
| + // shouldn't purge memory here (crbug.com/684287). Tentatively call
|
| + // OnPurgeMemory() so that we don't break existing experiments.
|
| + // (i.e. purge+suspend experiment)
|
| + if (state == base::MemoryState::SUSPENDED)
|
| + OnPurgeMemory();
|
| +}
|
| +
|
| +void ResourcePool::OnPurgeMemory() {
|
| + // Release all resources, regardless of how recently they were used.
|
| + EvictResourcesNotUsedSince(base::TimeTicks() + base::TimeDelta::Max());
|
| }
|
|
|
| } // namespace cc
|
|
|