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

Unified Diff: services/surfaces/surfaces_impl.cc

Issue 920063002: Fix surface crash. (Closed) Base URL: https://github.com/domokit/mojo.git@background_crash_takes3
Patch Set: Delete display instead of resetting the id. Created 5 years, 10 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 | « services/surfaces/surfaces_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/surfaces/surfaces_impl.cc
diff --git a/services/surfaces/surfaces_impl.cc b/services/surfaces/surfaces_impl.cc
index 1119985e2136247db91127871f0868b021458991..8a0ed59c0aa56d88c698a251bd715bd1de8f551f 100644
--- a/services/surfaces/surfaces_impl.cc
+++ b/services/surfaces/surfaces_impl.cc
@@ -70,6 +70,11 @@ void SurfacesImpl::SubmitFrame(uint32_t local_id,
void SurfacesImpl::DestroySurface(uint32_t local_id) {
factory_.Destroy(QualifyIdentifier(local_id));
+ if (local_id == displayed_surface_) {
+ displayed_surface_ = 0;
+ client_->OnDisplayBeingDestroyed(display_.get());
+ display_.reset();
+ }
}
void SurfacesImpl::CreateGLES2BoundSurface(
@@ -86,6 +91,7 @@ void SurfacesImpl::CreateGLES2BoundSurface(
display_->Initialize(make_scoped_ptr(new mojo::DirectOutputSurface(
new mojo::ContextProviderMojo(command_buffer_handle_.Pass()))));
}
+ displayed_surface_ = local_id;
cc::SurfaceId cc_id = QualifyIdentifier(local_id);
factory_.Create(cc_id);
display_->SetSurfaceId(cc_id, 1.f);
@@ -136,6 +142,7 @@ SurfacesImpl::SurfacesImpl(cc::SurfaceManager* manager,
factory_(manager, this),
id_namespace_(id_namespace),
client_(client),
+ displayed_surface_(0),
binding_(this) {
}
« no previous file with comments | « services/surfaces/surfaces_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698