Some blink::WebSecurityPolicy methods should be invoked before other render threads are created

This commit is contained in:
deepak1556 2017-12-18 02:26:53 +05:30 committed by Cheng Zhao
parent 0df464e16a
commit d27744f455

View file

@ -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();