Commit 22aa45b6 authored by danakj's avatar danakj Committed by Commit Bot

StopCompositor() when swapping out the RenderWidget in RenderFrameProxy

When RenderFrameProxy::CreateFrameProxy() is called, it will
1) Make a RenderFrameProxy
2) Make a WebRemoteFrame
3) Swap out the RenderWidget on the RenderView
4) Give the WebRemoteFrame to the RenderFrameProxy

This is called from RenderViewImpl::Initialize, or from an IPC from
the browser via Mojo to RenderThreadImpl::CreateFrameProxy.

In the latter case, it doesn't appear to remove the local main frame
from the RenderViewImpl/RenderWidget. This is done by the
browser destroying/detaching the main frame separately. But since
detaching sets the LocalFrame to nullptr but does not SwapOut the
RenderWidget, this call is required in RenderFrameProxy to do the
SwapOut. At that time we should also stop the compositor.

R=piman@chromium.org

Change-Id: I24da561e14eea0e23e7e16d0af38f95279a27ed2
Bug: 896836
Reviewed-on: https://chromium-review.googlesource.com/c/1335661Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608445}
parent 9b70b9c6
...@@ -146,8 +146,13 @@ RenderFrameProxy* RenderFrameProxy::CreateFrameProxy( ...@@ -146,8 +146,13 @@ RenderFrameProxy* RenderFrameProxy::CreateFrameProxy(
// be updated, as the OnSwapOut flow which normally does this won't happen // be updated, as the OnSwapOut flow which normally does this won't happen
// in that case. See https://crbug.com/653746 and // in that case. See https://crbug.com/653746 and
// https://crbug.com/651980. // https://crbug.com/651980.
if (!render_widget->is_swapped_out()) if (!render_widget->is_swapped_out()) {
// TODO(crbug.com/419087): The RenderWidget should be destroyed as a
// result of the frame going away, previously. Then we won't have to do
// this.
render_widget->StopCompositor();
render_widget->SetSwappedOut(true); render_widget->SetSwappedOut(true);
}
} else { } else {
// Create a frame under an existing parent. The parent is always expected // Create a frame under an existing parent. The parent is always expected
// to be a RenderFrameProxy, because navigations initiated by local frames // to be a RenderFrameProxy, because navigations initiated by local frames
......
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