Because rtc::Thread inherits from TaskQueueBase, it already implements
a pair of PostTask/PostDelayedTask methods that we want to keep. But in
addition to those, rtc::Thread defines its own PostTask/PostDelayedTask
using templates. These are the versions that we want to deprecate.
They were originally implemented prior to rtc::Thread inheriting from
TaskQueueBase. We want to deprecate them because...
- We don't want to have multiple code paths that do the same thing.
- We want to move away from rtc::Thread to TaskQueueBase long-term.
- These versions are not overridable in Chromium.
- These versions don't have high/low precision versions of PDT.
Helper methods are added to rtc::Thread so that callers don't have to
wrap every lambda in webrtc::ToQueuedTask() and update dependencies.
Bug: webrtc:13582
Change-Id: I58702c53f4cb3705681bd9f1ea16b7aaa5052c18
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247660
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@google.com>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35750}
This test was added in
https://webrtc-review.googlesource.com/c/src/+/180620. On my machine it
passes about 98% of the time.
The test is meant to count the number of times the callback that the
operations chain is empty has been invoked, and does this by ensuring
the last operation to make the chain empty has completed before
expecting that the counter has increased.
The race happns when the operation has completed but the callback that
the chain is empty has not happened yet. This CL fixes that by using
EXPECT_EQ_WAIT instead.
TBR=hta@webrtc.org
Bug: chromium:1060083
Change-Id: I2ebfac3e635ef895d6602f7360e5ec6006fc1d0a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/182541
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31992}
This CL generates "negotiationneeded" events if negotiation is needed
when the Operations Chain becomes empty. This is only implemented in
Unified Plan to avoid Plan B regressions (the event is pretty useless
in Plan B as it fires repeatedly).
In order to implement the spec-compliant behavior of only firing the
event when the chain is empty, this CL introduces
PeerConnectionObserver::OnNegotiationNeededEvent() and
PeerConnectionInterface::ShouldFireNegotiationNeededEvent() to allow
validating the event before firing it. This is needed because the event
must not be fired until a task has been posted and subsequently chained
operations could invalidate it in the meantime.
Test coverage is added for both legacy and modern "negotiationneeded"
events.
Bug: chromium:1060083
Change-Id: I1dbaa8f6ddb1c6e7c8abd8da3b92efcb64060383
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180620
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31989}
This is the same as the existing version, except it uses the Operations
Chain. As such, if an asynchronous operation that uses the chain is
currently pending, such as CreateOffer() or CreateAnswer(),
AddIceCandidate() will not happen until the previous operation
completes.
Bug: chromium:1019222
Change-Id: Ie6e5fc386fa9c29b5e2f8e3f65bfbaf9837d351c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158741
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29704}