Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3366)

Unified Diff: cc/raster/staging_buffer_pool.cc

Issue 2286583002: Make cc::SoftwareImageDecodeController, cc::ResourcePool, and cc::StagingBufferPoo… (Closed)
Patch Set: Fixed DEPS. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/raster/staging_buffer_pool.cc
diff --git a/cc/raster/staging_buffer_pool.cc b/cc/raster/staging_buffer_pool.cc
index ade400d9906ad3c07a5b92280775f3c91644e6ab..f87aec445d7ec8d83f7d62121f3f91bdd5420fa9 100644
--- a/cc/raster/staging_buffer_pool.cc
+++ b/cc/raster/staging_buffer_pool.cc
@@ -409,4 +409,14 @@ void StagingBufferPool::ReleaseBuffersNotUsedSince(base::TimeTicks time) {
}
}
+void StagingBufferPool::OnMemoryStateChange(
+ memory_coordinator::mojom::MemoryState state) {
+ if (state == memory_coordinator::mojom::MemoryState::SUSPENDED) {
+ base::AutoLock lock(lock_);
+ if (buffers_.empty())
+ return;
+ ReleaseBuffersNotUsedSince(base::TimeTicks() + base::TimeDelta::Max());
+ }
+}
+
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698