commit | b4e7085dbb187c4c67f1252f4a555ad04edea084 | [log] [tgz] |
---|---|---|
author | Brett Wilson <brettw@google.com> | Mon Oct 21 02:33:49 2024 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Oct 21 02:33:49 2024 |
tree | 7990e99da7fb044bf58a61bbb3ea106ac104e852 | |
parent | 13d921045512f99576d3e0026ceda41a05e92b74 [diff] |
Convert GetTabById to WindowController. Replace the Browser* output parameter of GetTabById() and GetGroupById() with the extensions::WindowController object. This cross-platform object is more portable. Callers that still need a Browser object are updated to access it via the WindowController()->GetBrowser() method. The TabStripModel is accessed in the same way. The TabStringModel output parameter is removed. Most callers do not need this value, it's not portable, and it's trivially accessible via the Browser object when needed. Update GetTabById() to set the output values to null/-1 at the beginning. Previously, in the error or prerender case (contrary to the function documentation) these would be left unset by this function. This should not have been an issue in practice because I believe all callers pre-initialized these values to null. GetTabById() can return a null window (formerly Browser) for prerender tabs. This was added more recently. This patch adds checking for that condition for callers that dereference the pointer. Some of these cases may have been obscure crashes (for example, in TabGroupFunction::Run). Reimplement ExtensionTabUtil::IsTabStringEditable() in terms of the WindowControllerList to avoid a dependency on Browser. Bug: b/361838438 Change-Id: Id6767b2be5963d57c1b55c4d544317558d85b932 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5860291 Reviewed-by: Emilia Paz <emiliapaz@chromium.org> Reviewed-by: Thomas Lukaszewicz <tluk@chromium.org> Commit-Queue: Brett Wilson <brettw@chromium.org> Cr-Commit-Position: refs/heads/main@{#1371170}
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.
To check out the source code locally, don't use git clone
! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.