Android: Single TabUma instance per tab
TabUma is an optional Tab UserData object that keeps track of tab restoring/state transition event, and collects relevant UMA stats. It's instantiated only for the Tab with a notable creation state or restoration results. And a new TabUma object is created every time tab restoration fails, and replaces the old one. With this CL, TabUma is always instantiated upon Tab creation and lasts till the tab goes away. This comes at a cost of having an instance doing potentially no actual work but has a few benefits: - TabCreationState doesn't need to be passed to Tab any more. TabBuilder instantiates TabUma and does the required initialization. - TabUma-related tasks can be moved out of Tab and confined within TabUma class itself using TabObserver events. Now the restoration result is passed to a single TabUma per tab through TabObserver. A new test was added to make sure tab state transition works as expected before and after the CL. Bug: 995903 Change-Id: I8f59bf52542325da06129f76a4a32229cdd9dbb1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087861Reviewed-by:Ted Choc <tedchoc@chromium.org> Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org> Cr-Commit-Position: refs/heads/master@{#750865}
Showing
This diff is collapsed.
Please register or sign in to comment