(
x-post from #halp)
Hi all,
I'm trying to simplify RenderWidgetHostView visibility if possible - right now we control it largely through the WebContents (this is how the RWHV gets hidden when tabs get hidden, etc.), but also through RenderFrameHostManager which hides the view when a navigation starts and shows it when it commits. I would love to get to a place where we have one source of truth for whether the RWHV would
like to be visible (the RWHV still may not actually be visible for platform-specific reasons), as Hide/Show calls are
supposed to be symmetric (they are not today).
My main motivation here is that we now have kHiddenButPainting, which when set causes the RWHV to report that it's visible (when it isn't) and some security checks to ensure that the RenderFrameHost is actually visible break when we have a hidden capturer on the WebContents (eg. screenshotting for the tab switcher). I'd like to separate out the notions of visible and painting, but first I need to get a handle on visibility.
Specific questions:
Is this a dumb idea? Should we not rely on RWHV visibility to reflect actual visibility? Should we just do something like rename RenderFrameHost::GetVisibilityState to RenderFrameHost::IsRendering?
Why does the WebContents not always control the visibility (at least for non-guest RWHVs)? Is there a good reason for the WebContents to believe it's visible but the RWHV is hidden (could the WebContents itself not ensure consistency, rather than the RenderFrameHostManager?)?
Thanks for the help,
Michael