From 66bf3f472c3cbf3872b77ff15c2b02bd1b3d88db Mon Sep 17 00:00:00 2001 From: Tommi Date: Thu, 24 Aug 2023 15:29:10 +0200 Subject: [PATCH] Make PendingTaskSafetyFlag compatible with component builds Bug: chromium:1470992 Change-Id: I06cec9cda36c9de75b970eaf709f9ed3b9f466b4 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/317620 Reviewed-by: Mirko Bonadei Commit-Queue: Tomas Gunnarsson Cr-Commit-Position: refs/heads/main@{#40618} --- api/task_queue/BUILD.gn | 1 + api/task_queue/pending_task_safety_flag.h | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/api/task_queue/BUILD.gn b/api/task_queue/BUILD.gn index 65bb1ae21b..527fac414b 100644 --- a/api/task_queue/BUILD.gn +++ b/api/task_queue/BUILD.gn @@ -130,6 +130,7 @@ rtc_library("pending_task_safety_flag") { "../../api:sequence_checker", "../../rtc_base:checks", "../../rtc_base/system:no_unique_address", + "../../rtc_base/system:rtc_export", ] absl_deps = [ "//third_party/abseil-cpp/absl/functional:any_invocable" ] } diff --git a/api/task_queue/pending_task_safety_flag.h b/api/task_queue/pending_task_safety_flag.h index 3b948ca8f1..7f6a592856 100644 --- a/api/task_queue/pending_task_safety_flag.h +++ b/api/task_queue/pending_task_safety_flag.h @@ -19,6 +19,7 @@ #include "api/sequence_checker.h" #include "rtc_base/checks.h" #include "rtc_base/system/no_unique_address.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -58,7 +59,7 @@ namespace webrtc { // // my_task_queue_->PostTask(SafeTask(safety_flag_, [this] { MyMethod(); })); // -class PendingTaskSafetyFlag final +class RTC_EXPORT PendingTaskSafetyFlag final : public rtc::RefCountedNonVirtual { public: static rtc::scoped_refptr Create(); @@ -116,7 +117,7 @@ class PendingTaskSafetyFlag final // This should be used by the class that wants tasks dropped after destruction. // The requirement is that the instance has to be constructed and destructed on // the same thread as the potentially dropped tasks would be running on. -class ScopedTaskSafety final { +class RTC_EXPORT ScopedTaskSafety final { public: ScopedTaskSafety() = default; explicit ScopedTaskSafety(rtc::scoped_refptr flag) @@ -140,7 +141,7 @@ class ScopedTaskSafety final { // Like ScopedTaskSafety, but allows construction on a different thread than // where the flag will be used. -class ScopedTaskSafetyDetached final { +class RTC_EXPORT ScopedTaskSafetyDetached final { public: ScopedTaskSafetyDetached() = default; ~ScopedTaskSafetyDetached() { flag_->SetNotAlive(); }