Skip to content

Commit

Permalink
Bug 1839451 - Vendor libwebrtc from ae61aca9b1
Browse files Browse the repository at this point in the history
Upstream commit: https://webrtc.googlesource.com/src/+/ae61aca9b175e9cb5adadf41ab1a7254a57d7afc
    Implement support for Chrome task origin tracing. #3.7/4

    This CL completes migration to the new TaskQueueBase interface
    permitting location tracing in Chrome.

    Bug: chromium:1416199
    Change-Id: Iff7ff5796752a1520384a3db0135a1d4b9438988
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294540
    Reviewed-by: Harald Alvestrand <hta@webrtc.org>
    Commit-Queue: Markus Handell <handellm@webrtc.org>
    Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#39439}
  • Loading branch information
jan-ivar committed Jun 29, 2023
1 parent ae9fc8d commit 5f6ff3d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
3 changes: 3 additions & 0 deletions third_party/libwebrtc/README.moz-ff-commit
Original file line number Diff line number Diff line change
Expand Up @@ -21954,3 +21954,6 @@ cec9d00769
# MOZ_LIBWEBRTC_SRC=/Users/jan-ivar/moz/elm/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
bff2e27076
# MOZ_LIBWEBRTC_SRC=/Users/jan-ivar/moz/elm/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
ae61aca9b1
2 changes: 2 additions & 0 deletions third_party/libwebrtc/README.mozilla
Original file line number Diff line number Diff line change
Expand Up @@ -14658,3 +14658,5 @@ libwebrtc updated from /Users/jan-ivar/moz/elm/.moz-fast-forward/moz-libwebrtc c
libwebrtc updated from /Users/jan-ivar/moz/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2023-06-29T15:28:04.852935.
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/jan-ivar/moz/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
libwebrtc updated from /Users/jan-ivar/moz/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2023-06-29T15:29:29.135396.
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/jan-ivar/moz/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
libwebrtc updated from /Users/jan-ivar/moz/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2023-06-29T15:30:55.780490.
44 changes: 21 additions & 23 deletions third_party/libwebrtc/api/task_queue/task_queue_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@ class RTC_LOCKABLE RTC_EXPORT TaskQueueBase {
// Note that this guarantee does not apply to delayed tasks.
//
// May be called on any thread or task queue, including this task queue.
// TODO(crbug.com/1416199): Remove virtual and pass location of the caller
// once subclasses migrated.
virtual void PostTask(absl::AnyInvocable<void() &&> task) {
PostTaskImpl(std::move(task), PostTaskTraits{}, Location::Current());
void PostTask(absl::AnyInvocable<void() &&> task,
const Location& location = Location::Current()) {
PostTaskImpl(std::move(task), PostTaskTraits{}, location);
}

// Prefer PostDelayedTask() over PostDelayedHighPrecisionTask() whenever
Expand All @@ -92,13 +91,12 @@ class RTC_LOCKABLE RTC_EXPORT TaskQueueBase {
// https://crbug.com/webrtc/13583 for more information.
//
// May be called on any thread or task queue, including this task queue.
// TODO(crbug.com/1416199): Remove virtual and pass location of the caller
// once subclasses migrated.
virtual void PostDelayedTask(absl::AnyInvocable<void() &&> task,
TimeDelta delay) {
void PostDelayedTask(absl::AnyInvocable<void() &&> task,
TimeDelta delay,
const Location& location = Location::Current()) {
PostDelayedTaskImpl(std::move(task), delay,
PostDelayedTaskTraits{.high_precision = false},
Location::Current());
location);
}

// Prefer PostDelayedTask() over PostDelayedHighPrecisionTask() whenever
Expand All @@ -117,26 +115,28 @@ class RTC_LOCKABLE RTC_EXPORT TaskQueueBase {
// battery, when the timer precision can be as poor as 15 ms.
//
// May be called on any thread or task queue, including this task queue.
// TODO(crbug.com/1416199): Remove virtual and pass location of the caller
// once subclasses migrated.
virtual void PostDelayedHighPrecisionTask(absl::AnyInvocable<void() &&> task,
TimeDelta delay) {
void PostDelayedHighPrecisionTask(
absl::AnyInvocable<void() &&> task,
TimeDelta delay,
const Location& location = Location::Current()) {
PostDelayedTaskImpl(std::move(task), delay,
PostDelayedTaskTraits{.high_precision = true},
Location::Current());
location);
}

// As specified by `precision`, calls either PostDelayedTask() or
// PostDelayedHighPrecisionTask().
void PostDelayedTaskWithPrecision(DelayPrecision precision,
absl::AnyInvocable<void() &&> task,
TimeDelta delay) {
void PostDelayedTaskWithPrecision(
DelayPrecision precision,
absl::AnyInvocable<void() &&> task,
TimeDelta delay,
const Location& location = Location::Current()) {
switch (precision) {
case DelayPrecision::kLow:
PostDelayedTask(std::move(task), delay);
PostDelayedTask(std::move(task), delay, location);
break;
case DelayPrecision::kHigh:
PostDelayedHighPrecisionTask(std::move(task), delay);
PostDelayedHighPrecisionTask(std::move(task), delay, location);
break;
}
}
Expand Down Expand Up @@ -173,19 +173,17 @@ class RTC_LOCKABLE RTC_EXPORT TaskQueueBase {

// Subclasses should implement this method to support the behavior defined in
// the PostTask and PostTaskTraits docs above.
// TODO(crbug.com/1416199): make pure virtual once subclasses migrate.
virtual void PostTaskImpl(absl::AnyInvocable<void() &&> task,
const PostTaskTraits& traits,
const Location& location) {}
const Location& location) = 0;

// Subclasses should implement this method to support the behavior defined in
// the PostDelayedTask/PostHighPrecisionDelayedTask and PostDelayedTaskTraits
// docs above.
// TODO(crbug.com/1416199): make pure virtual once subclasses migrate.
virtual void PostDelayedTaskImpl(absl::AnyInvocable<void() &&> task,
TimeDelta delay,
const PostDelayedTaskTraits& traits,
const Location& location) {}
const Location& location) = 0;

// Users of the TaskQueue should call Delete instead of directly deleting
// this object.
Expand Down

0 comments on commit 5f6ff3d

Please sign in to comment.