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:
parent
e055ce7c39
commit
f5025b6246
7 changed files with 22 additions and 34 deletions
|
@ -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()) {
|
||||
|
|
|
@ -470,9 +470,6 @@ class WebContents final : public ExclusiveAccessContext,
|
|||
// mojom::ElectronWebContentsUtility
|
||||
void OnFirstNonEmptyLayout(content::RenderFrameHost* render_frame_host);
|
||||
void SetTemporaryZoomLevel(double level);
|
||||
void DoGetZoomLevel(
|
||||
electron::mojom::ElectronWebContentsUtility::DoGetZoomLevelCallback
|
||||
callback);
|
||||
|
||||
void SetImageAnimationPolicy(const std::string& new_policy);
|
||||
|
||||
|
|
|
@ -58,14 +58,6 @@ void ElectronWebContentsUtilityHandlerImpl::SetTemporaryZoomLevel(
|
|||
}
|
||||
}
|
||||
|
||||
void ElectronWebContentsUtilityHandlerImpl::DoGetZoomLevel(
|
||||
DoGetZoomLevelCallback callback) {
|
||||
api::WebContents* api_web_contents = api::WebContents::From(web_contents());
|
||||
if (api_web_contents) {
|
||||
api_web_contents->DoGetZoomLevel(std::move(callback));
|
||||
}
|
||||
}
|
||||
|
||||
void ElectronWebContentsUtilityHandlerImpl::CanAccessClipboardDeprecated(
|
||||
mojom::PermissionName name,
|
||||
const blink::LocalFrameToken& frame_token,
|
||||
|
|
|
@ -42,7 +42,6 @@ class ElectronWebContentsUtilityHandlerImpl
|
|||
// mojom::ElectronWebContentsUtility:
|
||||
void OnFirstNonEmptyLayout() override;
|
||||
void SetTemporaryZoomLevel(double level) override;
|
||||
void DoGetZoomLevel(DoGetZoomLevelCallback callback) override;
|
||||
void CanAccessClipboardDeprecated(
|
||||
mojom::PermissionName name,
|
||||
const blink::LocalFrameToken& frame_token,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue