| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/raster/staging_buffer_pool.h" | 5 #include "cc/raster/staging_buffer_pool.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/memory/memory_coordinator_client_registry.h" | 9 #include "base/memory/memory_coordinator_client_registry.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 void StagingBufferPool::OnMemoryStateChange(base::MemoryState state) { | 419 void StagingBufferPool::OnMemoryStateChange(base::MemoryState state) { |
| 420 switch (state) { | 420 switch (state) { |
| 421 case base::MemoryState::NORMAL: | 421 case base::MemoryState::NORMAL: |
| 422 // TODO(tasak): go back to normal state. | 422 // TODO(tasak): go back to normal state. |
| 423 break; | 423 break; |
| 424 case base::MemoryState::THROTTLED: | 424 case base::MemoryState::THROTTLED: |
| 425 // TODO(tasak): make the limits of this component's caches smaller to | 425 // TODO(tasak): make the limits of this component's caches smaller to |
| 426 // save memory usage. | 426 // save memory usage. |
| 427 break; | 427 break; |
| 428 case base::MemoryState::SUSPENDED: | 428 case base::MemoryState::SUSPENDED: |
| 429 // TODO(tasak): free this component's caches as much as possible before | 429 // Release all buffers, regardless of how recently they were used. |
| 430 // suspending renderer. | 430 ReleaseBuffersNotUsedSince(base::TimeTicks() + base::TimeDelta::Max()); |
| 431 break; | 431 break; |
| 432 case base::MemoryState::UNKNOWN: | 432 case base::MemoryState::UNKNOWN: |
| 433 // NOT_REACHED. | 433 // NOT_REACHED. |
| 434 break; | 434 break; |
| 435 } | 435 } |
| 436 } | 436 } |
| 437 | 437 |
| 438 } // namespace cc | 438 } // namespace cc |
| OLD | NEW |