From 85a69f88f1e0956510697ad51cf03256b8185abf Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 2 Jul 2021 11:53:38 +0900 Subject: [PATCH] chore: remove unused _grantOriginAccess method (#29976) --- shell/browser/api/electron_api_web_contents.cc | 7 ------- shell/browser/api/electron_api_web_contents.h | 4 ---- 2 files changed, 11 deletions(-) diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index ab699312b21..ca645178536 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -3134,12 +3134,6 @@ content::RenderFrameHost* WebContents::MainFrame() { return web_contents()->GetMainFrame(); } -void WebContents::GrantOriginAccess(const GURL& url) { - content::ChildProcessSecurityPolicy::GetInstance()->GrantCommitOrigin( - web_contents()->GetMainFrame()->GetProcess()->GetID(), - url::Origin::Create(url)); -} - void WebContents::NotifyUserActivation() { content::RenderFrameHost* frame = web_contents()->GetMainFrame(); if (frame) @@ -3752,7 +3746,6 @@ v8::Local WebContents::FillObjectTemplate( &WebContents::SetWebRTCIPHandlingPolicy) .SetMethod("getWebRTCIPHandlingPolicy", &WebContents::GetWebRTCIPHandlingPolicy) - .SetMethod("_grantOriginAccess", &WebContents::GrantOriginAccess) .SetMethod("takeHeapSnapshot", &WebContents::TakeHeapSnapshot) .SetMethod("setImageAnimationPolicy", &WebContents::SetImageAnimationPolicy) diff --git a/shell/browser/api/electron_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h index 8c952eccb00..ea51a0c2ebd 100644 --- a/shell/browser/api/electron_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -310,10 +310,6 @@ class WebContents : public gin::Wrappable, // Returns the owner window. v8::Local GetOwnerBrowserWindow(v8::Isolate* isolate) const; - // Grants the child process the capability to access URLs with the origin of - // the specified URL. - void GrantOriginAccess(const GURL& url); - // Notifies the web page that there is user interaction. void NotifyUserActivation();