Commit f77f6b8d authored by kylechar's avatar kylechar Committed by Commit Bot

Fix UseSurfaceLayerForVideo GPU crash handling.

When UseSurfaceLayerForVideo and VizDisplayCompositors are both enabled
with software compositing, VideoFrameSubmitter doesn't detect and
recover from GPU process crashes. Add a connection error handler on the
mojom::CompositorFrameSinkPtr to handle this case.

Bug: 730660
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ie364610bc61de3cdb3a18ce62f23e0fa217219df
Reviewed-on: https://chromium-review.googlesource.com/1099475
Commit-Queue: kylechar <kylechar@chromium.org>
Reviewed-by: default avatardanakj <danakj@chromium.org>
Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566971}
parent 09e98735
......@@ -177,6 +177,9 @@ void VideoFrameSubmitter::StartSubmitting() {
frame_sink_id_, std::move(client),
mojo::MakeRequest(&compositor_frame_sink_));
compositor_frame_sink_.set_connection_error_handler(base::BindOnce(
&VideoFrameSubmitter::OnContextLost, base::Unretained(this)));
if (is_rendering_)
compositor_frame_sink_->SetNeedsBeginFrame(true);
......@@ -278,12 +281,17 @@ void VideoFrameSubmitter::OnContextLost() {
if (binding_.is_bound())
binding_.Unbind();
compositor_frame_sink_.reset();
context_provider_->RemoveObserver(this);
context_provider_ = nullptr;
if (context_provider_) {
context_provider_->RemoveObserver(this);
context_provider_ = nullptr;
}
waiting_for_compositor_ack_ = false;
resource_provider_->OnContextLost();
// |compositor_frame_sink_| should be reset last.
compositor_frame_sink_.reset();
context_provider_callback_.Run(
base::BindOnce(&VideoFrameSubmitter::OnReceivedContextProvider,
weak_ptr_factory_.GetWeakPtr()));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment