From 245bc9bfabd5bc4e4ac25ca915a35194d1cafdfb Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 15 Apr 2020 21:26:27 -0400 Subject: [PATCH] Windows: Early init parental controls to avoid blocking assertions --- libcef/browser/browser_main.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libcef/browser/browser_main.cc b/libcef/browser/browser_main.cc index c65d85416..9aa105ca1 100644 --- a/libcef/browser/browser_main.cc +++ b/libcef/browser/browser_main.cc @@ -51,6 +51,7 @@ #if defined(OS_WIN) #include "chrome/browser/chrome_browser_main_win.h" +#include "chrome/browser/win/parental_controls.h" #include "components/os_crypt/os_crypt.h" #include "ui/base/cursor/cursor_loader_win.h" #endif @@ -200,8 +201,11 @@ void CefBrowserMainParts::PreMainMessageLoopRun() { CefDevToolsManagerDelegate::StartHttpHandler(browser_context); - // Initialize before IO access restrictions are applied. - content::GetNetworkService(); +#if defined(OS_WIN) + // Windows parental controls calls can be slow, so we do an early init here + // that calculates this value off of the UI thread. + InitializeWinParentalControls(); +#endif // Triggers initialization of the singleton instance on UI thread. PluginFinder::GetInstance()->Init();