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

Unified Diff: ui/views/mus/surface_binding.cc

Issue 1995613003: views/mus: Fix some flaky crashes during test teardown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@views-mus-more-focus-fix
Patch Set: . Created 4 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 | « no previous file | ui/views/mus/surface_context_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/surface_binding.cc
diff --git a/ui/views/mus/surface_binding.cc b/ui/views/mus/surface_binding.cc
index 4161811c44992bfa72440ed0a1279b1b02903f3f..a3dc98fb7304f2ad4a5c85cb9b99d714bc5ce0fe 100644
--- a/ui/views/mus/surface_binding.cc
+++ b/ui/views/mus/surface_binding.cc
@@ -98,6 +98,8 @@ std::unique_ptr<cc::OutputSurface>
SurfaceBinding::PerConnectionState::CreateOutputSurface(
mus::Window* window,
mus::mojom::SurfaceType surface_type) {
+ if (gpu_.encountered_error())
+ return nullptr;
// TODO(sky): figure out lifetime here. Do I need to worry about the return
// value outliving this?
mus::mojom::CommandBufferPtr cb;
@@ -127,6 +129,12 @@ SurfaceBinding::PerConnectionState::~PerConnectionState() {
void SurfaceBinding::PerConnectionState::Init() {
connector_->ConnectToInterface("mojo:mus", &gpu_);
+
+ // TODO(sad): If connection is lost (e.g. if gpu crashes), then the
+ // connections need to be restored. https://crbug.com/613366
+ // TODO(rockot|yzshen): It is necessary to install a connection-error handler,
+ // even if the handler doesn't actually do anything. https://crbug.com/613371
+ gpu_.set_connection_error_handler([]{});
}
// SurfaceBinding --------------------------------------------------------------
« no previous file with comments | « no previous file | ui/views/mus/surface_context_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698