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

Unified Diff: cc/resources/resource_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/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

Powered by Google App Engine
This is Rietveld 408576698