From d27744f4552bdb363b9e0c8fb0db69fccd490651 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Mon, 18 Dec 2017 02:26:53 +0530 Subject: [PATCH] Some blink::WebSecurityPolicy methods should be invoked before other render threads are created --- atom/renderer/renderer_client_base.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/atom/renderer/renderer_client_base.cc b/atom/renderer/renderer_client_base.cc index f28099931f30..81bf0efd5377 100644 --- a/atom/renderer/renderer_client_base.cc +++ b/atom/renderer/renderer_client_base.cc @@ -113,6 +113,10 @@ void RendererClientBase::RenderThreadStarted() { blink::SchemeRegistry::RegisterURLSchemeAsSecure( WTF::String::FromUTF8(scheme.data(), scheme.length())); + // Allow file scheme to handle service worker by default. + // FIXME(zcbenz): Can this be moved elsewhere? + blink::WebSecurityPolicy::RegisterURLSchemeAsAllowingServiceWorkers("file"); + preferences_manager_.reset(new PreferencesManager); #if defined(OS_WIN) @@ -145,10 +149,6 @@ void RendererClientBase::RenderFrameCreated( new ContentSettingsObserver(render_frame); new printing::PrintWebViewHelper(render_frame); - // Allow file scheme to handle service worker by default. - // FIXME(zcbenz): Can this be moved elsewhere? - blink::WebSecurityPolicy::RegisterURLSchemeAsAllowingServiceWorkers("file"); - // This is required for widevine plugin detection provided during runtime. blink::ResetPluginCache();