From 154cbea357fd29f08aaaeb123316c7c6658c685d Mon Sep 17 00:00:00 2001 From: Salman Date: Tue, 10 Jan 2023 18:07:20 +0000 Subject: [PATCH] Add RTC_EXPORT to symbols imported by CRD Bug: chromium:1291247 Change-Id: Ia7420f8305f1c52d255429c49e99f3b898534a60 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290660 Commit-Queue: Salman Malik Reviewed-by: Alexander Cooper Cr-Commit-Position: refs/heads/main@{#39061} --- .../linux/wayland/base_capturer_pipewire.h | 7 ++-- .../wayland/screen_capture_portal_interface.h | 2 +- .../linux/wayland/screencast_portal.h | 3 +- modules/portal/BUILD.gn | 1 + modules/portal/scoped_glib.cc | 7 ++++ modules/portal/scoped_glib.h | 11 ++++++ modules/portal/xdg_desktop_portal_utils.h | 36 ++++++++++--------- 7 files changed, 45 insertions(+), 22 deletions(-) diff --git a/modules/desktop_capture/linux/wayland/base_capturer_pipewire.h b/modules/desktop_capture/linux/wayland/base_capturer_pipewire.h index c5c122c14c..4b5cdc4a65 100644 --- a/modules/desktop_capture/linux/wayland/base_capturer_pipewire.h +++ b/modules/desktop_capture/linux/wayland/base_capturer_pipewire.h @@ -23,9 +23,10 @@ namespace webrtc { -class BaseCapturerPipeWire : public DesktopCapturer, - public DelegatedSourceListController, - public ScreenCastPortal::PortalNotifier { +class RTC_EXPORT BaseCapturerPipeWire + : public DesktopCapturer, + public DelegatedSourceListController, + public ScreenCastPortal::PortalNotifier { public: // Returns whether or not the current system can support capture via PipeWire. // This will only be true on Wayland systems that also have PipeWire diff --git a/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.h b/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.h index deb57a4707..7953c6470c 100644 --- a/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.h +++ b/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.h @@ -35,7 +35,7 @@ using SessionClosedSignalHandler = void (*)(GDBusConnection*, // Note: downstream clients inherit from this class so it is advisable to // provide a default implementation of any new virtual methods that may be added // to this class. -class ScreenCapturePortalInterface { +class RTC_EXPORT ScreenCapturePortalInterface { public: virtual ~ScreenCapturePortalInterface() {} // Gets details about the session such as session handle. diff --git a/modules/desktop_capture/linux/wayland/screencast_portal.h b/modules/desktop_capture/linux/wayland/screencast_portal.h index ffb198f387..37e55815e1 100644 --- a/modules/desktop_capture/linux/wayland/screencast_portal.h +++ b/modules/desktop_capture/linux/wayland/screencast_portal.h @@ -23,7 +23,8 @@ namespace webrtc { -class ScreenCastPortal : public xdg_portal::ScreenCapturePortalInterface { +class RTC_EXPORT ScreenCastPortal + : public xdg_portal::ScreenCapturePortalInterface { public: using ProxyRequestResponseHandler = void (*)(GObject* object, GAsyncResult* result, diff --git a/modules/portal/BUILD.gn b/modules/portal/BUILD.gn index 36bcb53e8e..8c837498b3 100644 --- a/modules/portal/BUILD.gn +++ b/modules/portal/BUILD.gn @@ -111,6 +111,7 @@ if ((is_linux || is_chromeos) && rtc_use_pipewire) { "../../rtc_base:checks", "../../rtc_base:logging", "../../rtc_base:sanitizer", + "../../rtc_base/system:rtc_export", ] absl_deps = [ "//third_party/abseil-cpp/absl/strings" ] diff --git a/modules/portal/scoped_glib.cc b/modules/portal/scoped_glib.cc index cb4c80526e..31ba8cb77a 100644 --- a/modules/portal/scoped_glib.cc +++ b/modules/portal/scoped_glib.cc @@ -12,6 +12,13 @@ namespace webrtc { +template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT) Scoped; +template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT) Scoped; +template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT) Scoped; +template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT) Scoped; +template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT) Scoped; +template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT) Scoped; + template <> Scoped::~Scoped() { if (ptr_) { diff --git a/modules/portal/scoped_glib.h b/modules/portal/scoped_glib.h index b2aaa2eb3a..d97e47ae1f 100644 --- a/modules/portal/scoped_glib.h +++ b/modules/portal/scoped_glib.h @@ -14,6 +14,7 @@ #include #include "rtc_base/checks.h" +#include "rtc_base/system/rtc_export_template.h" namespace webrtc { @@ -60,6 +61,16 @@ Scoped::~Scoped(); template <> Scoped::~Scoped(); +extern template class RTC_EXPORT_TEMPLATE_DECLARE(RTC_EXPORT) Scoped; +extern template class RTC_EXPORT_TEMPLATE_DECLARE(RTC_EXPORT) Scoped; +extern template class RTC_EXPORT_TEMPLATE_DECLARE(RTC_EXPORT) Scoped; +extern template class RTC_EXPORT_TEMPLATE_DECLARE( + RTC_EXPORT) Scoped; +extern template class RTC_EXPORT_TEMPLATE_DECLARE( + RTC_EXPORT) Scoped; +extern template class RTC_EXPORT_TEMPLATE_DECLARE( + RTC_EXPORT) Scoped; + } // namespace webrtc #endif // MODULES_PORTAL_SCOPED_GLIB_H_ diff --git a/modules/portal/xdg_desktop_portal_utils.h b/modules/portal/xdg_desktop_portal_utils.h index 8571c64a28..eff46a01ab 100644 --- a/modules/portal/xdg_desktop_portal_utils.h +++ b/modules/portal/xdg_desktop_portal_utils.h @@ -55,28 +55,30 @@ using SessionStartRequestedHandler = void (*)(GDBusProxy*, GAsyncResult*, gpointer); -std::string RequestResponseToString(RequestResponse request); +RTC_EXPORT std::string RequestResponseToString(RequestResponse request); RequestResponse RequestResponseFromPortalResponse(uint32_t portal_response); // Returns a string path for signal handle based on the provided connection and // token. -std::string PrepareSignalHandle(absl::string_view token, - GDBusConnection* connection); +RTC_EXPORT std::string PrepareSignalHandle(absl::string_view token, + GDBusConnection* connection); // Sets up the callback to execute when a response signal is received for the // given object. -uint32_t SetupRequestResponseSignal(absl::string_view object_path, - const GDBusSignalCallback callback, - gpointer user_data, - GDBusConnection* connection); +RTC_EXPORT uint32_t +SetupRequestResponseSignal(absl::string_view object_path, + const GDBusSignalCallback callback, + gpointer user_data, + GDBusConnection* connection); -void RequestSessionProxy(absl::string_view interface_name, - const ProxyRequestCallback proxy_request_callback, - GCancellable* cancellable, - gpointer user_data); +RTC_EXPORT void RequestSessionProxy( + absl::string_view interface_name, + const ProxyRequestCallback proxy_request_callback, + GCancellable* cancellable, + gpointer user_data); -void SetupSessionRequestHandlers( +RTC_EXPORT void SetupSessionRequestHandlers( absl::string_view portal_prefix, const SessionRequestCallback session_request_callback, const SessionRequestResponseSignalHandler request_response_signale_handler, @@ -87,7 +89,7 @@ void SetupSessionRequestHandlers( guint& session_request_signal_id, gpointer user_data); -void StartSessionRequest( +RTC_EXPORT void StartSessionRequest( absl::string_view prefix, absl::string_view session_handle, const StartRequestResponseSignalHandler signal_handler, @@ -100,10 +102,10 @@ void StartSessionRequest( gpointer user_data); // Tears down the portal session and cleans up related objects. -void TearDownSession(absl::string_view session_handle, - GDBusProxy* proxy, - GCancellable* cancellable, - GDBusConnection* connection); +RTC_EXPORT void TearDownSession(absl::string_view session_handle, + GDBusProxy* proxy, + GCancellable* cancellable, + GDBusConnection* connection); } // namespace xdg_portal } // namespace webrtc