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

Unified Diff: cc/surfaces/surface.cc

Issue 2880023002: cc::SurfaceDependencyTracker should not crash when a Display goes away (Closed)
Patch Set: Fix LayerTreeHostImpl unit tests Created 3 years, 7 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/primary_begin_frame_source.cc ('k') | cc/surfaces/surface_dependency_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface.cc
diff --git a/cc/surfaces/surface.cc b/cc/surfaces/surface.cc
index e7164c9ae5c3b51bf2e070cec395f60efe9ed5ca..9653f6005dc6e82c3c1f564ae0ae1927148c3bcc 100644
--- a/cc/surfaces/surface.cc
+++ b/cc/surfaces/surface.cc
@@ -108,8 +108,11 @@ bool Surface::QueueFrame(CompositorFrame frame,
frame_sink_ids_for_dependencies.count(surface_id.frame_sink_id()) > 0;
if (is_fallback_surface) {
Surface* surface = surface_manager_->GetSurfaceForId(surface_id);
- DCHECK(surface);
- surface->Close();
+ // A misbehaving client may report a non-existent surface ID as a
+ // |referenced_surface|. In that case, |surface| would be nullptr, and
+ // there is nothing to do here.
+ if (surface)
+ surface->Close();
}
}
pending_frame_data_ =
« no previous file with comments | « cc/surfaces/primary_begin_frame_source.cc ('k') | cc/surfaces/surface_dependency_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698