Commit graph

67 commits

Author SHA1 Message Date
Markus Handell
82da9324bc Ensure task queues delete closures in task queue context.
Bug: webrtc:14449
Change-Id: I90d09d35398c1f8817701662f51cbc6a684a2fe0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275773
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38917}
2022-12-19 10:41:03 +00:00
Florent Castelli
123a0ed604 Revert "Add checks for api/test mocks to make sure they're complete"
This reverts commit e87ec28b80.

Reason for revert: Breaks upstream.

Original change's description:
> Add checks for api/test mocks to make sure they're complete
>
> Also unifies the mock inheritance if they inherited from a ref counted
> interface:
>  - it should only inherit from the interface
>  - it should use make_ref_counted
>
> Bug: webrtc:14594
> Change-Id: I7b0514b632ccd0798028b50f19812ac0a196e13c
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262423
> Commit-Queue: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38602}

Bug: webrtc:14594
Change-Id: I9f2d9c3656b43e3006ec03ae7d792d0a53f47ebd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282940
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#38604}
2022-11-10 13:33:59 +00:00
Florent Castelli
e87ec28b80 Add checks for api/test mocks to make sure they're complete
Also unifies the mock inheritance if they inherited from a ref counted
interface:
 - it should only inherit from the interface
 - it should use make_ref_counted

Bug: webrtc:14594
Change-Id: I7b0514b632ccd0798028b50f19812ac0a196e13c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262423
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38602}
2022-11-10 12:47:31 +00:00
Markus Handell
f76a823132 Enable Chromium's rtc::ThreadWrapper to use TaskQueueTest.
Bug: webrtc:14449
Change-Id: Ie279cb3b2610ba561ca4b2e2a8e1b10ab2c795e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275943
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38117}
2022-09-19 15:40:19 +00:00
Ali Tofigh
4b6819434d Reland "Add TaskQueueStdlib experiment."
This is a reland of commit 83db78e854

Original change's description:
> Add TaskQueueStdlib experiment.
>
> Bug: webrtc:14389
> Change-Id: I23c6e0ae675748ec35a99c334104dd2654995a33
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265802
> Commit-Queue: Ali Tofigh <alito@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37888}

Bug: webrtc:14389
Change-Id: If84c7043e5f0f63ae8d9eae651daf900a72f2ee3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273320
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37923}
2022-08-29 10:48:42 +00:00
Ali Tofigh
e7e3d5925a Revert "Add TaskQueueStdlib experiment."
This reverts commit 83db78e854.

Reason for revert: Some tests in Chromium's blink no longer compile because of the change in the signature of the CreateDefaultTaskQueueFactory() function.

Original change's description:
> Add TaskQueueStdlib experiment.
>
> Bug: webrtc:14389
> Change-Id: I23c6e0ae675748ec35a99c334104dd2654995a33
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265802
> Commit-Queue: Ali Tofigh <alito@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37888}

Bug: webrtc:14389
Change-Id: If3e63d6b4ab9e838dc5020b88076a73fd29916e4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272920
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37902}
2022-08-25 12:41:05 +00:00
Ali Tofigh
83db78e854 Add TaskQueueStdlib experiment.
Bug: webrtc:14389
Change-Id: I23c6e0ae675748ec35a99c334104dd2654995a33
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265802
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37888}
2022-08-24 11:28:39 +00:00
Markus Handell
2cfc1af78a Update rtc::Event::Wait call sites to use TimeDelta.
Bug: webrtc:14366
Change-Id: I949c1d26f030696b18153afef977633c9a5bd4cf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272003
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37835}
2022-08-19 10:07:28 +00:00
Danil Chapovalov
e519f38eaa Remove rtc::Location from SendTask test helper
that rtc::Location parameter was used only as extra information for the
RTC_CHECKs directly in the function, thus call stack of the crash should
provide all the information about the caller.

Bug: webrtc:11318
Change-Id: Iec6dd2c5de547f3e1601647a614be7ce57a55734
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270920
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37748}
2022-08-11 12:55:32 +00:00
Danil Chapovalov
c0ce454868 Delete QueuedTask and ToQueuedTask as no longer needed
Bug: webrtc:14245
Change-Id: I4b36c8d6f0709202e01d22386644c20cad58450f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269403
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37718}
2022-08-09 11:11:26 +00:00
Danil Chapovalov
c05a1be5b4 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}
2022-07-20 08:15:08 +00:00
Danil Chapovalov
a7e15a2b7e Introduce helper to guard an invocable with a safety flag
This helper suppose to replace ToQueuedTask when calls to TaskQueueBase interfaces are converted to PostTask variants that take absl::AnyInvocable.

Bug: webrtc:14245
Change-Id: I590a6ca068cf5e682ffb34770bd54cf5ce37d826
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267706
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37449}
2022-07-05 15:45:23 +00:00
Danil Chapovalov
8feb6fd1e9 Introduce new interface for TaskQueueBase using absl::AnyInvocable
Bug: webrtc:14245
Change-Id: Ie4f47ea9753d6644aec2e95f531b521cc119a6c8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267402
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37439}
2022-07-05 10:42:43 +00:00
Artem Titov
ef159280b1 Add public visibility to pending_task_safety_flag
Bug: b/235812579
Change-Id: I9509fa04317876e0d550e473f0089093afa84a87
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266145
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37256}
2022-06-17 11:54:19 +00:00
Artem Titov
c374d11fac Move to_queued_task.h and pending_task_safety_flag.h into public API
Bug: b/235812579
Change-Id: I9fa3dc4a65044df8b44fff4e9bfeac7233fa381c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266080
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37248}
2022-06-17 09:20:39 +00:00
Evan Shrubsole
5b8dc1dbad Add RTC_EXPORT to CurrentTaskQueueSetter
This allows for its use in test targets in Chromium Windows, which fixes
the compiled errors found in https://chromium-review.googlesource.com/c/chromium/src/+/3649679

Change-Id: I738b2eaab8eca73c40e847ede67ff5e7757ec512
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262811
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36939}
2022-05-20 10:38:20 +00:00
Henrik Boström
b951dc6f4c Allow specifying delayed task precision of dcsctp::Timer.
Context: The timer precision of PostDelayedTask() is about to be lowered
to include up to 17 ms leeway. In order not to break use cases that
require high precision timers, PostDelayedHighPrecisionTask() will
continue to have the same precision that PostDelayedTask() has today.
webrtc::TaskQueueBase has an enum (kLow, kHigh) to decide which
precision to use when calling PostDelayedTaskWithPrecision().

See go/postdelayedtask-precision-in-webrtc for motivation and a table of
delayed task use cases in WebRTC that are "high" or "low" precision.

Most timers in DCSCTP are believed to only be needing low precision (see
table), but the delayed_ack_timer_ of DataTracker[1] is an example of a
use case that is likely to break if the timer precision is lowered (if
ACK is sent too late, retransmissions may occur). So this is considered
a high precision use case.

This CL makes it possible to specify the precision of dcsctp::Timer.
In a follow-up CL we will update delayed_ack_timer_ to kHigh precision.

[1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/net/dcsctp/rx/data_tracker.cc;l=340

Bug: webrtc:13604
Change-Id: I8eec5ce37044096978b5dd1985fbb00bc0d8fb7e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249081
Reviewed-by: Victor Boivie <boivie@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35809}
2022-01-26 18:40:24 +00:00
Henrik Boström
27e8a095bf Add ability to specify delayed task precision in RepeatingTaskHandle.
See go/postdelayedtask-precision-in-webrtc for context of which use
cases are considered "high" or "low". Most use cases are "low" which
is the default, but this CL allows opting in to "high".

Will be used by FrameBuffer2.

Bug: webrtc:13604
Change-Id: Iebf6eea44779873e78746da749a39e1101b92819
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/248861
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35776}
2022-01-24 17:56:50 +00:00
Henrik Boström
cf9899c518 TaskQueueBase: Add PostDelayedHighPrecisionTask().
As per go/postdelayedtask-precision-in-webrtc we want to reduce the
precision of PostDelayedTask() in order to schedule work on the CPU
more efficiently. In order not to break "high precision" use cases, a
new API is added to allow opting in to high precision.

PostDelayedHighPrecisionTask() has the same precision that
PostDelayedTask() has today, but by changing the interface's
requirements on PostDelayedTask(), adding the high precision version
of it will unblock making the old PostDelayedTask() API lower
precision.

This CL does not update implementations to support low precision so
until those are updated, both PostDelayedTask() and
PostDelayedHighPrecisionTask() have the same precision (=high).

This CL also adds TODOs to make some rtc::Thread-specific versions
of PostTask/PostDelayedTask obsolete, see
https://crbug.com/webrtc/13582 for more info.

Bug: webrtc:13583, webrtc:13582
Change-Id: I4c6d53d22bb299c49893ce9f3ef73a40d8c75de1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247367
Reviewed-by: Markus Handell <handellm@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35748}
2022-01-20 10:45:10 +00:00
Artem Titov
cfea2182f8 Use backticks not vertical bars to denote variables in comments
Bug: webrtc:12338
Change-Id: I89c8b3a328d04203177522cbdfd9e606fd4bce4c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228246
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34696}
2021-08-10 10:40:03 +00:00
Artem Titov
0e61fdd27c Use backticks not vertical bars to denote variables in comments for /api
Bug: webrtc:12338
Change-Id: Ib97b2c3d64dbd895f261ffa76a2e885bd934a87f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226940
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34554}
2021-07-26 18:27:34 +00:00
Danil Chapovalov
6cdb67fb33 Document expected thread safety of the TaskQueue interface
Bug: webrtc:12182
Change-Id: I06fc2e2fca98cb9e03d664d5bd8143ae06184314
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/200702
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33032}
2021-01-19 11:11:09 +00:00
Danil Chapovalov
5ad16a50fc suppress 'Paramaterized test suite never instantiated' warning
for TaskQueueTest.
This suit is instantiated in the different binary targets by design.

Bug: None
Change-Id: I99a38e2461ee9bd06dfe68758490afe75c2475ba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176750
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31476}
2020-06-09 13:31:49 +00:00
Mirko Bonadei
2dcf348011 Use absl_deps in order to preapre to the Abseil component build release.
Bug: webrtc:1046390
Change-Id: Ia35545599de23b1a2c2d8be2d53469af7ac16f1d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176502
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31463}
2020-06-08 12:59:40 +00:00
Tommi
6866dc7806 Reland "Make sure that "current" rtc::Thread instances are always current for TaskQueueBase."
This reverts commit 28685dc08c.

Reason for revert: Speculative reland after looking into downstream
failures. It's possible that carryover state from unrelated tests
running in parallel was causing failures.

Original change's description:
> Revert "Make sure that "current" rtc::Thread instances are always current for TaskQueueBase."
> 
> This reverts commit 46b3bc6c24.
> 
> Reason for revert: Speculative revert. Breaks downstream project
> 
> Original change's description:
> > Make sure that "current" rtc::Thread instances are always current for TaskQueueBase.
> > 
> > This is a necessary part of fulfilling the TaskQueueBase
> > interface. If a thread does not register as the current TQ, yet offers
> > the TQ interface, TQ 'current' checks will not work as expected and
> > code that relies them (TaskQueueBase::Current() and IsCurrent())
> > will run in unexpected ways.
> > 
> > Bug: webrtc:11572
> > Change-Id: Iab747bc474e74e6ce4f9e914cfd5b0578b19d19c
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175080
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Commit-Queue: Tommi <tommi@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#31254}
> 
> TBR=mbonadei@webrtc.org,tommi@webrtc.org
> 
> Change-Id: I69ff3355f0ec447b25604bd95fdacbdb4d4f3f27
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:11572
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175104
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> Commit-Queue: Artem Titov <titovartem@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31259}

TBR=mbonadei@webrtc.org,tommi@webrtc.org,titovartem@webrtc.org

# Not skipping CQ checks because this is a reland.

Bug: webrtc:11572
Change-Id: I00c82d99af8e05851769e09cb682b5b73895a6f3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175133
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31273}
2020-05-15 10:20:03 +00:00
Artem Titov
28685dc08c Revert "Make sure that "current" rtc::Thread instances are always current for TaskQueueBase."
This reverts commit 46b3bc6c24.

Reason for revert: Speculative revert. Breaks downstream project

Original change's description:
> Make sure that "current" rtc::Thread instances are always current for TaskQueueBase.
> 
> This is a necessary part of fulfilling the TaskQueueBase
> interface. If a thread does not register as the current TQ, yet offers
> the TQ interface, TQ 'current' checks will not work as expected and
> code that relies them (TaskQueueBase::Current() and IsCurrent())
> will run in unexpected ways.
> 
> Bug: webrtc:11572
> Change-Id: Iab747bc474e74e6ce4f9e914cfd5b0578b19d19c
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175080
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31254}

TBR=mbonadei@webrtc.org,tommi@webrtc.org

Change-Id: I69ff3355f0ec447b25604bd95fdacbdb4d4f3f27
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11572
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175104
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31259}
2020-05-14 13:55:22 +00:00
Tommi
46b3bc6c24 Make sure that "current" rtc::Thread instances are always current for TaskQueueBase.
This is a necessary part of fulfilling the TaskQueueBase
interface. If a thread does not register as the current TQ, yet offers
the TQ interface, TQ 'current' checks will not work as expected and
code that relies them (TaskQueueBase::Current() and IsCurrent())
will run in unexpected ways.

Bug: webrtc:11572
Change-Id: Iab747bc474e74e6ce4f9e914cfd5b0578b19d19c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175080
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31254}
2020-05-14 12:40:42 +00:00
Mirko Bonadei
ccbe95fd8a Reformat GN files.
`gn format` recently [1] changed its formatting behavior
for deps, source, and a few other elements when they
are assigned (with =) single-element lists to be consistent
with the formatting of updates (with +=) with single-element.

Now that we've rolled in a GN binary with the change,
reformat all files so that people don't get presubmit
warnings due to this.

CL generated with:
$ git ls-files | grep BUILD.gn | xargs gn format
$ gn format build_overrides/build.gni
$ gn format build_overrides/gtest.gni
$ gn format modules/audio_coding/audio_coding.gni
$ gn format webrtc.gni
$ gn format .gn

Plus a few manual changes to add exceptions for
"public_deps" (after changing these lines the presubmit
started to complain).

[1] - https://gn-review.googlesource.com/c/gn/+/6860

Bug: webrtc:11302
Change-Id: Iac29d23c1618ebef925c972e2891cd9f4e8cd613
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166882
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30334}
2020-01-21 12:13:11 +00:00
Mirko Bonadei
92dd35d035 Reland "Force Chromium deps on the WebRTC component."
This is a reland of 53e157d25c

The issue has been fixed in
https://chromium-review.googlesource.com/c/chromium/src/+/1917204.

Original change's description:
> Force Chromium deps on the WebRTC component.
>
> This CL adds a visibility check to the rtc_* GN templates in order
> to force Chromium to depend only on publicly visible targets from
> //third_party/webrtc_overrides and not from //third_party/webrtc.
>
> This is required in order to ensure that the Chromium's component
> builds continues to work correctly without introducing direct
> dependency paths on WebRTC that would statically link it in multiple
> shared libraries.
>
> Bug: webrtc:9419
> Change-Id: Ib89f4fc571512f99678ee4f61696b316374346d9
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154344
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29806}

TBR: kwiberg@webrtc.org
Bug: webrtc:9419
Change-Id: I7123d1b44ddbc23b11d9fa25aa39aa420359e33d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159922
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29816}
2019-11-18 12:16:43 +00:00
Mirko Bonadei
2419dc9cfc Revert "Force Chromium deps on the WebRTC component."
This reverts commit 53e157d25c.

Reason for revert: Breaks Chromium iOS FYI bots.
https://ci.chromium.org/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20ios-device/5088

Original change's description:
> Force Chromium deps on the WebRTC component.
>
> This CL adds a visibility check to the rtc_* GN templates in order
> to force Chromium to depend only on publicly visible targets from
> //third_party/webrtc_overrides and not from //third_party/webrtc.
>
> This is required in order to ensure that the Chromium's component
> builds continues to work correctly without introducing direct
> dependency paths on WebRTC that would statically link it in multiple
> shared libraries.
>
> Bug: webrtc:9419
> Change-Id: Ib89f4fc571512f99678ee4f61696b316374346d9
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154344
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29806}

TBR=mbonadei@webrtc.org,kwiberg@webrtc.org,dpranke@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

TBR: kwiberg@webrtc.org
Bug: webrtc:9419
Change-Id: Id4d906910d569a3e5db3afef8c03672fba6dad81
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159921
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29813}
2019-11-18 08:11:30 +00:00
Mirko Bonadei
53e157d25c Force Chromium deps on the WebRTC component.
This CL adds a visibility check to the rtc_* GN templates in order
to force Chromium to depend only on publicly visible targets from
//third_party/webrtc_overrides and not from //third_party/webrtc.

This is required in order to ensure that the Chromium's component
builds continues to work correctly without introducing direct
dependency paths on WebRTC that would statically link it in multiple
shared libraries.

Bug: webrtc:9419
Change-Id: Ib89f4fc571512f99678ee4f61696b316374346d9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154344
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29806}
2019-11-15 16:36:28 +00:00
Mirko Bonadei
d4002a733d RTC_EXPORT missing symbols for Chromium's component build.
This CL adds a dependecy on rtc_base/system:rtc_export to rtc_event but
only when built as part of Chromium (since rtc::Event should not be
used outside of WebRTC).

It also adds other missing RTC_EXPORTS.

Bug: webrtc:9419
Change-Id: Ib338004a5404a6b3c7929e146c29ad42572632cc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159692
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29781}
2019-11-12 21:50:01 +00:00
Mirko Bonadei
c04792ebef Component Build support for api/task_queue:task_queue_test.
Chromium tests depend on api/task_queue:task_queue_test but it
cannot be added to the WebRTC component in Chromium (which is not
testonly).

A possible solution is to make api/task_queue:task_queue_test
depend on the WebRTC component which lives in Chromium only
when `build_with_chromium=true`.

Bug: webrtc:9419
Change-Id: I1cbe1fb97f21ef7a201d09d2f0f729104d01ed90
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157427
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29578}
2019-10-22 23:21:06 +00:00
Mirko Bonadei
86d053c2db Use source_sets in component builds and static_library in release builds.
Static libraries don't guarantee that an exported symbol gets linked
into a shared library (and in order to support Chromium's component
build mode, WebRTC needs to be linked as a shared library).

Source sets always pass all the object files to the linker.

On the flip side, source_sets link more object files in release builds
and to avoid this, this CL introduces a the GN template "rtc_library" that
expands to static_library during release builds and to source_set during
component builds.

See: https://gn.googlesource.com/gn/+/master/docs/reference.md#func_source_set

Bug: webrtc:9419
Change-Id: I4667e820c2b3fcec417becbd2034acc13e4f04fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157168
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#29525}
2019-10-17 21:17:18 +00:00
Mirko Bonadei
317a1f09ed Use std::make_unique instead of absl::make_unique.
WebRTC is now using C++14 so there is no need to use the Abseil version
of std::make_unique.

This CL has been created with the following steps:

git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt
git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt
git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt

diff --new-line-format="" --unchanged-line-format="" \
  /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \
  uniq > /tmp/only_make_unique.txt
diff --new-line-format="" --unchanged-line-format="" \
  /tmp/only_make_unique.txt /tmp/memory.txt | \
  xargs grep -l "absl/memory" > /tmp/add-memory.txt

git grep -l "\babsl::make_unique\b" | \
  xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g"

git checkout PRESUBMIT.py abseil-in-webrtc.md

cat /tmp/add-memory.txt | \
  xargs sed -i \
  's/#include "absl\/memory\/memory.h"/#include <memory>/g'
git cl format
# Manual fix order of the new inserted #include <memory>

cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \
  xargs sed -i '/#include "absl\/memory\/memory.h"/d'

git ls-files | grep BUILD.gn | \
  xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d'

python tools_webrtc/gn_check_autofix.py \
  -m tryserver.webrtc -b linux_rel

# Repead the gn_check_autofix step for other platforms

git ls-files | grep BUILD.gn | \
  xargs sed -i 's/absl\/memory:memory/absl\/memory/g'
git cl format

Bug: webrtc:10945
Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 15:47:29 +00:00
Danil Chapovalov
2c6ea52369 In TaskQueueTest::PostDelayedAfterDesctruct increase timeout
from 2x expected time to 10x.
To decrease flakiness for task queue implemntations that destroy tasks
after destruction of the task queue.

Bug: chromium:1000531
Change-Id: Ieb37ff782ead585e0aa2c84472e3993107c5c072
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152830
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29204}
2019-09-17 09:36:47 +00:00
Danil Chapovalov
41300af876 Poison default task queue factory
Users of webrtc generally should be able to choose own task queue implementation.
Poison avoids accidental dependency of a low level component on the default implementation
Android and ios apis are still de-facto forced to use the default implementation.

Bug: webrtc:10284
Change-Id: I67ecf2317f43ee32b0c9e8a6e69f1e0987cf1914
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144786
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28524}
2019-07-10 14:08:20 +00:00
Danil Chapovalov
b249c54209 Delete GlobalTaskQueueFactory as now unused
Bug: webrtc:10284
Change-Id: I80fd75b0bd306a26e0c022047551587ee5fd08cd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144781
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28516}
2019-07-09 14:45:47 +00:00
Danil Chapovalov
95e0a607f6 Increase TaskQueueTest.PostALot timeouts
recent changed decreased timeout from forever to 1s which is not enough on some platforms
Increase timeout to forever for posting 65k tasks.
Also increase timeout for eventual destruction of the tasks to reduce change it would flake.

Bug: chromium:972917
Change-Id: I4948d49c1514833ab190856fdd25a47a5bad91eb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141410
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28235}
2019-06-11 14:42:18 +00:00
Danil Chapovalov
f504dd305d Rewrite TaskQueueTest.PostALot
avoid waiting while executing a Task to discourage blocking.

fix accessing tasks_clean_up counter since after TaskQueue is destroyed,
it doesn't guarantee sequential execution of the destructors, nor
that all pending tasks are destroyed at that moment.
Instead verify that all posted tasks will be destroyed eventually.

Bug: None
Change-Id: I4cfc97ac0787fe2d0b9d2f0d712a37ae0ca9e1aa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140288
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28208}
2019-06-10 11:00:44 +00:00
François Doray
8ea977d2fd Add ScopedAllowBaseSyncPrimitivesForTesting to Webrtc.
Chromium requires that all code that waits on a sync primitive be
annotated with ScopedAllowBaseSyncPrimitives(ForTesting). Webrtc
already imports ScopedAllowBaseSyncPrimitives.
ScopedAllowBaseSyncPrimitivesForTesting is equivalent but can only
be used in tests and doesn't required adding a friend declaration to
thread_restrictions.h.

Previously, the code that is annotated with
ScopedAllowBaseSyncPrimitivesForTesting in this CL didn't fail because
it ran on a TaskRunner annotated with the deprecated
WithBaseSyncPrimitives() trait (cf.
https://cs.chromium.org/chromium/src/content/renderer/media/webrtc/task_queue_factory_unittest.cc?l=23&rcl=362f3723ac358d932ea2e3af65512a1243697a31).

Change-Id: Id7cfa2ea108870de86dc887458ae783c807791cc
Bug: chromium:889029
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128823
Commit-Queue: Francois Pierre Doray <fdoray@chromium.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27339}
2019-03-28 13:07:33 +00:00
Danil Chapovalov
4f779c6aec Remove legacy empty task_queue BUILD targets and build arg
Now that they are unused

Bug: webrtc:10191
Change-Id: Id5f1b70ed8e084555ca809fef2a75359266f2ca1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126980
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27070}
2019-03-12 10:06:04 +00:00
Danil Chapovalov
ad89528051 Reland "Delete rtc::TaskQueue::Current in favor of webrtc::TaskQueueBase::Current"
This reverts commit 42d8c93ec3.

Reason for revert: Got Aliby for FEC test flakes

Original change's description:
> Revert "Delete rtc::TaskQueue::Current in favor of webrtc::TaskQueueBase::Current"
> 
> This reverts commit 304e9d2df3.
> 
> Reason for revert: Breaks downstream projects.
> Seems to make VideoSendStreamTest.SupportsFlexfecSimulcastVp8 flaky.
> 
> Original change's description:
> > Delete rtc::TaskQueue::Current in favor of webrtc::TaskQueueBase::Current
> > 
> > Bug: webrtc:10191
> > Change-Id: I506cc50a90c73a6a4f6a3de36de0999cca72f5ba
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126230
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#27035}
> 
> TBR=danilchap@webrtc.org,kwiberg@webrtc.org
> 
> Change-Id: If98324f88e4b3d18bf2fe33597dfb9711867c243
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10191
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126484
> Reviewed-by: Yves Gerey <yvesg@webrtc.org>
> Commit-Queue: Yves Gerey <yvesg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27041}

TBR=danilchap@webrtc.org,kwiberg@webrtc.org,yvesg@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:10191
Change-Id: Id87a17ae415142b8e0b11ba03ae7bad84a473fb0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126720
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Yves Gerey <yvesg@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27056}
2019-03-11 12:32:49 +00:00
Danil Chapovalov
effdfe2014 Move dependency on chromium DefaultTaskQueueFactory
That will avoid linkage error of targets that depend
on global_task_queue_factory without depending on rtc_task_queue

Bug: webrtc:10191
Change-Id: Ia67ea0a3abb715e28160e4e376133cc0309b14e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126621
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27053}
2019-03-11 11:28:28 +00:00
Yves Gerey
42d8c93ec3 Revert "Delete rtc::TaskQueue::Current in favor of webrtc::TaskQueueBase::Current"
This reverts commit 304e9d2df3.

Reason for revert: Breaks downstream projects.
Seems to make VideoSendStreamTest.SupportsFlexfecSimulcastVp8 flaky.

Original change's description:
> Delete rtc::TaskQueue::Current in favor of webrtc::TaskQueueBase::Current
> 
> Bug: webrtc:10191
> Change-Id: I506cc50a90c73a6a4f6a3de36de0999cca72f5ba
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126230
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27035}

TBR=danilchap@webrtc.org,kwiberg@webrtc.org

Change-Id: If98324f88e4b3d18bf2fe33597dfb9711867c243
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10191
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126484
Reviewed-by: Yves Gerey <yvesg@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27041}
2019-03-08 16:14:54 +00:00
Danil Chapovalov
304e9d2df3 Delete rtc::TaskQueue::Current in favor of webrtc::TaskQueueBase::Current
Bug: webrtc:10191
Change-Id: I506cc50a90c73a6a4f6a3de36de0999cca72f5ba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126230
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27035}
2019-03-08 13:17:46 +00:00
Danil Chapovalov
4423c36448 Migrate RepeatingTask to take raw pointer to TaskQueueBase instead of TaskQueue
In particular replace call rtc::TaskQueue::Current with TaskQueueBase::Current

Bug: webrtc:10191
Change-Id: I19d42a716d27f0aba087dc70ac65b4ee6249408f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125085
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27005}
2019-03-06 18:44:35 +00:00
Danil Chapovalov
07a4f2b267 Merge rtc_task_queue(_api|_impl)? build targets into one
Ignore rtc_link_task_queue_impl flag,
instead use build_with_chromium for custom chromium implementation injection

This changes TaskQueue implementation used in webrtc fuzzers in chromium:
from own webrtc implementation to chromium's.

Bug: webrtc:10191
Change-Id: I63be28b680ae8ea8ee1dbf0c699263c392ce29d3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125196
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26977}
2019-03-05 20:13:38 +00:00
Danil Chapovalov
3b548ddb1c Move rtc::NewClosure into own build target as ToQueuedTask
to make it usable without need to depend on rtc_task_queue

Bug: webrtc:10191
Change-Id: I2ae1445cf5d498aa6928d66b6823f2f940987767
Reviewed-on: https://webrtc-review.googlesource.com/c/125084
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26942}
2019-03-04 09:00:38 +00:00
Danil Chapovalov
f3280e99b0 Create conversions between webrtc::TaskQueueBase and rtc::TaskQueue
Bug: webrtc:10191
Change-Id: Ia6642081ac758e31c14780bdd83dbc88279cce6d
Reviewed-on: https://webrtc-review.googlesource.com/c/124826
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26890}
2019-02-28 10:36:07 +00:00