Commit graph

11 commits

Author SHA1 Message Date
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
Niels Möller
83830f316e Delete TestListener and top-level thread wrapping.
Instead use rtc::AutoThread in tests that need that.

Bug: webrtc:9714
Change-Id: I1f33b1b2d321770d062504dd9ef86d66a345dd42
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254681
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36950}
2022-05-20 15:21:21 +00:00
Henrik Boström
2deee4bbb2 Mark rtc::Thread's versions of PostTask/PostDelayedTask deprecated.
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}
2022-01-20 12:59:27 +00:00
Byoungchan Lee
14af7622a7 Remove RTC_DISALLOW_COPY_AND_ASSIGN from rtc_base/
Bug: webrtc:13555, webrtc:13082
Change-Id: I406b7f04497562866ea3329e97c5adc96e927b6f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/245680
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35691}
2022-01-13 20:42:15 +00:00
Artem Titov
96e3b991da Use backticks not vertical bars to denote variables in comments for /rtc_base
Bug: webrtc:12338
Change-Id: I72fcb505a92f03b2ace7160ee33d555a977eddfd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226955
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34587}
2021-07-28 13:51:47 +00:00
Niels Möller
1a29a5da84 Delete rtc::Bind
Bug: webrtc:11339
Change-Id: Id53d17bbf37a15f482e9eb9f8762d2000c772dcc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202250
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33099}
2021-01-29 08:24:43 +00:00
Henrik Boström
e8b00a1a74 Fix OperationsChainTest.OnChainEmptyCallback flake.
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}
2020-08-25 16:11:22 +00:00
Henrik Boström
e574a31c50 [Perfect Negotiation] Fire onnegotiationneeded when chain is empty.
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}
2020-08-25 09:56:39 +00:00
Tommi
a5e07cc3db Rename more death test to *DeathTest
Bug: webrtc:11577
Change-Id: If45e322fed3f2935e64c9e4d7e8c096eccc53ac4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176140
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31362}
2020-05-26 20:27:34 +00:00
Henrik Boström
ee6f4f67ef [PeerConnection] Implement asynchronous version of AddIceCandidate().
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}
2019-11-06 12:16:00 +00:00
Henrik Boström
27c293665e Implement an OperationsChain, to be used by PeerConnection in follow-up.
This allows asynchronous tasks to be queued to be executed in order.
The class is motivated by the "operations chain" in the spec:
https://w3c.github.io/webrtc-pc/#dfn-operations-chain

In a follow-up CL I intend to use this in PeerConnection's
CreateOffer(), CreateAnswer() SetLocalDescription() and
SetRemoteDescription() and unblock https://crbug.com/980885.

For background, motivation, requirements and implementation notes, see
https://docs.google.com/document/d/1XLwNN2kUIGGTwz9LQ0NwJNkcybi9oKnynUEZB1jGA14/edit?usp=sharing

Bug: webrtc:11019
Change-Id: I982e4a1c0e77fa62096c16deed459d9d9e9b63f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156120
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29582}
2019-10-23 09:33:16 +00:00