Commit a2a6d99b authored by yjliu's avatar yjliu Committed by Commit Bot

Improve OverviewGrid::Shutdown efficiency.

Removing the items from the container one by one is inefficient, and at
shutting down, this can be done by emptying the container directly.

Bug: 1112835
Change-Id: Ib7529963763b1e772b6ba330eda3a3a3e2f6d380
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2340319Reviewed-by: default avatarJun Mukai <mukai@chromium.org>
Reviewed-by: default avatarSammie Quon <sammiequon@chromium.org>
Commit-Queue: Jun Liu <yjliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796153}
parent 84afbfbd
......@@ -699,8 +699,6 @@ TEST_F(OverviewControllerTest, FrameThrottling) {
OnThrottlingStarted(testing::UnorderedElementsAreArray(windows)));
controller->StartOverview();
EXPECT_CALL(observer, OnThrottlingStarted(::testing::_))
.Times(::testing::AnyNumber());
EXPECT_CALL(observer, OnThrottlingEnded());
controller->EndOverview();
frame_throttling_controller->RemoveObserver(&observer);
......
......@@ -402,12 +402,7 @@ void OverviewGrid::Shutdown() {
single_animation_in_clamshell, minimized_in_tablet);
}
while (!window_list_.empty()) {
RemoveItem(window_list_.back().get(), /*item_destroying=*/false,
/*reposition=*/false);
}
// RemoveItem() uses `overview_session_`, so clear it at the end.
window_list_.clear();
overview_session_ = nullptr;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment