cefclient: Fix invalid cast to ClientHandlerStd (see #3499)

This commit is contained in:
Marshall Greenblatt
2024-08-05 18:30:39 -04:00
parent f6f4ba8317
commit 166eec85e0
13 changed files with 95 additions and 7 deletions

View File

@@ -19,6 +19,16 @@ ClientHandlerOsr::ClientHandlerOsr(Delegate* delegate,
DCHECK(osr_delegate_);
}
// static
CefRefPtr<ClientHandlerOsr> ClientHandlerOsr::GetForClient(
CefRefPtr<CefClient> client) {
auto base = BaseClientHandler::GetForClient(client);
if (base && base->GetTypeKey() == &kTypeKey) {
return static_cast<ClientHandlerOsr*>(base.get());
}
return nullptr;
}
void ClientHandlerOsr::DetachOsrDelegate() {
if (!CefCurrentlyOn(TID_UI)) {
// Execute this method on the UI thread.