mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user