fix: avoid IPC for renderer webFrame.getZoom... APIs (#45499)

* fix: avoid IPC for renderer `webFrame.getZoom...` APIs

* Remove `DoGetZoomLevel` IPC

* Fix synchronous behavior & nullptr deref

* Use local root
This commit is contained in:
Calvin 2025-02-10 14:09:11 -07:00 committed by GitHub
parent e055ce7c39
commit f5025b6246
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 22 additions and 34 deletions

View file

@ -3693,12 +3693,6 @@ void WebContents::SetTemporaryZoomLevel(double level) {
zoom_controller_->SetTemporaryZoomLevel(level);
}
void WebContents::DoGetZoomLevel(
electron::mojom::ElectronWebContentsUtility::DoGetZoomLevelCallback
callback) {
std::move(callback).Run(GetZoomLevel());
}
std::optional<PreloadScript> WebContents::GetPreloadScript() const {
if (auto* web_preferences = WebContentsPreferences::From(web_contents())) {
if (auto preload = web_preferences->GetPreloadPath()) {