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

Unified Diff: cc/surfaces/surface_manager.cc

Issue 2794993002: Revert of SurfaceManager::CreateSurface must set the surface's factory (Closed)
Patch Set: Rebase Created 3 years, 9 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
« no previous file with comments | « cc/surfaces/surface.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_manager.cc
diff --git a/cc/surfaces/surface_manager.cc b/cc/surfaces/surface_manager.cc
index f6ecbb8997ec06bb22d673b61e3d5687c7fe5400..2c2e2f69cef0d5c658cfb80110be374690fd7975 100644
--- a/cc/surfaces/surface_manager.cc
+++ b/cc/surfaces/surface_manager.cc
@@ -108,24 +108,12 @@ std::unique_ptr<Surface> SurfaceManager::CreateSurface(
std::unique_ptr<Surface> surface = std::move(*it);
surfaces_to_destroy_.erase(it);
surface->set_destroyed(false);
- // If the surface was used by another factory, we should update its factory.
- // The old frames must be evicted because the new factory is not capable of
- // returning their resources.
- // TODO(samans): This should not be necessary once crbug.com/701988 is fixed.
- if (surface->factory() == nullptr) {
- DLOG(ERROR) << "Surface is being reused by another factory. "
- "Resources can potentially leak. id="
- << surface_id;
- surface->Reset();
- surface->set_factory(surface_factory);
- }
DCHECK_EQ(surface_factory.get(), surface->factory().get());
return surface;
}
void SurfaceManager::DestroySurface(std::unique_ptr<Surface> surface) {
DCHECK(thread_checker_.CalledOnValidThread());
-
surface->set_destroyed(true);
surfaces_to_destroy_.push_back(std::move(surface));
GarbageCollectSurfaces();
« no previous file with comments | « cc/surfaces/surface.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698