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 <mbonadei@webrtc.org> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#40618}
This commit is contained in:
parent
394ed51669
commit
66bf3f472c
@ -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" ]
|
||||
}
|
||||
|
||||
@ -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<PendingTaskSafetyFlag> {
|
||||
public:
|
||||
static rtc::scoped_refptr<PendingTaskSafetyFlag> 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<PendingTaskSafetyFlag> 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(); }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user