Add CefTaskManager::GetTaskIdForBrowserId

Update https://tests/task_manager to show the current browser's
renderer task in bold.


Approved-by: Nik Pavlov
This commit is contained in:
Marshall Greenblatt
2024-07-19 15:19:06 +00:00
parent 3acdbac061
commit 69b884d39c
12 changed files with 122 additions and 11 deletions

View File

@@ -217,6 +217,23 @@ CefBrowserHostBase::GetBrowserForTopLevelNativeWindow(
return nullptr;
}
// static
CefRefPtr<CefBrowserHostBase> CefBrowserHostBase::GetBrowserForBrowserId(
int browser_id) {
DCHECK_GT(browser_id, 0);
for (const auto& browser_info :
CefBrowserInfoManager::GetInstance()->GetBrowserInfoList()) {
if (auto browser = browser_info->browser()) {
if (browser->GetIdentifier() == browser_id) {
return browser;
}
}
}
return nullptr;
}
// static
CefRefPtr<CefBrowserHostBase> CefBrowserHostBase::GetLikelyFocusedBrowser() {
CEF_REQUIRE_UIT();