From 9739cc64c90e3852216f38fb15f04ba4477d0c39 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Tue, 24 Jan 2023 17:50:13 +0100 Subject: Move out GetInProcessGpuShareGroup form content browser client Keeping the GetInProcessGpuShareGroup in content browser client creates dependency from gpu_child_thread to content browser, however gn build tree asserts when content/public/gpu depends on content/public/browser as it breaks intended components dependency. This worked so far as required headers in content browser client got generated on time despite of missing dependency. Fix the dependency tree and move the problematic function into the content gpu client. Pick-to: 6.5 6.4 Change-Id: Iedcbc8c3c7d1754d1937e6b2c2a470c0e489a597 Reviewed-by: Allan Sandfeld Jensen --- src/core/compositor/content_gpu_client_qt.cpp | 9 ++++++++- src/core/compositor/content_gpu_client_qt.h | 9 +++++++++ src/core/content_browser_client_qt.cpp | 18 ------------------ src/core/content_browser_client_qt.h | 7 ------- 4 files changed, 17 insertions(+), 26 deletions(-) diff --git a/src/core/compositor/content_gpu_client_qt.cpp b/src/core/compositor/content_gpu_client_qt.cpp index 4c022dc7f..9f3b00bb8 100644 --- a/src/core/compositor/content_gpu_client_qt.cpp +++ b/src/core/compositor/content_gpu_client_qt.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "content_gpu_client_qt.h" - +#include "ozone/gl_share_context_qt.h" #include "web_engine_context.h" namespace QtWebEngineCore { @@ -20,4 +20,11 @@ gpu::SyncPointManager *ContentGpuClientQt::GetSyncPointManager() return WebEngineContext::syncPointManager(); } +gl::GLShareGroup *ContentGpuClientQt::GetInProcessGpuShareGroup() +{ + if (!m_shareGroupQt.get()) + m_shareGroupQt = new ShareGroupQt; + return m_shareGroupQt.get(); +} + } // namespace diff --git a/src/core/compositor/content_gpu_client_qt.h b/src/core/compositor/content_gpu_client_qt.h index 75d9d68be..150c257ae 100644 --- a/src/core/compositor/content_gpu_client_qt.h +++ b/src/core/compositor/content_gpu_client_qt.h @@ -5,7 +5,12 @@ #include "content/public/gpu/content_gpu_client.h" +namespace gl { +class GLShareGroup; +} + namespace QtWebEngineCore { +class ShareGroupQt; class ContentGpuClientQt : public content::ContentGpuClient { public: @@ -14,6 +19,10 @@ public: // content::ContentGpuClient implementation. gpu::SyncPointManager *GetSyncPointManager() override; + gl::GLShareGroup *GetInProcessGpuShareGroup() override; + +private: + scoped_refptr m_shareGroupQt; }; } diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index 553228ffc..77e234864 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -70,7 +70,6 @@ #include "net/proxying_restricted_cookie_manager_qt.h" #include "net/proxying_url_loader_factory_qt.h" #include "net/system_network_context_manager.h" -#include "ozone/gl_share_context_qt.h" #include "platform_notification_service_qt.h" #include "profile_qt.h" #include "profile_io_data_qt.h" @@ -88,11 +87,6 @@ #include "api/qwebenginecookiestore_p.h" #include "api/qwebengineurlrequestinfo_p.h" -#if QT_CONFIG(opengl) -#include -#include -#endif - #if QT_CONFIG(webengine_geolocation) #include "base/memory/ptr_util.h" #include "location_provider_qt.h" @@ -160,11 +154,6 @@ #include #include -#include - -QT_BEGIN_NAMESPACE -Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context(); -QT_END_NAMESPACE // Implement IsHandledProtocol as declared in //url/url_util_qt.h. namespace url { @@ -260,13 +249,6 @@ void ContentBrowserClientQt::RenderProcessWillLaunch(content::RenderProcessHost renderer_configuration->SetInitialConfiguration(is_incognito_process); } -gl::GLShareGroup *ContentBrowserClientQt::GetInProcessGpuShareGroup() -{ - if (!m_shareGroupQt.get()) - m_shareGroupQt = new ShareGroupQt; - return m_shareGroupQt.get(); -} - content::MediaObserver *ContentBrowserClientQt::GetMediaObserver() { return MediaCaptureDevicesDispatcher::GetInstance(); diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h index b81b96ce1..87e48db5a 100644 --- a/src/core/content_browser_client_qt.h +++ b/src/core/content_browser_client_qt.h @@ -28,14 +28,9 @@ namespace device { class GeolocationManager; } // namespace device -namespace gl { -class GLShareGroup; -} - namespace QtWebEngineCore { class BrowserMainPartsQt; -class ShareGroupQt; class ContentBrowserClientQt : public content::ContentBrowserClient { @@ -44,7 +39,6 @@ public: ~ContentBrowserClientQt(); std::unique_ptr CreateBrowserMainParts(bool is_integration_test) override; void RenderProcessWillLaunch(content::RenderProcessHost *host) override; - gl::GLShareGroup* GetInProcessGpuShareGroup() override; content::MediaObserver* GetMediaObserver() override; void OverrideWebkitPrefs(content::WebContents *web_contents, blink::web_pref::WebPreferences *prefs) override; @@ -240,7 +234,6 @@ public: std::string GetProduct() override; private: - scoped_refptr m_shareGroupQt; BrowserMainPartsQt *m_browserMainParts = nullptr; }; -- cgit v1.2.3