Migrate remaining webrtc usage of TaskQueueBase to absl::AnyInvocable

Bug: webrtc:14245
Change-Id: I8de2c23da5fbdfc0b1efbbe07fb6e8de744424a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268191
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37565}
diff --git a/rtc_base/task_queue.h b/rtc_base/task_queue.h
index b2a08f8..d0c0551 100644
--- a/rtc_base/task_queue.h
+++ b/rtc_base/task_queue.h
@@ -21,7 +21,6 @@
 #include "api/task_queue/queued_task.h"
 #include "api/task_queue/task_queue_base.h"
 #include "api/task_queue/task_queue_factory.h"
-#include "api/task_queue/to_queued_task.h"
 #include "rtc_base/system/rtc_export.h"
 #include "rtc_base/thread_annotations.h"
 
@@ -93,22 +92,17 @@
   webrtc::TaskQueueBase* Get() { return impl_; }
 
   // TODO(tommi): For better debuggability, implement RTC_FROM_HERE.
-
-  // Ownership of the task is passed to PostTask.
-  void PostTask(std::unique_ptr<webrtc::QueuedTask> task);
-  // See webrtc::TaskQueueBase for precision expectations.
-  void PostDelayedTask(std::unique_ptr<webrtc::QueuedTask> task,
-                       uint32_t milliseconds);
-  void PostDelayedHighPrecisionTask(std::unique_ptr<webrtc::QueuedTask> task,
-                                    uint32_t milliseconds);
-  void PostDelayedTaskWithPrecision(
-      webrtc::TaskQueueBase::DelayPrecision precision,
-      std::unique_ptr<webrtc::QueuedTask> task,
-      uint32_t milliseconds);
-
   void PostTask(absl::AnyInvocable<void() &&> task) {
     impl_->PostTask(std::move(task));
   }
+  void PostDelayedTask(absl::AnyInvocable<void() &&> task,
+                       webrtc::TimeDelta delay) {
+    impl_->PostDelayedTask(std::move(task), delay);
+  }
+  void PostDelayedHighPrecisionTask(absl::AnyInvocable<void() &&> task,
+                                    webrtc::TimeDelta delay) {
+    impl_->PostDelayedHighPrecisionTask(std::move(task), delay);
+  }
 
  private:
   webrtc::TaskQueueBase* const impl_;