From 0abbedcdae9c29da3fffeb2aa7937083ea6cc728 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 8 Mar 2018 17:52:46 +0900 Subject: [PATCH] Fix error caused by refactor --- atom/browser/atom_browser_client.cc | 3 ++- atom/browser/web_contents_preferences.cc | 5 ----- atom/browser/web_contents_preferences.h | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/atom/browser/atom_browser_client.cc b/atom/browser/atom_browser_client.cc index cf7cc2c96939..997d6a1bdb4f 100644 --- a/atom/browser/atom_browser_client.cc +++ b/atom/browser/atom_browser_client.cc @@ -174,7 +174,8 @@ void AtomBrowserClient::RenderProcessWillLaunch( new WidevineCdmMessageFilter(process_id, host->GetBrowserContext())); ProcessPreferences prefs; - auto* web_preferences = WebContentsPreferences::From(process_id); + auto* web_preferences = WebContentsPreferences::From( + GetWebContentsFromProcessID(process_id)); if (web_preferences) { prefs.sandbox = web_preferences->IsEnabled("sandbox"); prefs.native_window_open = web_preferences->IsEnabled("nativeWindowOpen"); diff --git a/atom/browser/web_contents_preferences.cc b/atom/browser/web_contents_preferences.cc index 8a081b6039b9..37bf27ff70fc 100644 --- a/atom/browser/web_contents_preferences.cc +++ b/atom/browser/web_contents_preferences.cc @@ -120,11 +120,6 @@ WebContentsPreferences* WebContentsPreferences::From( return FromWebContents(web_contents); } -// static -WebContentsPreferences* WebContentsPreferences::From(int process_id) { - return From(GetWebContentsFromProcessID(process_id)); -} - void WebContentsPreferences::AppendCommandLineSwitches( base::CommandLine* command_line) { bool b; diff --git a/atom/browser/web_contents_preferences.h b/atom/browser/web_contents_preferences.h index c44fa0b46046..f08a614bf8c1 100644 --- a/atom/browser/web_contents_preferences.h +++ b/atom/browser/web_contents_preferences.h @@ -31,8 +31,6 @@ class WebContentsPreferences public: // Get self from WebContents. static WebContentsPreferences* From(content::WebContents* web_contents); - // Get self from procese ID. - static WebContentsPreferences* From(int process_id); WebContentsPreferences(content::WebContents* web_contents, const mate::Dictionary& web_preferences);