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

Unified Diff: cc/surfaces/surface_factory.cc

Issue 693943003: Update from https://crrev.com/302630 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « cc/surfaces/surface_factory.h ('k') | cc/surfaces/surface_factory_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_factory.cc
diff --git a/cc/surfaces/surface_factory.cc b/cc/surfaces/surface_factory.cc
index dcf1130c942b4dcefbbb0b34e39d85e4a9e869c5..88c54557cb4536f118b4b2eba687ddc765b495a3 100644
--- a/cc/surfaces/surface_factory.cc
+++ b/cc/surfaces/surface_factory.cc
@@ -17,6 +17,17 @@ SurfaceFactory::SurfaceFactory(SurfaceManager* manager,
}
SurfaceFactory::~SurfaceFactory() {
+ if (!surface_map_.empty()) {
+ LOG(ERROR) << "SurfaceFactory has " << surface_map_.size()
+ << " entries in map on destruction.";
+ }
+ DestroyAll();
+}
+
+void SurfaceFactory::DestroyAll() {
+ for (auto& surface : surface_map_)
+ manager_->DeregisterSurface(surface.first);
+ surface_map_.clear();
}
void SurfaceFactory::Create(SurfaceId surface_id, const gfx::Size& size) {
« no previous file with comments | « cc/surfaces/surface_factory.h ('k') | cc/surfaces/surface_factory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698