commit | c0d45b4c2553b63905fb4f4754e96b5eef372152 | [log] [tgz] |
---|---|---|
author | Aditya Keerthi <[email protected]> | Mon Feb 25 18:53:00 2019 |
committer | Commit Bot <[email protected]> | Mon Feb 25 18:53:00 2019 |
tree | 4431030aebfe5f01785efd91c2412ef955632256 | |
parent | 42956a5b32fdd1fd21272915b8bb6d9aceca435b [diff] |
Update renderer visibility state using IPC from the browser process Currently, RenderThreadImpl::RendererIsHidden() is implemented by keeping track of the total number and the number of hidden RenderWidgets in a renderer. If there is a non-zero amount of RenderWidgets and the two numbers are equal, RendererIsHidden() will return true. However, the current implementation is broken, as it does not account for the existence of inactive RenderWidgets. Inactive widgets refer to widgets that are created to support out-of-process iframes, but that do not represent actual widgets. These widgets exist with the sole purpose of maintaining state. Consequently, this widgets are never explicitly marked as hidden or visible, they are simply considered "frozen". This behaviour effects the implementation of RendererIsHidden(), as each time an inactive RenderWidget is created, the total number of RenderWidgets is incremented. However, those widgets will never be marked as hidden, and there will always be a difference between the total number and the number of hidden widgets. As a result, renderers that contain inactive widgets are incorrectly considered visible. Note that RenderProcessHostImpl already has information regarding a renderer's backgrounded and visibility state, using ChildProcessLauncherPriority. Rather than computing this information twice, we can forward the information from the browser process to the renderer process. The existing SetProcessBackgrounded IPC was modified to SetProcessState, now taking a RenderProcessState enum as a parameter. The process can be marked visible, hidden or backgrounded. Depending on the state transition, RenderThreadImpl calls OnRendererHidden, OnRendererVisible, OnRendererBackgrounded and OnRendererForegrounded at the appropriately. The new approach resolves a flaw in the current approach to determine renderer visibility and ensures that we have a single source of truth regarding a renderer's backgrounded and visibility state. Bug: 927440 Change-Id: Ib5aa60cd515443e17a0be691c211721caaf573ac Reviewed-on: https://chromium-review.googlesource.com/c/1448742 Commit-Queue: Aditya Keerthi <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Alexander Timin <[email protected]> Reviewed-by: François Doray <[email protected]> Reviewed-by: Alex Moshchuk <[email protected]> Reviewed-by: Gabriel Charette <[email protected]> Cr-Commit-Position: refs/heads/master@{#635182}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .