From 753820840947ce8a074b32c1e672b9fb3909dad6 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 18 Nov 2024 10:49:12 -0500 Subject: [PATCH] cefclient: Fix accidental usage of C++20 map::contains (see #3611) --- tests/cefclient/browser/root_window_manager.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/cefclient/browser/root_window_manager.cc b/tests/cefclient/browser/root_window_manager.cc index 55689b856..455f6cb29 100644 --- a/tests/cefclient/browser/root_window_manager.cc +++ b/tests/cefclient/browser/root_window_manager.cc @@ -249,9 +249,10 @@ void RootWindowManager::OtherBrowserClosed(int browser_id, // Track ownership of popup browsers that don't have a RootWindow. if (opener_browser_id > 0) { - DCHECK(other_browser_owners_.contains(opener_browser_id)); + DCHECK(other_browser_owners_.find(opener_browser_id) != + other_browser_owners_.end()); auto& child_set = other_browser_owners_[opener_browser_id]; - DCHECK(child_set.contains(browser_id)); + DCHECK(child_set.find(browser_id) != child_set.end()); child_set.erase(browser_id); if (child_set.empty()) { other_browser_owners_.erase(opener_browser_id); @@ -313,7 +314,8 @@ void RootWindowManager::OnAbortOrClosePopup(int opener_browser_id, // Close all other associated popups if the opener is closing. These popups // don't have a RootWindow (e.g. when running with `--use-default-popup`). - if (popup_id < 0 && other_browser_owners_.contains(opener_browser_id)) { + if (popup_id < 0 && other_browser_owners_.find(opener_browser_id) != + other_browser_owners_.end()) { // Use a copy as the original set may be modified in OtherBrowserClosed // while iterating. auto set = other_browser_owners_[opener_browser_id];