Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Unified Diff: components/bubble/bubble_manager.cc

Issue 2640223004: Remove ScopedVector in //components/bubble. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/bubble/bubble_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/bubble/bubble_manager.cc
diff --git a/components/bubble/bubble_manager.cc b/components/bubble/bubble_manager.cc
index acb9e7f3b35a5536c5aec62029d1aa647bcbc7cb..bf15e87f30a0fb96de59b55bfcda15f7541cbc9b 100644
--- a/components/bubble/bubble_manager.cc
+++ b/components/bubble/bubble_manager.cc
@@ -67,7 +67,7 @@ void BubbleManager::UpdateAllBubbleAnchors() {
// Guard against bubbles being added or removed while iterating the bubbles.
ManagerState original_state = manager_state_;
manager_state_ = ITERATING_BUBBLES;
- for (auto* controller : controllers_)
+ for (auto& controller : controllers_)
controller->UpdateAnchorPosition();
manager_state_ = original_state;
}
@@ -106,23 +106,23 @@ bool BubbleManager::CloseAllMatchingBubbles(
// to close all bubbles, so we disallow passing both until a need appears.
DCHECK(!bubble || !owner);
- ScopedVector<BubbleController> close_queue;
+ std::vector<std::unique_ptr<BubbleController>> close_queue;
// Guard against bubbles being added or removed while iterating the bubbles.
ManagerState original_state = manager_state_;
manager_state_ = ITERATING_BUBBLES;
for (auto i = controllers_.begin(); i != controllers_.end();) {
- if ((!bubble || bubble == *i) && (!owner || (*i)->OwningFrameIs(owner)) &&
- (*i)->ShouldClose(reason)) {
- close_queue.push_back(*i);
- i = controllers_.weak_erase(i);
+ if ((!bubble || bubble == (*i).get()) &&
+ (!owner || (*i)->OwningFrameIs(owner)) && (*i)->ShouldClose(reason)) {
+ close_queue.push_back(std::move(*i));
+ i = controllers_.erase(i);
} else {
++i;
}
}
manager_state_ = original_state;
- for (auto* controller : close_queue) {
+ for (auto& controller : close_queue) {
controller->DoClose(reason);
for (auto& observer : observers_)
« no previous file with comments | « components/bubble/bubble_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698