From 78c5516711414ed8fd9b1b473a58b038b4a80279 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Fri, 5 Feb 2021 10:56:48 +0100 Subject: Enable webrtc logging and the corresponding WebUI The corresponding WebUI is chrome://webrtc-logs It only makes sense with the hangout services extension. It seems to be only useable with meet.google.com. The behavior is same for Chrome. Uploading logs to Google is disabled in the Chromium patch. It is an extension API functionality. The WebUI only lists the previously generated logs. Pulls in the following changes: 1dda5314b02 Enable webrtcLoggingPrivate extension API for hangout extension 7d71aca116d FIXUP: Enable webrtcLoggingPrivate extension API for hangout extension Change-Id: I455fce7c8081e71967e55ab1f889df6ef91ed253 Reviewed-by: Allan Sandfeld Jensen --- src/core/web_engine_context.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/core/web_engine_context.cpp') diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 5f3212374..863b46a57 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -52,6 +52,9 @@ #include "base/task/thread_pool/thread_pool_instance.h" #include "base/threading/thread_restrictions.h" #include "cc/base/switches.h" +#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions) +#include "chrome/browser/media/webrtc/webrtc_log_uploader.h" +#endif #include "chrome/common/chrome_switches.h" #include "content/gpu/gpu_child_thread.h" #include "content/browser/compositor/surface_utils.h" @@ -356,6 +359,10 @@ void WebEngineContext::destroy() if (m_devtoolsServer) m_devtoolsServer->stop(); +#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions) + if (m_webrtcLogUploader) + m_webrtcLogUploader->Shutdown(); +#endif base::MessagePump::Delegate *delegate = static_cast( @@ -413,6 +420,10 @@ void WebEngineContext::destroy() // Drop the false reference. m_handle->Release(); + +#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions) + m_webrtcLogUploader.reset(); +#endif } WebEngineContext::~WebEngineContext() @@ -841,6 +852,16 @@ printing::PrintJobManager* WebEngineContext::getPrintJobManager() } #endif +#if QT_CONFIG(webengine_webrtc) && QT_CONFIG(webengine_extensions) +WebRtcLogUploader *WebEngineContext::webRtcLogUploader() +{ + if (!m_webrtcLogUploader) + m_webrtcLogUploader = std::make_unique(); + return m_webrtcLogUploader.get(); +} +#endif + + static QMutex s_spmMutex; QAtomicPointer WebEngineContext::s_syncPointManager; -- cgit v1.2.3