Skip to content

Commit

Permalink
Implement support for Chrome task origin tracing. open-webrtc-toolkit#3
Browse files Browse the repository at this point in the history
….6/4

This CL migrates the task queue paced sender unit test
to the new TaskQueueBase interface.

Bug: chromium:1416199
Change-Id: Id0568bb9a08bf43b92e33fdf45fe75a57e5a7a27
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295722
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39436}
  • Loading branch information
Markus Handell authored and WebRTC LUCI CQ committed Mar 1, 2023
1 parent d2ee133 commit c0f8813
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions modules/pacing/task_queue_paced_sender_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,23 @@ class TaskQueueWithFakePrecisionFactory : public TaskQueueFactory {
// TaskQueueDeleter.
delete this;
}
void PostTask(absl::AnyInvocable<void() &&> task) override {
void PostTaskImpl(absl::AnyInvocable<void() &&> task,
const PostTaskTraits& /*traits*/,
const Location& /*location*/) override {
task_queue_->PostTask(WrapTask(std::move(task)));
}
void PostDelayedTask(absl::AnyInvocable<void() &&> task,
TimeDelta delay) override {
++parent_factory_->delayed_low_precision_count_;
task_queue_->PostDelayedTask(WrapTask(std::move(task)), delay);
}
void PostDelayedHighPrecisionTask(absl::AnyInvocable<void() &&> task,
TimeDelta delay) override {
++parent_factory_->delayed_high_precision_count_;
task_queue_->PostDelayedHighPrecisionTask(WrapTask(std::move(task)),
delay);
void PostDelayedTaskImpl(absl::AnyInvocable<void() &&> task,
TimeDelta delay,
const PostDelayedTaskTraits& traits,
const Location& location) override {
if (traits.high_precision) {
++parent_factory_->delayed_high_precision_count_;
task_queue_->PostDelayedHighPrecisionTask(WrapTask(std::move(task)),
delay);
} else {
++parent_factory_->delayed_low_precision_count_;
task_queue_->PostDelayedTask(WrapTask(std::move(task)), delay);
}
}

private:
Expand Down

0 comments on commit c0f8813

Please sign in to comment.