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

viz: Allow recreating embedded frame sinks.

EmbeddedFrameSinkImpl enforced that it only created a
CompositorFrameSink one time. This doesn't work well with OOP-D and
isn't the approach taken for CompositorFrameSinks, so just remove that
condition. This will destroy the old CompositorFrameSinkImpl and create
a new CompositorFrameSinkImpl.

Bug: 768565
Change-Id: I7dcfdc35bd33fcb20544c22baa7417eaf84011b7
Reviewed-on: https://chromium-review.googlesource.com/1050436Reviewed-by: default avatarCJ DiMeglio <lethalantidote@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557153}
parent 5b755b07
...@@ -41,18 +41,17 @@ EmbeddedFrameSinkImpl::~EmbeddedFrameSinkImpl() { ...@@ -41,18 +41,17 @@ EmbeddedFrameSinkImpl::~EmbeddedFrameSinkImpl() {
void EmbeddedFrameSinkImpl::CreateCompositorFrameSink( void EmbeddedFrameSinkImpl::CreateCompositorFrameSink(
viz::mojom::CompositorFrameSinkClientPtr client, viz::mojom::CompositorFrameSinkClientPtr client,
viz::mojom::CompositorFrameSinkRequest request) { viz::mojom::CompositorFrameSinkRequest request) {
if (has_created_compositor_frame_sink_) { // We might recreate the CompositorFrameSink on context loss or GPU crash.
DLOG(ERROR) << "CreateCompositorFrameSink() called more than once."; // Only register frame sink hierarchy the first time.
return; if (!has_created_compositor_frame_sink_) {
} // The request to create an embedded frame sink and the lifetime of the
// parent are controlled by different IPC channels. It's possible the parent
// The request to create an embedded frame sink and the lifetime of the parent // FrameSinkId has been invalidated by the time this request has arrived. In
// are controlled by different IPC channels. It's possible the parent // that case, drop the request since there is no embedder.
// FrameSinkId has been invalidated by the time this request has arrived. In if (!host_frame_sink_manager_->RegisterFrameSinkHierarchy(
// that case, drop the request since there is no embedder. parent_frame_sink_id_, frame_sink_id_)) {
if (!host_frame_sink_manager_->RegisterFrameSinkHierarchy( return;
parent_frame_sink_id_, frame_sink_id_)) { }
return;
} }
host_frame_sink_manager_->CreateCompositorFrameSink( host_frame_sink_manager_->CreateCompositorFrameSink(
......
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