From 2fa39bdfc98d1658144eaa6382a365b2c2a3506f Mon Sep 17 00:00:00 2001 From: Markus Handell Date: Wed, 1 Mar 2023 14:00:12 +0100 Subject: [PATCH] Implement support for Chrome task origin tracing. #3.8/4 This CL forwards TaskQueue locations to the contained task queue. Bug: chromium:1416199 Change-Id: I989ae445a67991bf5a857407135dbe8bacbd3c55 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295622 Reviewed-by: Harald Alvestrand Commit-Queue: Markus Handell Cr-Commit-Position: refs/heads/main@{#39446} --- rtc_base/task_queue.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/rtc_base/task_queue.h b/rtc_base/task_queue.h index cae95340bc..e52c49cf00 100644 --- a/rtc_base/task_queue.h +++ b/rtc_base/task_queue.h @@ -90,16 +90,22 @@ class RTC_LOCKABLE RTC_EXPORT TaskQueue { // Returns non-owning pointer to the task queue implementation. webrtc::TaskQueueBase* Get() { return impl_; } - void PostTask(absl::AnyInvocable task) { - impl_->PostTask(std::move(task)); + void PostTask( + absl::AnyInvocable task, + const webrtc::Location& location = webrtc::Location::Current()) { + impl_->PostTask(std::move(task), location); } - void PostDelayedTask(absl::AnyInvocable task, - webrtc::TimeDelta delay) { - impl_->PostDelayedTask(std::move(task), delay); + void PostDelayedTask( + absl::AnyInvocable task, + webrtc::TimeDelta delay, + const webrtc::Location& location = webrtc::Location::Current()) { + impl_->PostDelayedTask(std::move(task), delay, location); } - void PostDelayedHighPrecisionTask(absl::AnyInvocable task, - webrtc::TimeDelta delay) { - impl_->PostDelayedHighPrecisionTask(std::move(task), delay); + void PostDelayedHighPrecisionTask( + absl::AnyInvocable task, + webrtc::TimeDelta delay, + const webrtc::Location& location = webrtc::Location::Current()) { + impl_->PostDelayedHighPrecisionTask(std::move(task), delay, location); } private: