summaryrefslogtreecommitdiffstats
path: root/src/core/web_engine_context.cpp
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2018-12-04 15:20:59 +0100
committerMichal Klocek <michal.klocek@qt.io>2018-12-04 16:02:17 +0000
commitb6683549626e5a0131a708842f555dd35d413b50 (patch)
treed8d0cfa9bda89b73739adcde049d97119d984a5f /src/core/web_engine_context.cpp
parent4b2ab1d0816683dd53311ecb719ac8ede0d5b327 (diff)
Fix recursion in WebEngineContext constructor
Gpu process startup needs sync point manager and it can ask for current web engine context, while is being created. Moreover this call will take place from GPU thread, so it leads to race condition. Done-With: Kirill Burtsev<kirill.burtsev@qt.io> Fixes: QTBUG-72113 Change-Id: I43bf37da0cf28ccb5c5cee0d82ed541053016e2e Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_engine_context.cpp')
-rw-r--r--src/core/web_engine_context.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index a1c647f40..0763b9dac 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -270,6 +270,8 @@ WebEngineContext *WebEngineContext::current()
qAddPostRoutine(WebEngineContext::destroyContextPostRoutine);
// Add a false reference so there is no race between unreferencing m_handle and a global QApplication.
m_handle->AddRef();
+ // This is need since gpu process start requires sync point manager;
+ m_handle->initialize();
}
return m_handle.get();
}
@@ -329,6 +331,9 @@ WebEngineContext::WebEngineContext()
: m_mainDelegate(new ContentMainDelegateQt)
, m_globalQObject(new QObject())
, m_syncPointManager(new gpu::SyncPointManager())
+{}
+
+void WebEngineContext::initialize()
{
base::TaskScheduler::Create("Browser");
m_contentRunner.reset(content::ContentMainRunner::Create());