| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/resources/resource_pool.h" | 5 #include "cc/resources/resource_pool.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 void ResourcePool::OnMemoryStateChange(base::MemoryState state) { | 462 void ResourcePool::OnMemoryStateChange(base::MemoryState state) { |
| 463 switch (state) { | 463 switch (state) { |
| 464 case base::MemoryState::NORMAL: | 464 case base::MemoryState::NORMAL: |
| 465 // TODO(tasak): go back to normal state. | 465 // TODO(tasak): go back to normal state. |
| 466 break; | 466 break; |
| 467 case base::MemoryState::THROTTLED: | 467 case base::MemoryState::THROTTLED: |
| 468 // TODO(tasak): make the limits of this component's caches smaller to | 468 // TODO(tasak): make the limits of this component's caches smaller to |
| 469 // save memory usage. | 469 // save memory usage. |
| 470 break; | 470 break; |
| 471 case base::MemoryState::SUSPENDED: | 471 case base::MemoryState::SUSPENDED: |
| 472 // TODO(tasak): free this component's caches as much as possible before | 472 // Release all resources, regardless of how recently they were used. |
| 473 // suspending renderer. | 473 EvictResourcesNotUsedSince(base::TimeTicks() + base::TimeDelta::Max()); |
| 474 break; | 474 break; |
| 475 case base::MemoryState::UNKNOWN: | 475 case base::MemoryState::UNKNOWN: |
| 476 // NOT_REACHED. | 476 // NOT_REACHED. |
| 477 break; | 477 break; |
| 478 } | 478 } |
| 479 } | 479 } |
| 480 | 480 |
| 481 } // namespace cc | 481 } // namespace cc |
| OLD | NEW |