Commit graph

127 commits

Author SHA1 Message Date
Danil Chapovalov
9e09a1f327 Replace Thread::Invoke with Thread::BlockingCall
BlockingCall doesn't take rtc::Location parameter and thus most of the dependencies on location can be removed

Bug: webrtc:11318
Change-Id: I91a17e342dd9a9e3e2c8f7fbe267474c98a8d0e5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274620
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38045}
2022-09-09 10:44:17 +00:00
Harald Alvestrand
8f42992787 Move channel creation functions into RtpTransceiver
This breaks the link from sdp_offer_answer.cc to channel.h.

Bug: webrtc:13931
Change-Id: I75608f75713bf4e69013ac5f5b17c19e53d07519
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261060
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36757}
2022-05-04 11:57:50 +00:00
Jonas Oreland
340cb5e46a WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 8/inf
Convert p2p/.
This completes work started in https://webrtc-review.googlesource.com/c/src/+/255602

Bug: webrtc:10335
Change-Id: I39f70890be0599c8ef46ff7982d2a229e10e67ff
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255827
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36231}
2022-03-17 09:08:45 +00:00
Jonas Oreland
ed99dae422 WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 1
This cl/
1) move WebRtcKeyValueConfig from api/transport to api/ directory.
2) add a test/ScopedKeyValueConfig (compare ScopedFieldTrials).
3) removes usage of webrtc::field_trial:: from the pc/ directory.
4) removes a few unused includes of system_wrappers/field_trial.h.

Bug: webrtc:10335
Change-Id: If29c07900dbe791050b0a5ad05332bedfad035f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/253903
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36160}
2022-03-09 13:23:21 +00:00
Harald Alvestrand
c24a2189d7 Update IWYU tool with a mapping file
Also apply IWYU to all .cc files in pc/, and correct BUILD file to match.
Note: Some files came out wrong when iwyu was applied. These are not included.

Bug: none
Change-Id: Ib5ea46b8fcc505414d0447cca7218ad3afc2e321
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252280
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36064}
2022-02-24 11:05:06 +00:00
Artem Titov
d3251968d1 Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED
Add implementation of RTC_DCHECK_NOTREACHED equal to the RTC_NOTREACHED.
The new macros will replace the old one when old one's usage will be
removed. The idea of the renaming to provide a clear signal that this
is debug build only macros and will be stripped in the production build.

Bug: webrtc:9065
Change-Id: I4c35d8b03e74a4b3fd1ae75dba2f9c05643101db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35348}
2021-11-15 21:44:59 +00:00
Harald Alvestrand
0d018415d5 Revert "Remove code supporting the SDES crypto mode in SDP"
This reverts commit ee212a72f2.

Reason for revert: Don't remove until downstream issues resolved

Original change's description:
> Remove code supporting the SDES crypto mode in SDP
>
> Removes the ability to accept nonencrypted answers to encrypted offers.
> Fixes some logic around bundled sessions and requirement for
> transport parameters.
>
> Bug: webrtc:11066
> Change-Id: I56d8628d223614918a1e5260fdb8a117c8c02dbd
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236344
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35298}

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

Bug: webrtc:11066
Change-Id: I0c400ceffe1b08e0be7b44abbb54c8a032128f05
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237223
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35312}
2021-11-04 14:46:27 +00:00
Harald Alvestrand
97597c0f51 Remove usage of INFO alias for LS_INFO in log messages
Bug: webrtc:13362
Change-Id: Ifda893861a036a85c045cd366f9eab33c62ebde0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237221
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35310}
2021-11-04 13:46:17 +00:00
Harald Alvestrand
ee212a72f2 Remove code supporting the SDES crypto mode in SDP
Removes the ability to accept nonencrypted answers to encrypted offers.
Fixes some logic around bundled sessions and requirement for
transport parameters.

Bug: webrtc:11066
Change-Id: I56d8628d223614918a1e5260fdb8a117c8c02dbd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236344
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35298}
2021-11-02 12:58:50 +00:00
Taylor Brandstetter
8591eff520 Reland "Fix bug where we assume new m= sections will always be bundled."
This is a reland of commit 704a834f68,
after it was reverted in order to merge a CL to M93.

Original change's description:
> Fix bug where we assume new m= sections will always be bundled.
>
> A recent change [1] assumes that all new m= sections will share the
> first BUNDLE group (if one already exists), which avoids generating
> ICE candidates that are ultimately unnecessary. This is fine for JSEP
> endpoints, but it breaks the following scenarios for non-JSEP endpoints:
>
> * Remote offer adding a new m= section that's not part of any BUNDLE
>   group.
> * Remote offer adding an m= section to the second BUNDLE group.
>
> The latter is specifically problematic for any application that wants
> to bundle all audio streams in one group and all video streams in
> another group when using Unified Plan SDP, to replicate the behavior of
> using Plan B without bundling. It may try to add a video stream only
> for WebRTC to bundle it with audio.
>
> This is fixed by doing some minor re-factoring, having BundleManager
> update the bundle groups at offer time.
>
> Also:
> * Added some additional validation for multiple bundle groups in a
>   subsequent offer, since that now becomes relevant.
> * Improved rollback support, because now rolling back an offer may need
>   to not only remove mid->transport mappings but alter them.
>
> [1]: https://webrtc-review.googlesource.com/c/src/+/221601
>
> Bug: webrtc:12906, webrtc:12999
> Change-Id: I4c6e7020c0be33a782d3608dee88e4e2fceb1be1
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225642
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34544}

Bug: webrtc:12906, webrtc:12999
Change-Id: Id6acab2e2d7430c65f4b6a1d7372388a70cc18ab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228465
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34728}
2021-08-11 23:36:28 +00:00
Taylor Brandstetter
1c7ecefbe7 Reland "Modify Bundle logic to not add & destroy extra transport at add-track"
This relands commit I41cae74605fecf454900a958776b95607ccf3745, after
reverting it in order to merge the revert to M93 (the deadline for
which is now exceeded).

Original change description:

> If a bundle is established, then per JSEP, the offerer is required to
> include the new track in the bundle, and per BUNDLE, the answerer has
> to either accept the track as part of the bundle or reject the track;
> it cannot move it out of the group. So we will never need the transport.
>
> Bug: webrtc:12837
> Change-Id: I41cae74605fecf454900a958776b95607ccf3745
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221601
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34290}

Bug: webrtc:12837
Change-Id: I30a8f03165ab797ed766b51c4eb15c2a9cecb5ed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228500
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34727}
2021-08-11 21:50:08 +00:00
Taylor Brandstetter
a03d494224 Revert "Modify Bundle logic to not add & destroy extra transport at add-track"
This reverts commit I41cae74605fecf454900a958776b95607ccf3745

Reason for revert: Needed in order to cherry pick this revert into M93,
in order to fix crbug.com/1236202.

Original change description:

> If a bundle is established, then per JSEP, the offerer is required to
> include the new track in the bundle, and per BUNDLE, the answerer has
> to either accept the track as part of the bundle or reject the track;
> it cannot move it out of the group. So we will never need the transport.
>
> Bug: webrtc:12837
> Change-Id: I41cae74605fecf454900a958776b95607ccf3745
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221601
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34290}

TBR=hta@webrtc.org

Bug: webrtc:12837, chromium:1236202
Change-Id: Ie59e2ad5168e6829eefa67b1031b8f400ed66507
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227822
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34669}
2021-08-06 21:43:09 +00:00
Taylor Brandstetter
b92f9856b5 Revert "Reland "Fix bug where we assume new m= sections will always be bundled.""
This reverts commit 704a834f68.

Reason for revert: Reverting this in order to revert
https://webrtc-review.googlesource.com/c/src/+/221601, so we can
merge that revert to M93.

Original change's description:
> Reland "Fix bug where we assume new m= sections will always be bundled."
>
> This is a reland of d2b885fd91, after
> making sure transports that are just being kept alive in case of
> rollback don't contribute to connection state, which broke a WPT.
>
> Original change's description:
> > Fix bug where we assume new m= sections will always be bundled.
> >
> > A recent change [1] assumes that all new m= sections will share the
> > first BUNDLE group (if one already exists), which avoids generating
> > ICE candidates that are ultimately unnecessary. This is fine for JSEP
> > endpoints, but it breaks the following scenarios for non-JSEP endpoints:
> >
> > * Remote offer adding a new m= section that's not part of any BUNDLE
> >   group.
> > * Remote offer adding an m= section to the second BUNDLE group.
> >
> > The latter is specifically problematic for any application that wants
> > to bundle all audio streams in one group and all video streams in
> > another group when using Unified Plan SDP, to replicate the behavior of
> > using Plan B without bundling. It may try to add a video stream only
> > for WebRTC to bundle it with audio.
> >
> > This is fixed by doing some minor re-factoring, having BundleManager
> > update the bundle groups at offer time.
> >
> > Also:
> > * Added some additional validation for multiple bundle groups in a
> >   subsequent offer, since that now becomes relevant.
> > * Improved rollback support, because now rolling back an offer may need
> >   to not only remove mid->transport mappings but alter them.
> >
> > [1]: https://webrtc-review.googlesource.com/c/src/+/221601
> >
> > Bug: webrtc:12906, webrtc:12999
> > Change-Id: I4c6e7020c0be33a782d3608dee88e4e2fceb1be1
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225642
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Reviewed-by: Henrik Boström <hbos@webrtc.org>
> > Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#34544}
>
> Bug: webrtc:12906, webrtc:12999
> Change-Id: I68bf988b1918dd2d51de76e53e4fd696fea5a09b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227120
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34596}

TBR=hta@webrtc.org

Bug: webrtc:12906, webrtc:12999
Change-Id: I129d9eb3b9831317fa24b0263db191027246cb99
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227821
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34666}
2021-08-06 19:53:09 +00:00
Artem Titov
880fa8169b Reland "Use backticks not vertical bars to denote variables in comments for /pc"
Original change's description:
> Revert "Use backticks not vertical bars to denote variables in comments for /pc"
>
> This reverts commit 37ee0f5e59.
>
> Reason for revert: Revert in order to be able to revert https://webrtc-review.googlesource.com/c/src/+/225642
>
> Original change's description:
> > Use backticks not vertical bars to denote variables in comments for /pc
> >
> > Bug: webrtc:12338
> > Change-Id: I88cf10afa5fc810b95d2a585ab2e895dcc163b63
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226953
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Commit-Queue: Artem Titov <titovartem@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#34575}
>
> TBR=hta@webrtc.org,titovartem@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: I5eddd3a14e1f664bf831e5c294fbc4de5f6a88af
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:12338
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227082
> Reviewed-by: Björn Terelius <terelius@webrtc.org>
> Commit-Queue: Björn Terelius <terelius@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34577}

Bug: webrtc:12338
Change-Id: I96bd229b73613c162d11d75fa4f5934e1b4295c7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227087
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34611}
2021-07-30 22:13:59 +00:00
Taylor Brandstetter
704a834f68 Reland "Fix bug where we assume new m= sections will always be bundled."
This is a reland of d2b885fd91, after
making sure transports that are just being kept alive in case of
rollback don't contribute to connection state, which broke a WPT.

Original change's description:
> Fix bug where we assume new m= sections will always be bundled.
>
> A recent change [1] assumes that all new m= sections will share the
> first BUNDLE group (if one already exists), which avoids generating
> ICE candidates that are ultimately unnecessary. This is fine for JSEP
> endpoints, but it breaks the following scenarios for non-JSEP endpoints:
>
> * Remote offer adding a new m= section that's not part of any BUNDLE
>   group.
> * Remote offer adding an m= section to the second BUNDLE group.
>
> The latter is specifically problematic for any application that wants
> to bundle all audio streams in one group and all video streams in
> another group when using Unified Plan SDP, to replicate the behavior of
> using Plan B without bundling. It may try to add a video stream only
> for WebRTC to bundle it with audio.
>
> This is fixed by doing some minor re-factoring, having BundleManager
> update the bundle groups at offer time.
>
> Also:
> * Added some additional validation for multiple bundle groups in a
>   subsequent offer, since that now becomes relevant.
> * Improved rollback support, because now rolling back an offer may need
>   to not only remove mid->transport mappings but alter them.
>
> [1]: https://webrtc-review.googlesource.com/c/src/+/221601
>
> Bug: webrtc:12906, webrtc:12999
> Change-Id: I4c6e7020c0be33a782d3608dee88e4e2fceb1be1
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225642
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34544}

Bug: webrtc:12906, webrtc:12999
Change-Id: I68bf988b1918dd2d51de76e53e4fd696fea5a09b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227120
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34596}
2021-07-30 00:02:53 +00:00
Björn Terelius
dc364e5bc2 Revert "Fix bug where we assume new m= sections will always be bundled."
This reverts commit d2b885fd91.

Reason for revert: Speculative revert for Chromium importer

Original change's description:
> Fix bug where we assume new m= sections will always be bundled.
>
> A recent change [1] assumes that all new m= sections will share the
> first BUNDLE group (if one already exists), which avoids generating
> ICE candidates that are ultimately unnecessary. This is fine for JSEP
> endpoints, but it breaks the following scenarios for non-JSEP endpoints:
>
> * Remote offer adding a new m= section that's not part of any BUNDLE
>   group.
> * Remote offer adding an m= section to the second BUNDLE group.
>
> The latter is specifically problematic for any application that wants
> to bundle all audio streams in one group and all video streams in
> another group when using Unified Plan SDP, to replicate the behavior of
> using Plan B without bundling. It may try to add a video stream only
> for WebRTC to bundle it with audio.
>
> This is fixed by doing some minor re-factoring, having BundleManager
> update the bundle groups at offer time.
>
> Also:
> * Added some additional validation for multiple bundle groups in a
>   subsequent offer, since that now becomes relevant.
> * Improved rollback support, because now rolling back an offer may need
>   to not only remove mid->transport mappings but alter them.
>
> [1]: https://webrtc-review.googlesource.com/c/src/+/221601
>
> Bug: webrtc:12906, webrtc:12999
> Change-Id: I4c6e7020c0be33a782d3608dee88e4e2fceb1be1
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225642
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34544}

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

Bug: webrtc:12906, webrtc:12999
Change-Id: I00179d7573f322ad539ff16cad1f85320cfb2270
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227081
Reviewed-by: Björn Terelius <terelius@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34578}
2021-07-28 00:11:43 +00:00
Björn Terelius
fd05d6f504 Revert "Use backticks not vertical bars to denote variables in comments for /pc"
This reverts commit 37ee0f5e59.

Reason for revert: Revert in order to be able to revert https://webrtc-review.googlesource.com/c/src/+/225642

Original change's description:
> Use backticks not vertical bars to denote variables in comments for /pc
>
> Bug: webrtc:12338
> Change-Id: I88cf10afa5fc810b95d2a585ab2e895dcc163b63
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226953
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Artem Titov <titovartem@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34575}

TBR=hta@webrtc.org,titovartem@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I5eddd3a14e1f664bf831e5c294fbc4de5f6a88af
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:12338
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227082
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34577}
2021-07-27 22:10:24 +00:00
Artem Titov
37ee0f5e59 Use backticks not vertical bars to denote variables in comments for /pc
Bug: webrtc:12338
Change-Id: I88cf10afa5fc810b95d2a585ab2e895dcc163b63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226953
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34575}
2021-07-27 20:52:02 +00:00
Taylor Brandstetter
d2b885fd91 Fix bug where we assume new m= sections will always be bundled.
A recent change [1] assumes that all new m= sections will share the
first BUNDLE group (if one already exists), which avoids generating
ICE candidates that are ultimately unnecessary. This is fine for JSEP
endpoints, but it breaks the following scenarios for non-JSEP endpoints:

* Remote offer adding a new m= section that's not part of any BUNDLE
  group.
* Remote offer adding an m= section to the second BUNDLE group.

The latter is specifically problematic for any application that wants
to bundle all audio streams in one group and all video streams in
another group when using Unified Plan SDP, to replicate the behavior of
using Plan B without bundling. It may try to add a video stream only
for WebRTC to bundle it with audio.

This is fixed by doing some minor re-factoring, having BundleManager
update the bundle groups at offer time.

Also:
* Added some additional validation for multiple bundle groups in a
  subsequent offer, since that now becomes relevant.
* Improved rollback support, because now rolling back an offer may need
  to not only remove mid->transport mappings but alter them.

[1]: https://webrtc-review.googlesource.com/c/src/+/221601

Bug: webrtc:12906, webrtc:12999
Change-Id: I4c6e7020c0be33a782d3608dee88e4e2fceb1be1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225642
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34544}
2021-07-23 22:08:00 +00:00
Mirko Bonadei
96dca92046 [sigslot] - Remove sigslot from JsepTransport.
Bug: webrtc:11943
Change-Id: I59231cf0d5b700d0ef2feb94d9619b8b4d30d655
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225552
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34529}
2021-07-22 14:07:26 +00:00
Harald Alvestrand
11b92cfa65 Refactoring: Move groups-by-mid into Bundle manager
Bug: webrtc:12837
Change-Id: I2431dbbf8cc291b5f3848d81cf290fd3e97ec15d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222614
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34324}
2021-06-17 14:35:33 +00:00
Harald Alvestrand
de22ab2850 Apply IWYU to jsep_transport_controller/collection
Bug: None
Change-Id: I7b584099fcc26d7d74f2e08a0939a89a9196cd00
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222612
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34323}
2021-06-17 14:01:11 +00:00
Harald Alvestrand
7a2db8acbe Modify Bundle logic to not add & destroy extra transport at add-track
If a bundle is established, then per JSEP, the offerer is required to
include the new track in the bundle, and per BUNDLE, the answerer has
to either accept the track as part of the bundle or reject the track;
it cannot move it out of the group. So we will never need the transport.

Bug: webrtc:12837
Change-Id: I41cae74605fecf454900a958776b95607ccf3745
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221601
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34290}
2021-06-15 09:44:36 +00:00
Harald Alvestrand
4bb81aca75 Make JsepTransportCollection self-managing for transports
This entails instantly deleting the transport when it is no longer
referenced by any MID.

Also adds consistency checks to JsepTransportCollection.

Bug: webrtc:12837
Change-Id: I85775aeb676aac3a9aee74280cc72ac87a0f49b5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221982
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34273}
2021-06-11 16:12:11 +00:00
Harald Alvestrand
9dea393f17 Move MID/JsepTransport mappings into a new manager object.
This is part of the work to make Bundle handling understandable,
so that we can get it to work right.

Bug: webrtc:12837
Change-Id: I77f046b4bac2d9709460b3b956a2edc3df0cdaac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221745
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34261}
2021-06-10 07:10:47 +00:00
Harald Alvestrand
2aa24f1942 Move group-modifying functions into BundleManager
Bug: webrtc:12837
Change-Id: I886ec89427207e1dc291c9959f1b6113c97cbca3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221616
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34246}
2021-06-08 12:19:33 +00:00
Harald Alvestrand
9f9bf38805 Start refactoring bundle behavior into BundleManager
This is step 1: Encapsulating the data.

Bug: webrtc:12837
Change-Id: I15df30dc294c90136a90b072608ed4c2e8925dcb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221602
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34245}
2021-06-08 08:52:25 +00:00
Markus Handell
518669d6d4 Add more trace events to interesting places.
Bug: webrtc:12840
Change-Id: I57e5373ae33060bd3743cea8ada21c845cbbd944
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221365
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34237}
2021-06-07 13:43:07 +00:00
Lennart Grahl
0d0ed76ac1 Fix RTP header extension encryption
Reland of commit a743303211

Previously, RTP header extensions with encryption had been filtered
if the encryption had been activated (not the other way around) which
was likely an unintended logic inversion.

In addition, it ensures that encrypted RTP header extensions are only
negotiated if RTP header extension encryption is turned on. Formerly,
which extensions had been negotiated depended on the order in which
they were inserted, regardless of whether or not header encryption was
actually enabled, leading to no extensions being sent on the wire.

Further changes:

- If RTP header encryption enabled, prefer encrypted extensions over
  non-encrypted extensions
- Add most extensions to list of extensions supported for encryption
- Discard encrypted extensions in a session description in case encryption
  is not supported for that extension
- Mark FindHeaderExtensionByUri without filter argument as deprecated

Bug: webrtc:11713
Change-Id: I52a5ade1b94bc01d1c2a35cb56023684fcaf9982
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219081
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34129}
2021-05-26 09:42:09 +00:00
Mirko Bonadei
9f6808b13c Remove cricket::DtlsTransportState.
Bug: webrtc:12762
Change-Id: I7a6535f7ce57b1d521364f3c62086377f5aebf57
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/218600
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34087}
2021-05-21 21:45:29 +00:00
Henrik Boström
f8187e0a82 [Unified Plan] Support multiple BUNDLE groups.
In this CL, JsepTransportController and MediaSessionDescriptionFactory
are updated not to assume that there only exists at most a single BUNDLE
group but a list of N groups. This makes it possible to create multiple
BUNDLE groups by having multiple "a=group:BUNDLE" lines in the SDP.

This makes it possible to have some m= sections in one group and some
other m= sections in another group. For example, you could group all
audio m= sections in one group and all video m= sections in another
group. This enables "send all audio tracks on one transport and all
video tracks on another transport" in Unified Plan. This is something
that was possible in Plan B because all ssrcs in the same m= section
were implicitly bundled together forming a group of audio m= section and
video m= section (even without use of the BUNDLE tag).

PeerConnection will never create multiple BUNDLE groups by default, but
upon setting SDP with multiple BUNDLE groups the PeerConnection will
accept them if configured to accept BUNDLE. This makes it possible to
accept an SFU's BUNDLE offer without having to SDP munge the answer.

C++ unit tests are added. This fix has also been verified manually on:
https://jsfiddle.net/henbos/to89L6ce/43/

Without fix: 0+2 get bundled, 1+3 don't get bundled.
With fix: 0+2 get bundled in first group, 1+3 get bundled in second
group.

Bug: webrtc:10208
Change-Id: Iaf451fa5459c484730c8018274166ef154b19af8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214487
Reviewed-by: Taylor <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33838}
2021-04-27 05:53:37 +00:00
Björn Terelius
24bc419303 Revert "Fix RTP header extension encryption"
This reverts commit a743303211.

Reason for revert: Breaks downstream tests that attempt to call FindHeaderExtensionByUri with 2 arguments. Could you keep the old 2-argument method declaration and just forward the call to the new 3-argument method with a suitable no-op filter?

Original change's description:
> Fix RTP header extension encryption
>
> Previously, RTP header extensions with encryption had been filtered
> if the encryption had been activated (not the other way around) which
> was likely an unintended logic inversion.
>
> In addition, it ensures that encrypted RTP header extensions are only
> negotiated if RTP header extension encryption is turned on. Formerly,
> which extensions had been negotiated depended on the order in which
> they were inserted, regardless of whether or not header encryption was
> actually enabled, leading to no extensions being sent on the wire.
>
> Further changes:
>
> - If RTP header encryption enabled, prefer encrypted extensions over
>   non-encrypted extensions
> - Add most extensions to list of extensions supported for encryption
> - Discard encrypted extensions in a session description in case encryption
>   is not supported for that extension
>
> Note that this depends on https://github.com/cisco/libsrtp/pull/491 to get
> into libwebrtc (cherry-pick or bump libsrtp version). Otherwise, two-byte
> header extensions will prevent any RTP packets being sent/received.
>
> Bug: webrtc:11713
> Change-Id: Ia0779453d342fa11e06996d9bc2d3c826f3466d3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177980
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Taylor <deadbeef@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33723}

TBR=deadbeef@webrtc.org,terelius@webrtc.org,hta@webrtc.org,lennart.grahl@gmail.com

Change-Id: I7df6b0fa611c6496dccdfb09a65ff33ae4a52b26
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11713
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215222
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33727}
2021-04-14 10:10:07 +00:00
Lennart Grahl
a743303211 Fix RTP header extension encryption
Previously, RTP header extensions with encryption had been filtered
if the encryption had been activated (not the other way around) which
was likely an unintended logic inversion.

In addition, it ensures that encrypted RTP header extensions are only
negotiated if RTP header extension encryption is turned on. Formerly,
which extensions had been negotiated depended on the order in which
they were inserted, regardless of whether or not header encryption was
actually enabled, leading to no extensions being sent on the wire.

Further changes:

- If RTP header encryption enabled, prefer encrypted extensions over
  non-encrypted extensions
- Add most extensions to list of extensions supported for encryption
- Discard encrypted extensions in a session description in case encryption
  is not supported for that extension

Note that this depends on https://github.com/cisco/libsrtp/pull/491 to get
into libwebrtc (cherry-pick or bump libsrtp version). Otherwise, two-byte
header extensions will prevent any RTP packets being sent/received.

Bug: webrtc:11713
Change-Id: Ia0779453d342fa11e06996d9bc2d3c826f3466d3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177980
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Taylor <deadbeef@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33723}
2021-04-14 08:53:45 +00:00
Tomas Gunnarsson
e1c8a43b2a Reduce thread hops in StatsCollector and fix incorrect variable access.
StatsCollector::ExtractSessionInfo was run fully on the signaling thread
and several calls were being made to methods that need to run on the
network thread.

Additionally, BaseChannel::transport_name() was being read directly
on the signaling thread (needs to be read on the network thread).
So with shifting the work that needs to happen on the network thread
over to that thread, we now also grab the transport name there and
use the name with the work that still needs to happen on the signaling
thread.

These changes allow us to remove Invoke<>() calls to the network thread from
callback functions implemented in PeerConnection:
* GetPooledCandidateStats
* GetTransportNamesByMid
* GetTransportStatsByNames
* Also adding a correctness thread check to:
  * GetLocalCertificate
  * GetRemoteSSLCertChain

Because PeerConnection now has a way of knowing when things are
or have been uninitialized on the network thread, all of these
functions can exit early without doing throw away work.

Additionally removing thread hops that aren't needed anymore from
JsepTransportController.

Using the RTC_LOG_THREAD_BLOCK_COUNT() macro in GetStats, the number
of Invokes (when >1), goes down by 3. Typically from 8->5, 7->4, 6->3.

Bug: webrtc:11687
Change-Id: I06ab25eab301e192e99076d7891444bcb61b491f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214135
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33656}
2021-04-08 14:06:20 +00:00
Harald Alvestrand
0ccfbd2de7 Reland "Use the new DNS resolver API in PeerConnection"
This reverts commit 5a40b37105.

Reason for revert: Fixed the bug and ran layout tests.

Original change's description:
> Revert "Use the new DNS resolver API in PeerConnection"
>
> This reverts commit acf8ccb3c9.
>
> Reason for revert: Speculative revert for https://ci.chromium.org/ui/p/chromium/builders/try/win10_chromium_x64_rel_ng/b8851745102358680592/overview.
>
> Original change's description:
> > Use the new DNS resolver API in PeerConnection
> >
> > Bug: webrtc:12598
> > Change-Id: I5a14058e7f28c993ed927749df7357c715ba83fb
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212961
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#33561}
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> TBR=hta@webrtc.org
>
> Bug: webrtc:12598
> Change-Id: Idc9853cb569849c49052f9cbd865614710fff979
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/213188
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33591}

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

Bug: webrtc:12598
Change-Id: Ief7867f2f23de66504877cdab1b23a11df2d5de4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214120
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33647}
2021-04-08 08:44:14 +00:00
Tommi
653bab6790 Simplify DtlsTransport state.
Make a few more members const, remove members that aren't used,
set max ssl version number on construction and remove setter.

Bug: none
Change-Id: I6c1a7cabf1e795e027f1bc53b994517e9aef0e93
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/213780
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33622}
2021-04-03 17:21:41 +00:00
Mirko Bonadei
5a40b37105 Revert "Use the new DNS resolver API in PeerConnection"
This reverts commit acf8ccb3c9.

Reason for revert: Speculative revert for https://ci.chromium.org/ui/p/chromium/builders/try/win10_chromium_x64_rel_ng/b8851745102358680592/overview.

Original change's description:
> Use the new DNS resolver API in PeerConnection
>
> Bug: webrtc:12598
> Change-Id: I5a14058e7f28c993ed927749df7357c715ba83fb
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212961
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33561}

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

TBR=hta@webrtc.org

Bug: webrtc:12598
Change-Id: Idc9853cb569849c49052f9cbd865614710fff979
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/213188
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33591}
2021-03-30 08:37:01 +00:00
Harald Alvestrand
acf8ccb3c9 Use the new DNS resolver API in PeerConnection
Bug: webrtc:12598
Change-Id: I5a14058e7f28c993ed927749df7357c715ba83fb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212961
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33561}
2021-03-25 11:28:41 +00:00
Lahiru Ginnaliya Gamathige
c32f00ea9d Remove usage of sigslot and replace with a function pointer.
- Deleted unused sigslot.

Bug: webrtc:11943
Change-Id: I7863dd04e3e63fcba0eabd0dd752ab339614814e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/207840
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Lahiru Ginnaliya Gamathige <glahiru@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33327}
2021-02-24 06:40:09 +00:00
Tomas Gunnarsson
8cb9706288 AddRemoteCandidate on the network thread
SdpOfferAnswerHandler now hands over most of the work of adding a
remote candidate over to PeerConnection where the work will be
carried out asynchronously on the network thread (was
synchronous/blocking).

Once added, reporting (ReportRemoteIceCandidateAdded) continues on the
signaling thread as before. The difference is though that we don't
block the UseCandidate() operation which is a part of applying the
local and remote descriptions.

Besides now being asynchronous, there's one behavioural change:
Before starting the 'add' operation, the validity of the candidate
instance to be added, is checked. Previously if such an error occurred,
the error was silently ignored.

Bug: webrtc:9987
Change-Id: Ic1bfb8e27670fc81038b6ccec95ff36c65d12262
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206063
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33230}
2021-02-11 09:54:45 +00:00
Tommi
c3257d0c77 Reland "Remove thread hops from events provided by JsepTransportController."
This reverts commit 6e4fcac313.

Reason for revert: Parent CL issue has been resolved.

Original change's description:
> Revert "Remove thread hops from events provided by JsepTransportController."
>
> This reverts commit f554b3c577.
>
> Reason for revert: Parent CL breaks FYI bots.
> See https://webrtc-review.googlesource.com/c/src/+/206466
>
> Original change's description:
> > Remove thread hops from events provided by JsepTransportController.
> >
> > Events associated with Subscribe* methods in JTC had trampolines that
> > would use an async invoker to fire the events on the signaling thread.
> > This was being done for the purposes of PeerConnection but the concept
> > of a signaling thread is otherwise not applicable to JTC and use of
> > JTC from PC is inconsistent across threads (as has been flagged in
> > webrtc:9987).
> >
> > This change makes all CallbackList members only accessible from the
> > network thread and moves the signaling thread related work over to
> > PeerConnection, which makes hops there more visible as well as making
> > that class easier to refactor for thread efficiency.
> >
> > This CL removes the AsyncInvoker from JTC (webrtc:12339)
> >
> > The signaling_thread_ variable is also removed from JTC and more thread
> > checks added to catch errors.
> >
> > Bug: webrtc:12427, webrtc:11988, webrtc:12339
> > Change-Id: Id232aedd00dfd5403b2ba0ca147d3eca7c12c7c5
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206062
> > Commit-Queue: Tommi <tommi@webrtc.org>
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#33195}
>
> TBR=nisse@webrtc.org,tommi@webrtc.org
>
> Change-Id: I6134b71b74a9408854b79d44506d513519e9cf4d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:12427
> Bug: webrtc:11988
> Bug: webrtc:12339
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206467
> Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
> Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33203}

TBR=nisse@webrtc.org,tommi@webrtc.org,guidou@webrtc.org

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

Bug: webrtc:12427
Bug: webrtc:11988
Bug: webrtc:12339
Change-Id: I4e2e1490e1f9a87ed6ac4d722fd3c442e3059ae0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206809
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33225}
2021-02-11 07:21:55 +00:00
Artem Titov
d15a575ec3 Use SequenceChecker from public API
Bug: webrtc:12419
Change-Id: I00cca16a0ec70246156ba00b97aa7ae5ccbf5364
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205323
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33220}
2021-02-10 15:04:55 +00:00
Tomas Gunnarsson
92eebefd47 Reland "Fix unsynchronized access to mid_to_transport_ in JsepTransportController"
This reverts commit 6b143c1c06.

Reason for revert:
  Relanding with updated expectations for SctpTransport::Information
  based on TransceiverStateSurfacer in Chromium.


Original change's description:
> Revert "Fix unsynchronized access to mid_to_transport_ in JsepTransportController"
>
> This reverts commit 6cd4058504.
>
> Reason for revert: Breaks WebRTC Chromium FYI Bots
>
> First failure:
> https://ci.chromium.org/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20Android%20Tests%20%28dbg%29%20%28L%20Nexus5%29/1925
>
> Failed tests:
> WebRtcDataBrowserTest.CallWithSctpDataAndMedia
> WebRtcDataBrowserTest.CallWithSctpDataOnly
>
> Original change's description:
> > Fix unsynchronized access to mid_to_transport_ in JsepTransportController
> >
> > * Added several thread checks to JTC to help with programmer errors.
> > * Avoid a few Invokes() to the network thread here and there such
> >   as for fetching sctp transport name for getStats(). The transport
> >   name is now cached when it changes on the network thread.
> > * JsepTransportController instances now get deleted on the network
> >   thread rather than on the signaling thread + issuing an Invoke()
> >   in the dtor.
> > * Moved some thread hops from JTC over to PC which is where the problem
> >   exists and also (imho) makes it easier to see where hops happen in
> >   the PC code.
> > * The sctp transport is now started asynchronously when we push down the
> >   media description.
> > * PeerConnection proxy calls GetSctpTransport directly on the network
> >   thread instead of to the signaling thread + blocking on the network
> >   thread.
> > * The above changes simplified things for webrtc::SctpTransport which
> >   allowed for removing locking from that class and delete some code.
> >
> > Bug: webrtc:9987, webrtc:12445
> > Change-Id: Ic89a9426e314e1b93c81751d4f732f05fa448fbc
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205620
> > Commit-Queue: Tommi <tommi@webrtc.org>
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#33191}
>
> TBR=tommi@webrtc.org,hta@webrtc.org
>
> Change-Id: I7b2913d5133807589461105cf07eff3e9bb7157e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:9987
> Bug: webrtc:12445
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206466
> Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
> Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33204}

TBR=tommi@webrtc.org,hta@webrtc.org,guidou@webrtc.org

# Not skipping CQ checks because this is a reland.

Bug: webrtc:9987
Bug: webrtc:12445
Change-Id: Icb205cbac493ed3b881d71ea3af4fb9018701bf4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206560
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33219}
2021-02-10 13:40:22 +00:00
Guido Urdaneta
6b143c1c06 Revert "Fix unsynchronized access to mid_to_transport_ in JsepTransportController"
This reverts commit 6cd4058504.

Reason for revert: Breaks WebRTC Chromium FYI Bots

First failure:
https://ci.chromium.org/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20Android%20Tests%20%28dbg%29%20%28L%20Nexus5%29/1925

Failed tests:
WebRtcDataBrowserTest.CallWithSctpDataAndMedia
WebRtcDataBrowserTest.CallWithSctpDataOnly

Original change's description:
> Fix unsynchronized access to mid_to_transport_ in JsepTransportController
>
> * Added several thread checks to JTC to help with programmer errors.
> * Avoid a few Invokes() to the network thread here and there such
>   as for fetching sctp transport name for getStats(). The transport
>   name is now cached when it changes on the network thread.
> * JsepTransportController instances now get deleted on the network
>   thread rather than on the signaling thread + issuing an Invoke()
>   in the dtor.
> * Moved some thread hops from JTC over to PC which is where the problem
>   exists and also (imho) makes it easier to see where hops happen in
>   the PC code.
> * The sctp transport is now started asynchronously when we push down the
>   media description.
> * PeerConnection proxy calls GetSctpTransport directly on the network
>   thread instead of to the signaling thread + blocking on the network
>   thread.
> * The above changes simplified things for webrtc::SctpTransport which
>   allowed for removing locking from that class and delete some code.
>
> Bug: webrtc:9987, webrtc:12445
> Change-Id: Ic89a9426e314e1b93c81751d4f732f05fa448fbc
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205620
> Commit-Queue: Tommi <tommi@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33191}

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

Change-Id: I7b2913d5133807589461105cf07eff3e9bb7157e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9987
Bug: webrtc:12445
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206466
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33204}
2021-02-09 12:27:32 +00:00
Guido Urdaneta
6e4fcac313 Revert "Remove thread hops from events provided by JsepTransportController."
This reverts commit f554b3c577.

Reason for revert: Parent CL breaks FYI bots.
See https://webrtc-review.googlesource.com/c/src/+/206466

Original change's description:
> Remove thread hops from events provided by JsepTransportController.
>
> Events associated with Subscribe* methods in JTC had trampolines that
> would use an async invoker to fire the events on the signaling thread.
> This was being done for the purposes of PeerConnection but the concept
> of a signaling thread is otherwise not applicable to JTC and use of
> JTC from PC is inconsistent across threads (as has been flagged in
> webrtc:9987).
>
> This change makes all CallbackList members only accessible from the
> network thread and moves the signaling thread related work over to
> PeerConnection, which makes hops there more visible as well as making
> that class easier to refactor for thread efficiency.
>
> This CL removes the AsyncInvoker from JTC (webrtc:12339)
>
> The signaling_thread_ variable is also removed from JTC and more thread
> checks added to catch errors.
>
> Bug: webrtc:12427, webrtc:11988, webrtc:12339
> Change-Id: Id232aedd00dfd5403b2ba0ca147d3eca7c12c7c5
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206062
> Commit-Queue: Tommi <tommi@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33195}

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

Change-Id: I6134b71b74a9408854b79d44506d513519e9cf4d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:12427
Bug: webrtc:11988
Bug: webrtc:12339
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206467
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33203}
2021-02-09 12:26:26 +00:00
Tomas Gunnarsson
f554b3c577 Remove thread hops from events provided by JsepTransportController.
Events associated with Subscribe* methods in JTC had trampolines that
would use an async invoker to fire the events on the signaling thread.
This was being done for the purposes of PeerConnection but the concept
of a signaling thread is otherwise not applicable to JTC and use of
JTC from PC is inconsistent across threads (as has been flagged in
webrtc:9987).

This change makes all CallbackList members only accessible from the
network thread and moves the signaling thread related work over to
PeerConnection, which makes hops there more visible as well as making
that class easier to refactor for thread efficiency.

This CL removes the AsyncInvoker from JTC (webrtc:12339)

The signaling_thread_ variable is also removed from JTC and more thread
checks added to catch errors.

Bug: webrtc:12427, webrtc:11988, webrtc:12339
Change-Id: Id232aedd00dfd5403b2ba0ca147d3eca7c12c7c5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206062
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33195}
2021-02-08 17:52:01 +00:00
Tomas Gunnarsson
6cd4058504 Fix unsynchronized access to mid_to_transport_ in JsepTransportController
* Added several thread checks to JTC to help with programmer errors.
* Avoid a few Invokes() to the network thread here and there such
  as for fetching sctp transport name for getStats(). The transport
  name is now cached when it changes on the network thread.
* JsepTransportController instances now get deleted on the network
  thread rather than on the signaling thread + issuing an Invoke()
  in the dtor.
* Moved some thread hops from JTC over to PC which is where the problem
  exists and also (imho) makes it easier to see where hops happen in
  the PC code.
* The sctp transport is now started asynchronously when we push down the
  media description.
* PeerConnection proxy calls GetSctpTransport directly on the network
  thread instead of to the signaling thread + blocking on the network
  thread.
* The above changes simplified things for webrtc::SctpTransport which
  allowed for removing locking from that class and delete some code.

Bug: webrtc:9987, webrtc:12445
Change-Id: Ic89a9426e314e1b93c81751d4f732f05fa448fbc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205620
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33191}
2021-02-08 14:45:25 +00:00
Niels Möller
ab9d6e1fd2 Delete null JsepTransport constructor argument datagram_rtp_transport.
Bug: None
Change-Id: I97f2024a6d2811fa15bc5c93fd9d85982daa57fa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205321
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33175}
2021-02-05 10:08:46 +00:00
Tomas Gunnarsson
20f7456da9 Fix unsynchronized access to jsep_transports_by_name_.
Also removing need for lock for ice restart flag, fix call paths and
add information about how JsepTransportController's events could live
fully on the network thread and complexity around signaling thread
should be handled by PeerConnection (more details in webrtc:12427).

Bug: webrtc:12426, webrtc:12427
Change-Id: I9b1fae8acf16d90d9716054fc3c390700877a82a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205221
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33159}
2021-02-04 10:59:16 +00:00
Lahiru Ginnaliya Gamathige
16ab60c4c6 Use CallbackList in DtlsHandshakeError in dtls_transport.
- Signal is transferred from jsep_transport_controller to dtls_transport,
  jsep_transport_controller is already using Callbacklist and this
  modified the dtls_transport to use callback_list.

Bug: webrtc:11943
Change-Id: I4a7ed08e6dab21b8eb515d4d8971f9b084fb8c86
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203722
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Lahiru Ginnaliya Gamathige <glahiru@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33137}
2021-02-02 17:17:22 +00:00