Use SelectionState as return type for TabStripModel::SelectionModel [chromium/src : main]

1 view
Skip to first unread message

Dominic Austria (Gerrit)

unread,
Dec 19, 2025, 1:45:12 AM12/19/25
to Eshwar Stalin, David Pennington, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from David Pennington and Eshwar Stalin

Dominic Austria added 1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Dominic Austria . resolved

I don't know if I want to merge this but I wanted to scope out the work of replacing the type of TSM::selection_model() to SelectionState. I think this CL illustrates the performance cost of having selection_model() generating and returning a copy to ui::ListSelectionModel(), at least to an eye better trained than mine.

Here are some interesting things to consider:

  • If you don't count test files and tab_strip_model.cc itself, there are 12 instances of TSM::list_selection_model() (new function that makes a ListSelectionModel from TSM::selection_model_ and selection_model()) and 40 calls to TSM::selection_model(). So I was able to replace about 3/4 of the calls to selection_model() with a SelectionState object.

-The places that I could not replace with a ListSelectionModel require more work or actually required a ListSelectionModel. If the caller was using TSM::selection_model().selected_indices(), and we had TSM with selection pointers enabled (ie the SelectionAdapter class is-a SelectionStateAdapter) then they already were doing a tree traversal to get the selected indices.

Open in Gerrit

Related details

Attention is currently required from:
  • David Pennington
  • Eshwar Stalin
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I438c19efc7a94c9b2a255a1d2fcf5b56104d1f1f
Gerrit-Change-Number: 7278837
Gerrit-PatchSet: 3
Gerrit-Owner: Dominic Austria <dominic...@google.com>
Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
Gerrit-Reviewer: Eshwar Stalin <est...@chromium.org>
Gerrit-Attention: David Pennington <dpen...@chromium.org>
Gerrit-Attention: Eshwar Stalin <est...@chromium.org>
Gerrit-Comment-Date: Fri, 19 Dec 2025 06:45:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Dominic Austria (Gerrit)

unread,
Dec 19, 2025, 1:46:01 AM12/19/25
to Eshwar Stalin, David Pennington, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org

Dominic Austria added 1 comment

Patchset-level comments
Dominic Austria . unresolved

I don't know if I want to merge this but I wanted to scope out the work of replacing the type of TSM::selection_model() to SelectionState. I think this CL illustrates the performance cost of having selection_model() generating and returning a copy to ui::ListSelectionModel(), at least to an eye better trained than mine.

Here are some interesting things to consider:

  • If you don't count test files and tab_strip_model.cc itself, there are 12 instances of TSM::list_selection_model() (new function that makes a ListSelectionModel from TSM::selection_model_ and selection_model()) and 40 calls to TSM::selection_model(). So I was able to replace about 3/4 of the calls to selection_model() with a SelectionState object.

-The places that I could not replace with a ListSelectionModel require more work or actually required a ListSelectionModel. If the caller was using TSM::selection_model().selected_indices(), and we had TSM with selection pointers enabled (ie the SelectionAdapter class is-a SelectionStateAdapter) then they already were doing a tree traversal to get the selected indices.

Dominic Austria

unresolving for visibility

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I438c19efc7a94c9b2a255a1d2fcf5b56104d1f1f
    Gerrit-Change-Number: 7278837
    Gerrit-PatchSet: 3
    Gerrit-Owner: Dominic Austria <dominic...@google.com>
    Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
    Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
    Gerrit-Reviewer: Eshwar Stalin <est...@chromium.org>
    Gerrit-Comment-Date: Fri, 19 Dec 2025 06:45:38 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dominic Austria <dominic...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dominic Austria (Gerrit)

    unread,
    Dec 19, 2025, 1:59:16 AM12/19/25
    to Eshwar Stalin, David Pennington, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Dominic Austria

    Dominic Austria voted and added 1 comment

    Votes added by Dominic Austria

    Commit-Queue+1

    1 comment

    File chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
    Line 212, Patchset 3 (Latest):ui::ListSelectionModel BrowserTabStripController::GetSelectionModel() const {
    Dominic Austria . unresolved

    Changing the type of this to SelectionState is its own CL and I think would be a good change to make less copies.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dominic Austria
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I438c19efc7a94c9b2a255a1d2fcf5b56104d1f1f
    Gerrit-Change-Number: 7278837
    Gerrit-PatchSet: 3
    Gerrit-Owner: Dominic Austria <dominic...@google.com>
    Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
    Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
    Gerrit-Reviewer: Eshwar Stalin <est...@chromium.org>
    Gerrit-Attention: Dominic Austria <dominic...@google.com>
    Gerrit-Comment-Date: Fri, 19 Dec 2025 06:59:04 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    David Pennington (Gerrit)

    unread,
    Jan 5, 2026, 11:40:05 AM (4 days ago) Jan 5
    to Dominic Austria, Eshwar Stalin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Dominic Austria

    David Pennington added 5 comments

    File chrome/browser/ui/browser_commands.cc
    Line 1309, Patchset 5 (Latest): MoveTabsToNewWindow(browser,
    David Pennington . unresolved

    lets add a TODO to move this function to use TabInterface* isntead of indices

    File chrome/browser/ui/tabs/tab_list_bridge.cc
    Line 153, Patchset 5 (Latest): selection_state.AddTabToSelection(active_tab);
    David Pennington . unresolved

    does SetActiveTab already perform this action?

    File chrome/browser/ui/tabs/tab_menu_model.cc
    Line 91, Patchset 5 (Latest): *tab_strip->list_selection_model().selected_indices().begin() != 0)) {
    David Pennington . unresolved

    this is really expensive for what is basically checking if the first tab in the selection model is selected. lets rewrite this check to get tab at index 0 and then ask if its selected.

    File chrome/browser/ui/tabs/tab_strip_model.h
    Line 575, Patchset 5 (Latest): ui::ListSelectionModel list_selection_model() const;
    David Pennington . unresolved

    we should put a TODO to remove these callsites (or name this function "Deprecated" or passkey it so that you cant add more callsites)

    File chrome/browser/ui/views/tabs/dragging/tab_drag_controller.cc
    Line 1446, Patchset 5 (Latest): for (int dragged_index :
    David Pennington . unresolved

    lets add a TODO to get rid of this callsite, this is one that is under our ownership but it shouldnt be done in this CL.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dominic Austria
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I438c19efc7a94c9b2a255a1d2fcf5b56104d1f1f
    Gerrit-Change-Number: 7278837
    Gerrit-PatchSet: 5
    Gerrit-Owner: Dominic Austria <dominic...@google.com>
    Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
    Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
    Gerrit-Reviewer: Eshwar Stalin <est...@chromium.org>
    Gerrit-Attention: Dominic Austria <dominic...@google.com>
    Gerrit-Comment-Date: Mon, 05 Jan 2026 16:39:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Eshwar Stalin (Gerrit)

    unread,
    Jan 5, 2026, 12:47:44 PM (4 days ago) Jan 5
    to Dominic Austria, David Pennington, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Dominic Austria

    Eshwar Stalin added 2 comments

    File chrome/browser/ui/browser_commands.cc
    Line 1309, Patchset 5 (Latest): MoveTabsToNewWindow(browser,
    David Pennington . unresolved

    lets add a TODO to move this function to use TabInterface* isntead of indices

    Eshwar Stalin

    I would just track all existing usage of list selection model and remove the dependency as part of that, than adding TODOs. That feels more trackable approach to address this.

    File chrome/browser/ui/tabs/tab_strip_model.h
    Line 575, Patchset 5 (Latest): ui::ListSelectionModel list_selection_model() const;
    Eshwar Stalin . unresolved

    Can we have callers use selection_model() and call GetListSelectionModel() instead? Also have a tracking bug to remove this function and update all callers in a phased manner.

    Gerrit-Comment-Date: Mon, 05 Jan 2026 17:47:18 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: David Pennington <dpen...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dominic Austria (Gerrit)

    unread,
    Jan 5, 2026, 2:26:45 PM (4 days ago) Jan 5
    to Eshwar Stalin, David Pennington, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from David Pennington, Dominic Austria and Eshwar Stalin

    Message from Dominic Austria

    Set Ready For Review

    Open in Gerrit

    Related details

    Attention is currently required from:
    • David Pennington
    • Dominic Austria
    • Eshwar Stalin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I438c19efc7a94c9b2a255a1d2fcf5b56104d1f1f
    Gerrit-Change-Number: 7278837
    Gerrit-PatchSet: 5
    Gerrit-Owner: Dominic Austria <dominic...@google.com>
    Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
    Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
    Gerrit-Reviewer: Eshwar Stalin <est...@chromium.org>
    Gerrit-Attention: Dominic Austria <dominic...@google.com>
    Gerrit-Attention: David Pennington <dpen...@chromium.org>
    Gerrit-Attention: Eshwar Stalin <est...@chromium.org>
    Gerrit-Comment-Date: Mon, 05 Jan 2026 19:26:39 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dominic Austria (Gerrit)

    unread,
    Jan 5, 2026, 3:03:38 PM (4 days ago) Jan 5
    to Eshwar Stalin, David Pennington, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from David Pennington and Eshwar Stalin

    Dominic Austria added 5 comments

    File chrome/browser/ui/browser_commands.cc
    Line 1309, Patchset 5 (Latest): MoveTabsToNewWindow(browser,
    David Pennington . unresolved

    lets add a TODO to move this function to use TabInterface* isntead of indices

    Eshwar Stalin

    I would just track all existing usage of list selection model and remove the dependency as part of that, than adding TODOs. That feels more trackable approach to address this.

    Dominic Austria

    Do you mean to track all these usages as a bug?

    File chrome/browser/ui/tabs/tab_list_bridge.cc
    Line 153, Patchset 5 (Latest): selection_state.AddTabToSelection(active_tab);
    David Pennington . unresolved

    does SetActiveTab already perform this action?

    Dominic Austria

    Yes my bad

    Line 153, Patchset 5 (Latest): selection_state.AddTabToSelection(active_tab);
    David Pennington . unresolved

    does SetActiveTab already perform this action?

    Dominic Austria

    Yes my bad

    File chrome/browser/ui/tabs/tab_strip_model.h
    Line 575, Patchset 5 (Latest): ui::ListSelectionModel list_selection_model() const;
    Eshwar Stalin . unresolved

    Can we have callers use selection_model() and call GetListSelectionModel() instead? Also have a tracking bug to remove this function and update all callers in a phased manner.

    Dominic Austria

    TSMSS::GetListSelectionModel() is passkeyed to TabStripModel. I can remove that passkey so that it can be used in other places.

    File chrome/browser/ui/views/tabs/dragging/tab_drag_controller.cc
    Line 1446, Patchset 5 (Latest): for (int dragged_index :
    David Pennington . unresolved

    lets add a TODO to get rid of this callsite, this is one that is under our ownership but it shouldnt be done in this CL.

    Dominic Austria

    Got it. Yes this file is pretty complicated as someone who hasnt much experience with it so it will take me some time. but drag seems like something where indices of selected tabs are necessary.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • David Pennington
    • Eshwar Stalin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I438c19efc7a94c9b2a255a1d2fcf5b56104d1f1f
    Gerrit-Change-Number: 7278837
    Gerrit-PatchSet: 5
    Gerrit-Owner: Dominic Austria <dominic...@google.com>
    Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
    Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
    Gerrit-Reviewer: Eshwar Stalin <est...@chromium.org>
    Gerrit-Attention: David Pennington <dpen...@chromium.org>
    Gerrit-Attention: Eshwar Stalin <est...@chromium.org>
    Gerrit-Comment-Date: Mon, 05 Jan 2026 20:03:33 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: David Pennington <dpen...@chromium.org>
    Comment-In-Reply-To: Eshwar Stalin <est...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Eshwar Stalin (Gerrit)

    unread,
    Jan 5, 2026, 4:25:44 PM (4 days ago) Jan 5
    to Dominic Austria, David Pennington, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from David Pennington and Dominic Austria

    Eshwar Stalin added 1 comment

    File chrome/browser/ui/tabs/tab_strip_model.h
    Line 575, Patchset 5 (Latest): ui::ListSelectionModel list_selection_model() const;
    Eshwar Stalin . unresolved

    Can we have callers use selection_model() and call GetListSelectionModel() instead? Also have a tracking bug to remove this function and update all callers in a phased manner.

    Dominic Austria

    TSMSS::GetListSelectionModel() is passkeyed to TabStripModel. I can remove that passkey so that it can be used in other places.

    Eshwar Stalin

    Yup I think that can be exposed directly to clients. At think the end state is to remove the function. But we can use callers of them as proxy of knowing how much migration is left to be done.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • David Pennington
    • Dominic Austria
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I438c19efc7a94c9b2a255a1d2fcf5b56104d1f1f
    Gerrit-Change-Number: 7278837
    Gerrit-PatchSet: 5
    Gerrit-Owner: Dominic Austria <dominic...@google.com>
    Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
    Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
    Gerrit-Reviewer: Eshwar Stalin <est...@chromium.org>
    Gerrit-Attention: Dominic Austria <dominic...@google.com>
    Gerrit-Attention: David Pennington <dpen...@chromium.org>
    Gerrit-Comment-Date: Mon, 05 Jan 2026 21:25:32 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dominic Austria <dominic...@google.com>
    Comment-In-Reply-To: Eshwar Stalin <est...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    David Pennington (Gerrit)

    unread,
    Jan 6, 2026, 12:32:28 PM (3 days ago) Jan 6
    to Dominic Austria, Eshwar Stalin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from Dominic Austria and Eshwar Stalin

    David Pennington added 1 comment

    File chrome/browser/ui/browser_commands.cc
    Line 1309, Patchset 5 (Latest): MoveTabsToNewWindow(browser,
    David Pennington . resolved

    lets add a TODO to move this function to use TabInterface* isntead of indices

    Eshwar Stalin

    I would just track all existing usage of list selection model and remove the dependency as part of that, than adding TODOs. That feels more trackable approach to address this.

    Dominic Austria

    Do you mean to track all these usages as a bug?

    David Pennington

    yes lets track this in a bug, and use that bug to attach CLs to.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dominic Austria
    • Eshwar Stalin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I438c19efc7a94c9b2a255a1d2fcf5b56104d1f1f
    Gerrit-Change-Number: 7278837
    Gerrit-PatchSet: 5
    Gerrit-Owner: Dominic Austria <dominic...@google.com>
    Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
    Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
    Gerrit-Reviewer: Eshwar Stalin <est...@chromium.org>
    Gerrit-Attention: Dominic Austria <dominic...@google.com>
    Gerrit-Attention: Eshwar Stalin <est...@chromium.org>
    Gerrit-Comment-Date: Tue, 06 Jan 2026 17:32:18 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dominic Austria <dominic...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dominic Austria (Gerrit)

    unread,
    Jan 6, 2026, 4:50:43 PM (3 days ago) Jan 6
    to Eshwar Stalin, David Pennington, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from David Pennington and Eshwar Stalin

    Dominic Austria voted and added 7 comments

    Votes added by Dominic Austria

    Commit-Queue+1

    7 comments

    Patchset-level comments
    File-level comment, Patchset 3:
    Dominic Austria . resolved

    I don't know if I want to merge this but I wanted to scope out the work of replacing the type of TSM::selection_model() to SelectionState. I think this CL illustrates the performance cost of having selection_model() generating and returning a copy to ui::ListSelectionModel(), at least to an eye better trained than mine.

    Here are some interesting things to consider:

    • If you don't count test files and tab_strip_model.cc itself, there are 12 instances of TSM::list_selection_model() (new function that makes a ListSelectionModel from TSM::selection_model_ and selection_model()) and 40 calls to TSM::selection_model(). So I was able to replace about 3/4 of the calls to selection_model() with a SelectionState object.

    -The places that I could not replace with a ListSelectionModel require more work or actually required a ListSelectionModel. If the caller was using TSM::selection_model().selected_indices(), and we had TSM with selection pointers enabled (ie the SelectionAdapter class is-a SelectionStateAdapter) then they already were doing a tree traversal to get the selected indices.

    Dominic Austria

    unresolving for visibility

    Dominic Austria

    Done

    File chrome/browser/ui/tabs/tab_list_bridge.cc
    Line 153, Patchset 5: selection_state.AddTabToSelection(active_tab);
    David Pennington . resolved

    does SetActiveTab already perform this action?

    Dominic Austria

    Yes my bad

    Dominic Austria

    After the recent tab strip model changes I think it is safe to make SetActiveTab also add the active tab to the selected tabs.

    File chrome/browser/ui/tabs/tab_menu_model.cc
    Line 91, Patchset 5: *tab_strip->list_selection_model().selected_indices().begin() != 0)) {
    David Pennington . resolved

    this is really expensive for what is basically checking if the first tab in the selection model is selected. lets rewrite this check to get tab at index 0 and then ask if its selected.

    Dominic Austria

    Done

    File chrome/browser/ui/tabs/tab_strip_model.h
    Line 575, Patchset 5: ui::ListSelectionModel list_selection_model() const;
    Eshwar Stalin . resolved

    Can we have callers use selection_model() and call GetListSelectionModel() instead? Also have a tracking bug to remove this function and update all callers in a phased manner.

    Dominic Austria

    TSMSS::GetListSelectionModel() is passkeyed to TabStripModel. I can remove that passkey so that it can be used in other places.

    Eshwar Stalin

    Yup I think that can be exposed directly to clients. At think the end state is to remove the function. But we can use callers of them as proxy of knowing how much migration is left to be done.

    Dominic Austria

    Done

    Line 575, Patchset 5: ui::ListSelectionModel list_selection_model() const;
    David Pennington . unresolved

    we should put a TODO to remove these callsites (or name this function "Deprecated" or passkey it so that you cant add more callsites)

    Dominic Austria

    Added a TODO to remove the TabStripModelSelectionState::GetListSelectionModel() function. Is it possible that removing it entirely might be difficult, for the few places that actually need the indices?

    File chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
    Line 212, Patchset 3:ui::ListSelectionModel BrowserTabStripController::GetSelectionModel() const {
    Dominic Austria . resolved

    Changing the type of this to SelectionState is its own CL and I think would be a good change to make less copies.

    Dominic Austria

    Put a TODO for this

    File chrome/browser/ui/views/tabs/dragging/tab_drag_controller.cc
    Line 1446, Patchset 5: for (int dragged_index :
    David Pennington . resolved

    lets add a TODO to get rid of this callsite, this is one that is under our ownership but it shouldnt be done in this CL.

    Dominic Austria

    Got it. Yes this file is pretty complicated as someone who hasnt much experience with it so it will take me some time. but drag seems like something where indices of selected tabs are necessary.

    Dominic Austria

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • David Pennington
    • Eshwar Stalin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I438c19efc7a94c9b2a255a1d2fcf5b56104d1f1f
    Gerrit-Change-Number: 7278837
    Gerrit-PatchSet: 9
    Gerrit-Owner: Dominic Austria <dominic...@google.com>
    Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
    Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
    Gerrit-Reviewer: Eshwar Stalin <est...@chromium.org>
    Gerrit-Attention: David Pennington <dpen...@chromium.org>
    Gerrit-Attention: Eshwar Stalin <est...@chromium.org>
    Gerrit-Comment-Date: Tue, 06 Jan 2026 21:50:37 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Eshwar Stalin (Gerrit)

    unread,
    Jan 6, 2026, 11:58:01 PM (2 days ago) Jan 6
    to Dominic Austria, David Pennington, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
    Attention needed from David Pennington and Dominic Austria

    Eshwar Stalin voted and added 1 comment

    Votes added by Eshwar Stalin

    Code-Review+1

    1 comment

    File chrome/browser/ui/tabs/tab_strip_model.h
    Line 575, Patchset 5: ui::ListSelectionModel list_selection_model() const;
    David Pennington . unresolved

    we should put a TODO to remove these callsites (or name this function "Deprecated" or passkey it so that you cant add more callsites)

    Dominic Austria

    Added a TODO to remove the TabStripModelSelectionState::GetListSelectionModel() function. Is it possible that removing it entirely might be difficult, for the few places that actually need the indices?

    Eshwar Stalin

    Feels reasonable to me.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • David Pennington
    • Dominic Austria
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I438c19efc7a94c9b2a255a1d2fcf5b56104d1f1f
      Gerrit-Change-Number: 7278837
      Gerrit-PatchSet: 10
      Gerrit-Owner: Dominic Austria <dominic...@google.com>
      Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
      Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
      Gerrit-Reviewer: Eshwar Stalin <est...@chromium.org>
      Gerrit-Attention: Dominic Austria <dominic...@google.com>
      Gerrit-Attention: David Pennington <dpen...@chromium.org>
      Gerrit-Comment-Date: Wed, 07 Jan 2026 04:57:47 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      David Pennington (Gerrit)

      unread,
      Jan 7, 2026, 11:14:54 AM (2 days ago) Jan 7
      to Dominic Austria, Eshwar Stalin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
      Attention needed from Dominic Austria

      David Pennington voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dominic Austria
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I438c19efc7a94c9b2a255a1d2fcf5b56104d1f1f
      Gerrit-Change-Number: 7278837
      Gerrit-PatchSet: 10
      Gerrit-Owner: Dominic Austria <dominic...@google.com>
      Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
      Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
      Gerrit-Reviewer: Eshwar Stalin <est...@chromium.org>
      Gerrit-Attention: Dominic Austria <dominic...@google.com>
      Gerrit-Comment-Date: Wed, 07 Jan 2026 16:14:41 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      David Pennington (Gerrit)

      unread,
      Jan 7, 2026, 11:17:20 AM (2 days ago) Jan 7
      to Dominic Austria, Eshwar Stalin, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
      Attention needed from Dominic Austria

      David Pennington added 1 comment

      File chrome/browser/ui/tabs/tab_strip_model.h
      Line 575, Patchset 5: ui::ListSelectionModel list_selection_model() const;
      David Pennington . resolved

      we should put a TODO to remove these callsites (or name this function "Deprecated" or passkey it so that you cant add more callsites)

      Dominic Austria

      Added a TODO to remove the TabStripModelSelectionState::GetListSelectionModel() function. Is it possible that removing it entirely might be difficult, for the few places that actually need the indices?

      Eshwar Stalin

      Feels reasonable to me.

      David Pennington

      yes i agree we probably wont be able to get rid of all cases yet, but when we do need indices (probably only extensions/dragging) we could compute them at the callsite or provide a helper method for them and not return a list selection model.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dominic Austria
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I438c19efc7a94c9b2a255a1d2fcf5b56104d1f1f
        Gerrit-Change-Number: 7278837
        Gerrit-PatchSet: 10
        Gerrit-Owner: Dominic Austria <dominic...@google.com>
        Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
        Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
        Gerrit-Reviewer: Eshwar Stalin <est...@chromium.org>
        Gerrit-Attention: Dominic Austria <dominic...@google.com>
        Gerrit-Comment-Date: Wed, 07 Jan 2026 16:17:06 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Dominic Austria <dominic...@google.com>
        Comment-In-Reply-To: David Pennington <dpen...@chromium.org>
        Comment-In-Reply-To: Eshwar Stalin <est...@chromium.org>
        satisfied_requirement
        open
        diffy

        Eshwar Stalin (Gerrit)

        unread,
        Jan 8, 2026, 4:42:47 PM (18 hours ago) Jan 8
        to Dominic Austria, David Pennington, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
        Attention needed from David Pennington and Dominic Austria

        Eshwar Stalin voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • David Pennington
        • Dominic Austria
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I438c19efc7a94c9b2a255a1d2fcf5b56104d1f1f
        Gerrit-Change-Number: 7278837
        Gerrit-PatchSet: 14
        Gerrit-Owner: Dominic Austria <dominic...@google.com>
        Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
        Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
        Gerrit-Reviewer: Eshwar Stalin <est...@chromium.org>
        Gerrit-Attention: Dominic Austria <dominic...@google.com>
        Gerrit-Attention: David Pennington <dpen...@chromium.org>
        Gerrit-Comment-Date: Thu, 08 Jan 2026 21:42:38 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Dominic Austria (Gerrit)

        unread,
        Jan 8, 2026, 5:09:36 PM (17 hours ago) Jan 8
        to Eshwar Stalin, David Pennington, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
        Attention needed from David Pennington

        Dominic Austria voted Commit-Queue+2

        Commit-Queue+2
        Open in Gerrit

        Related details

        Attention is currently required from:
        • David Pennington
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I438c19efc7a94c9b2a255a1d2fcf5b56104d1f1f
        Gerrit-Change-Number: 7278837
        Gerrit-PatchSet: 14
        Gerrit-Owner: Dominic Austria <dominic...@google.com>
        Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
        Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
        Gerrit-Reviewer: Eshwar Stalin <est...@chromium.org>
        Gerrit-Attention: David Pennington <dpen...@chromium.org>
        Gerrit-Comment-Date: Thu, 08 Jan 2026 22:09:27 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Chromium LUCI CQ (Gerrit)

        unread,
        Jan 8, 2026, 5:12:41 PM (17 hours ago) Jan 8
        to Dominic Austria, Eshwar Stalin, David Pennington, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org

        Chromium LUCI CQ submitted the change

        Change information

        Commit message:
        Use SelectionState as return type for TabStripModel::SelectionModel
        Bug: 435178910
        Change-Id: I438c19efc7a94c9b2a255a1d2fcf5b56104d1f1f
        Commit-Queue: Dominic Austria <dominic...@google.com>
        Reviewed-by: Eshwar Stalin <est...@chromium.org>
        Cr-Commit-Position: refs/heads/main@{#1566543}
        Files:
        • M chrome/browser/extensions/api/tabs/tabs_api_unittest.cc
        • M chrome/browser/extensions/api/tabs/tabs_event_router_platform_delegate_non_android.cc
        • M chrome/browser/ui/browser_commands.cc
        • M chrome/browser/ui/browser_commands_browsertest.cc
        • M chrome/browser/ui/browser_tab_strip_tracker.cc
        • M chrome/browser/ui/tabs/existing_tab_group_sub_menu_model.cc
        • M chrome/browser/ui/tabs/existing_tab_group_sub_menu_model_browsertest.cc
        • M chrome/browser/ui/tabs/glic_tab_sub_menu_model.cc
        • M chrome/browser/ui/tabs/tab_list_bridge.cc
        • M chrome/browser/ui/tabs/tab_menu_model.cc
        • M chrome/browser/ui/tabs/tab_strip_model.cc
        • M chrome/browser/ui/tabs/tab_strip_model.h
        • M chrome/browser/ui/tabs/tab_strip_model_selection_state.cc
        • M chrome/browser/ui/tabs/tab_strip_model_selection_state.h
        • M chrome/browser/ui/tabs/tab_strip_model_selection_state_unittest.cc
        • M chrome/browser/ui/tabs/tab_strip_model_unittest.cc
        • M chrome/browser/ui/views/frame/browser_view_browsertest.cc
        • M chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
        • M chrome/browser/ui/views/tabs/dragging/dragging_tabs_session.cc
        • M chrome/browser/ui/views/tabs/dragging/tab_drag_controller.cc
        • M chrome/browser/ui/webui/tab_strip/tab_strip_page_handler.cc
        • M chrome/browser/ui/webui/tab_strip_internals/tab_strip_internals_util.cc
        Change size: L
        Delta: 22 files changed, 210 insertions(+), 150 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Eshwar Stalin
        Open in Gerrit
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: merged
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I438c19efc7a94c9b2a255a1d2fcf5b56104d1f1f
        Gerrit-Change-Number: 7278837
        Gerrit-PatchSet: 15
        Gerrit-Owner: Dominic Austria <dominic...@google.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: David Pennington <dpen...@chromium.org>
        Gerrit-Reviewer: Dominic Austria <dominic...@google.com>
        Gerrit-Reviewer: Eshwar Stalin <est...@chromium.org>
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages