Commit graph

714 commits

Author SHA1 Message Date
Fredrik Solenberg
4bed30c37f Remove sigslot signals from TurnPort
Bug: webrtc:11943
Change-Id: If07749a4fa47bd06a2a11be9d334a4a39a1026b1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272651
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37998}
2022-09-02 15:37:13 +00:00
Sameer Vijaykar
2e70294b7c Ship family-specific STUN hostname resolution behind field trial param.
Since multiple fixes are bundled behind the WebRTC-IPv6NetworkResolutionFixes
field trial, this allows more flexibility if the launch is found to cause any
issues.

Bug: webrtc:14334, webrtc:14131
Change-Id: I2e73b8984db1f3d292cecab98e29c53cfac1c070
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273903
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Auto-Submit: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#37995}
2022-09-02 14:01:31 +00:00
Diep Bui
a5d80a7646 Add PreferGlobalIPv6Address param to IPv6NetworkResolutionFixes field trial string.
Bug: webrtc:14334
Change-Id: Iedbc18d2ebd77b4fedd4e7936a5aa4da35279328
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273101
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Sameer Vijaykar <samvi@google.com>
Reviewed-by: Diep Bui <diepbp@webrtc.org>
Commit-Queue: Diep Bui <diepbp@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37991}
2022-09-02 10:39:58 +00:00
Diep Bui
9068f456a3 Improve IPv6 selection logic when gathering candidates.
- If there are more than 5 IPv6 networks, then diversify IPv6 interface types selection.
- Passing field_trial from peer_connection_factory.cc when creating BasicPortAllocator object.

Bug: webrtc:14334
Change-Id: I7d100d944f4e60414e3421f422997bc3f168cc24
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271581
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Diep Bui <diepbp@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37924}
2022-08-29 10:51:28 +00:00
Danil Chapovalov
b7da81621c Replace RTCCertificateGeneratorCallback interface with an AnyInvocable
follow up of the https://webrtc-review.googlesource.com/c/src/+/272402

Bug: None
Change-Id: Ie47aff9fccdb4037c1f560801c780dd549b373ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272553
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37870}
2022-08-22 16:53:14 +00:00
Danil Chapovalov
34f6d1c06d Migrate cricket::Port asynchronous calls to TaskQueueBase interface
Bug: webrtc:9702
Change-Id: I13e05ced190ca64a217961d74ee92dd9c15ed8ce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271641
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37849}
2022-08-19 21:35:47 +00:00
Philipp Hancke
4a3b5ccfd5 Reland "dtls: allow dtls role to change during DTLS restart"
This is a reland of commit 02b5f3c9c1
without making SetRemoteFingerprint private (but adding a deprecation warning)

Original change's description:
> dtls: allow dtls role to change during DTLS restart
>
> which is characterized by a change in remote fingerprint and
> causes a new DTLS handshake. This allows renegotiating the
> client/server role as well.
> Spec guidance is provided by
>   https://www.rfc-editor.org/rfc/rfc5763#section-6.6
>
> BUG=webrtc:5768
>
> Change-Id: I0e8630c0c5907cc92720762a4320ad21a6190d28
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271680
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#37821}

Bug: webrtc:5768
Change-Id: I8dd674db8b683160013e1b4aa7776775d130978f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272221
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#37838}
2022-08-19 10:55:47 +00:00
Danil Chapovalov
4d715385e1 Remove rtc::MessageHandler usage in pseudo tcp unittests
Bug: webrtc:11988
Change-Id: Iac41f18410828333b40012d4876db23673d198d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272283
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37834}
2022-08-19 09:19:46 +00:00
Björn Terelius
fb5fc4307d Revert "dtls: allow dtls role to change during DTLS restart"
This reverts commit 02b5f3c9c1.

Reason for revert: SetRemoteFingerprint called by downstream code.

Original change's description:
> dtls: allow dtls role to change during DTLS restart
>
> which is characterized by a change in remote fingerprint and
> causes a new DTLS handshake. This allows renegotiating the
> client/server role as well.
> Spec guidance is provided by
>   https://www.rfc-editor.org/rfc/rfc5763#section-6.6
>
> BUG=webrtc:5768
>
> Change-Id: I0e8630c0c5907cc92720762a4320ad21a6190d28
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271680
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#37821}

Bug: webrtc:5768
Change-Id: I266b7fdc9cc0b6dc9d3fa732fca37407b98e0816
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272220
Owners-Override: Björn Terelius <terelius@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37822}
2022-08-18 11:49:56 +00:00
Philipp Hancke
02b5f3c9c1 dtls: allow dtls role to change during DTLS restart
which is characterized by a change in remote fingerprint and
causes a new DTLS handshake. This allows renegotiating the
client/server role as well.
Spec guidance is provided by
  https://www.rfc-editor.org/rfc/rfc5763#section-6.6

BUG=webrtc:5768

Change-Id: I0e8630c0c5907cc92720762a4320ad21a6190d28
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271680
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#37821}
2022-08-18 11:23:16 +00:00
Danil Chapovalov
e51918f9ce Cleanup TurnServer
Use TimeDelta type instead of raw ints
Remove usage of rtc::MessageHandler and RTC_FROM_HERE
Reduce usage of sigslots
Simplify storage for Channels and Permissions.
Classes that were previously self deleted are now deleted by their owner

Bug: webrtc:9702, webrtc:11318, webrtc:11943
Change-Id: I32c63c11c16c42ae58a65020b1c20a03b21a5abb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271298
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37808}
2022-08-17 08:55:13 +00:00
Danil Chapovalov
cca884d1cc Migrate away from rtc::MessageHandler in p2p unittests
Bug: webrtc:9702, webrtc:11318
Change-Id: Ifde789af67f9761fc4a88b398d250bd83eba94de
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271287
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37796}
2022-08-16 13:14:25 +00:00
Danil Chapovalov
2aaef45876 Replace Invoke in tests with SendTask test helper
Bug: webrtc:11318
Change-Id: I14e3fbc694d41c785a61c88d8207005c681576c4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271540
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37774}
2022-08-12 23:42:16 +00:00
Sameer Vijaykar
71434ae614 Rename PreferGlobalIPv6ToLinkLocal field trial to group IPv6 fixes.
This combines the below IPv6 fixes into the field trial
WebRTC-IPv6NetworkResolutionFixes:
1. Prefer global IPv6 address over link local
2. Use address family when resolving STUN hostname

WebRTC-PreferGlobalIPv6ToLinkLocal is currently in Dev but will be
rolled back temporarily.

Bug: webrtc:14334, webrtc:14131
Change-Id: I1fb3f55c4c5f3c5c0b441ece30e72cf393e074d0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271340
Reviewed-by: Diep Bui <diepbp@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37754}
2022-08-11 16:24:12 +00:00
Sameer Vijaykar
a75eb43e99 Lookup STUN hostname using the network's IP family.
The current behaviour is to lookup using AF_UNSPEC, which leaves
the decision up to the getaddrinfo implementation, then filter to
resolved addresses matching the network family anyway.

Looking up using the network's family upfront avoids resolving to
an unusable address.

Bug: webrtc:14319, webrtc:14131
Change-Id: I4997452dc26aeb82e5d2890701721e7d477803a8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270625
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37753}
2022-08-11 15:34:32 +00:00
Sameer Vijaykar
b787e26369 Support DNS resolution matching a specified IP family.
The input SocketAddress for STUN host lookup is constructed with just
the hostname, so the family is AF_UNSPEC. So added an overload with a
target family to distinguish this from the family of the input addr.

Bug: webrtc:14319, webrtc:14131
Change-Id: Ia5ac5aa2e894e0c4dfb4417e3e8a76a6cec3ea71
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270624
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@google.com>
Cr-Commit-Position: refs/heads/main@{#37750}
2022-08-11 13:52:53 +00:00
Sameer Vijaykar
1e688612cc Fix use after free in UdpPort
SendStunBindingRequest can cause a SocketAddress pointed to by the
iterator to be deleted asynchronously before returning, causing `it`
to be invalid when incrementing in the continuation step.

Bug: webrtc:7309,  webrtc:14131
Change-Id: I3f7d3d7c12935d9592ef3642679a821c58826df9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270744
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37741}
2022-08-11 08:07:20 +00:00
Sameer Vijaykar
50ece56466 Add IPv6 unit tests for STUN port.
Also refactored a bit to support IPv6 networks and socket factories with
a mocked DNS resolver.

Bug: webrtc:14319, webrtc:14131
Change-Id: I32ac5beb9a72201bf83aac26aed6a670ed2d4955
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270741
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#37737}
2022-08-10 20:40:11 +00:00
Sameer Vijaykar
ab5876a8ab Remove TURN port's duplicate pointer to field_trials.
Base port already keeps an AlwaysValidPointer to field_trials, so
TURN port's duplicate, private copy is redundant.

Bug: webrtc:14319, webrtc:14131
Change-Id: I94ee78ca5140c0b67826fbb94c35e28f30add943
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270627
Reviewed-by: Jonas Oreland <jonaso@google.com>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37735}
2022-08-10 15:47:59 +00:00
Philipp Hancke
a204ad210d clean up misc TimeDelta use
follow-up from https://webrtc-review.googlesource.com/c/src/+/262810

* replace Time::Millis(0) and TimeDelta::Millis(0) with ::Zero()
* drop unnecessary webrtc namespace from some TimeDeltas
* make TimeDelta do the unit conversion for stats

BUG=webrtc:13756

Change-Id: Ic60625ae0fc7959a47a6be9f5051851feaf76373
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265875
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37664}
2022-08-02 13:52:36 +00:00
Diep Bui
1e589eb77f Modify GetBestIP to prefer global IPv6 addresses to the link local IPv6 addresses.
The change is behind the flag WebRTC-PreferGlobalIPv6ToLinkLocal.

Bug: webrtc:14306
Change-Id: Id2cae2e510fcfd007016e79ae4bd46947101d0fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269762
Commit-Queue: Diep Bui <diepbp@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37658}
2022-08-02 10:16:35 +00:00
Danil Chapovalov
6e7c2685e3 Allow recursive check for RTC_DCHECK_RUN_ON macro
instead of using Lock/Unlock attributes, use Assert attribute to annotate code is running on certain task queue or thread.

Such check better matches what is checked, in particular allows to
recheck (and thus better document) currently used task queue

Bug: None
Change-Id: I5bc1c397efbc8342cf7915093b578bb015c85651
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269381
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37619}
2022-07-26 09:27:23 +00:00
Tommi
9095e0e469 [TCPConnection] Check for valid port_ in OnClose and OnConnect.
Bug: chromium:1341261, chromium:1316996
Change-Id: I10931e731d2228f13f2df15419a8649e3e726cf0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268860
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37558}
2022-07-19 15:56:43 +00:00
Danil Chapovalov
7b19036b80 Migrate p2p/ to absl::AnyInvocable based TaskQueueBase interface
Bug: webrtc:14245
Change-Id: Iade96b4499e45401491c3eee941fafa51fb2849b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268147
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37482}
2022-07-07 13:03:44 +00:00
Tommi
f7b30e046e A few cleanup things for the port classes to clarify test code.
Remove FlushRequestsForTest
Rename test constant
Remove HasPendingRequestForTest

Bug: webrtc:13892
Change-Id: I78e13d229742c40743465b5fb57480c24d7417c1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258722
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37466}
2022-07-06 15:37:34 +00:00
Ali Tofigh
de2ac5a6f3 Adopt absl::string_view in p2p/
Bug: webrtc:13579
Change-Id: Ia33afa2a9ad12d1a586087d49f581a93fddb565d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262766
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37381}
2022-06-30 13:19:18 +00:00
Ali Tofigh
42b163f236 Remove unnecessary overloads
Bug: webrtc:13579
Change-Id: I6fbc1ea8fdc30b0d3e1084a941910027655c6feb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267062
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37377}
2022-06-30 09:39:28 +00:00
Ali Tofigh
58ecd42deb Remove std::string version of some functions that are no longer needed.
The absl::string_view versions can now be made pure virtual due to
downstream client changes. The std::string versions in the base
classes are still needed by downstream users, but will be removed
eventually.

Bug: webrtc:13579
Change-Id: Id757a07380f0518edf407ff5d0644511eb1e53d3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265980
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37349}
2022-06-28 09:06:02 +00:00
Byoungchan Lee
d58f526384 Always inject PacketSocketFactory in FakePortAllocator
This CL removes the use of the rtc::Thread::socketserver() method
in one place.

Bug: webrtc:13145
Change-Id: I1a1b2501450788263d5280c43e4328ade46f4146
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263320
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#37340}
2022-06-27 12:45:28 +00:00
Mirko Bonadei
d151cc6fa3 Remove the last build cycle in WebRTC
This CL removes the last "nogncheck" comment that was related to a
known build cycle. The remaining ones are because of conditional
dependencies.

Bug: webrtc:8733
Change-Id: Ie6862ae1cc613b9c2740a34c3167e1741ed31ee3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265981
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37302}
2022-06-22 10:44:51 +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
Ali Tofigh
1b984214bb Add absl::string_view version of PortAllocator::CreateSessionInternal()
This is the first step of migrating CreateSessionInternal() to
absl::string_view. The std::string version will be removed once all
downstream users have migrated and have implemented the
absl::string_view version.

Bug: webrtc:13579
Change-Id: Ia8bb25c010de118b194e66fd992b910509b9857f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265808
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37227}
2022-06-15 18:01:49 +00:00
Niels Möller
105711e9ad Move rtc::make_ref_counted to api/
Bug: webrtc:12701
Change-Id: If49095b101c1a1763c2a44a0284c0d670cce953f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265390
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37219}
2022-06-15 09:47:38 +00:00
Tommi
7ef4f514c5 [MessageHandler] Remove rtc::MessageHandler inheritance from StunRequest
This removes MessageHandler and Thread dependencies from StunRequest
and StunRequestManager. Instead the TaskQueueBase abstraction is
used for async posting and synchronous Clear() operations removed by
using a pending task safety flag.

Bug: webrtc:9702
Change-Id: I6e9ed5e1b4c446fd1f91af06e3ab36bccb5d7320
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265060
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37218}
2022-06-15 08:42:48 +00:00
Ali Tofigh
ea5a944921 Add absl::string_view version of PortInterface::SupportsProtocol()
This is the first step of migrating SupportsProtocol() to
absl::string_view. The std::string version will be removed once all
downstream users have migrated and have implemented the
absl::string_view version.

Bug: webrtc:13579
Change-Id: Ib609b9bab0c2e525553daddb1e365050bbe1c1f5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265806
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37211}
2022-06-14 15:01:12 +00:00
Tommi
6fd77f3d3f Reland "Make deletion of Connection objects more deterministic."
This reverts commit 869c87a2b9.

Reason for revert: Re-landing

Original change's description:
> Revert "Make deletion of Connection objects more deterministic."
>
> This reverts commit 942cac2e9e.
>
> Reason for revert: Reverting while downstream updates are made.
>
> Original change's description:
> > Make deletion of Connection objects more deterministic.
> >
> > This changes most deletion paths of Connection objects to go through
> > the owner class of the Connection instances, Port.
> >
> > In situations where Connection objects still need to be deleted
> > asynchronously, `async = true` can be passed to
> > `Port::DestroyConnection` and get the same behavior as
> > `Connection::Destroy` formerly gave.
> >
> > The `Destroy()` method still exists for downstream compatibility, but
> > instead of deleting connection objects asynchronously, the deletion
> > now happens synchronously via the Port class.
> >
> > Bug: webrtc:13892, webrtc:13865
> > Change-Id: I07edb7bb5e5d93b33542581b4b09def548de9e12
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259826
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#36676}
>
> Bug: webrtc:13892, webrtc:13865
> Change-Id: I37a15692c8201716402ba5c10f249e4d3754ce4c
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260862
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#36736}

Bug: webrtc:13892, webrtc:13865
Change-Id: I29da6c8899d8550c26ccecbbd0fe5f5556c80212
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260943
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37171}
2022-06-10 06:06:05 +00:00
Niels Möller
f1d822b03b Delete variant of rtc::split that copies the output fields
Bug: webrtc:13579
Change-Id: I065a32704d48d5eed21aee0e9757cac9ecf7aa99
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261951
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Ali Tofigh <alito@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37160}
2022-06-09 08:29:33 +00:00
Byoungchan Lee
d197e0b876 Reland "Don't create PacketSocketFactory inside BasicPortAllocatorSession"
This is a reland of commit 7d4634cef7

Original change's description:
> Don't create PacketSocketFactory inside BasicPortAllocatorSession
>
> This extends AlwaysValidPointer to avoid creating a unique_ptr inside it.
>
> Bug: webrtc:13145
> Change-Id: I73a4f18d0a7037b57f575b04b134e4f7eadceb79
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263240
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37048}

Bug: webrtc:13145
Change-Id: Iec8091ada5862cb6aa48d45b2a426c05bda798f9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264826
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Owners-Override: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Christoffer Jansson <jansson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37138}
2022-06-07 11:24:16 +00:00
Tommi
b5af6ee6df [StunMessage] Remove/deprecate StunMessage::SetType
Removes all remaining usage of SetType and marks the method as
deprecated.

Bug: none
Change-Id: I98dc613978ffe7ad8a4ffd951dd974d56ed92983
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265100
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37137}
2022-06-07 10:19:16 +00:00
Tommi
159f313649 [StunRequest] Remove Construct and Prepare methods.
Construction in StunRequest and derived classes now happens in
the ctor.

Bug: none
Change-Id: I803f6fd2b6d0ac1d9426304d1e1de10dec855eed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264942
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37126}
2022-06-04 07:32:44 +00:00
Tommi
e83500e17b [Connection] Construct ping/connection requests in one step.
This moves the construction of StunMessage instances for
ConnectionRequest, outside of the Prepare() method.

Following this, removing Construct()+Prepare() is relatively
straight forward.

Bug: none
Change-Id: Ibcf0510cef30a6e648005b43602c7ae1fb06729e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264558
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37122}
2022-06-03 20:04:24 +00:00
Sameer Vijaykar
9a91286898 Land refactored IceControllerEvent as IceRecheckEvent 4/4
This change removes the following after internal cleanup:
- IceRecheckEvent::Type enum, replaced with IceSwitchReason
- IceControllerEvent alias for IceRecheckEvent

Bug: webrtc:14125, webrtc:14131
Change-Id: I07bfeb7fa8a9c4d4a3f940213befd6418dfd6644
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264145
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#37118}
2022-06-03 14:08:54 +00:00
Sameer Vijaykar
2a1accd5e6 Rename IceControllerEvent to IceRecheckEvent 3/n
This changes renames the event to better suit its purpose. An alias
with the old name is added for compatibility pending internal cleanup.

Bug: webrtc:14125, webrtc:14131
Change-Id: I87026e19f2620eaa6a6770dcbedf1d0399c6c6b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264149
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#37111}
2022-06-03 11:28:34 +00:00
Sameer Vijaykar
781c12e7fb Reland "Refactor IceControllerEvent" 2/n
This is a partial reland of commit 794e68cf3d
which uses the new enum in P2PTransportChannel and BasicIceController.

Original change's description:
> Refactor IceControllerEvent
>
> This change is the first step in decoupling IceControllerEvent from
> the ICE switch reason. Further cleanup is earmarked, and will be
> landed after some internal cleanup.
>
> This change
> - adds a new enum - IceSwitchReason
> - adds a member for the new enum in IceControllerEvent
> - uses the new enum within P2PTransportChannel
> - adds methods to IceControllerInterface accepting the new enum
> - deprecates usages of the old enum in IceControllerInterface
> - adds conversion between the old and new enums for compatibility
>
> Bug: webrtc:14125, webrtc:14131
> Change-Id: I5b7201c3f631eb40db334dfeec842841a7e58174
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264140
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Commit-Queue: Sameer Vijaykar <samvi@google.com>
> Cr-Commit-Position: refs/heads/main@{#37051}

Bug: webrtc:14125, webrtc:14131
Change-Id: I81b0338ae2f0560cd3df7ad9bd9af37e7c3499df
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264554
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#37105}
2022-06-03 07:42:03 +00:00
Sameer Vijaykar
3382c1c06e Reland "Refactor IceControllerEvent" 1/n
This is a partial reland of commit 794e68cf3d
which
- adds a new enum - IceSwitchReason
- adds a member for the new enum in IceControllerEvent
- adds methods to IceControllerInterface accepting the new enum
- adds conversion between the old and new enums for compatibility

Original change's description:
> Refactor IceControllerEvent
>
> This change is the first step in decoupling IceControllerEvent from
> the ICE switch reason. Further cleanup is earmarked, and will be
> landed after some internal cleanup.
>
> This change
> - adds a new enum - IceSwitchReason
> - adds a member for the new enum in IceControllerEvent
> - uses the new enum within P2PTransportChannel
> - adds methods to IceControllerInterface accepting the new enum
> - deprecates usages of the old enum in IceControllerInterface
> - adds conversion between the old and new enums for compatibility
>
> Bug: webrtc:14125, webrtc:14131
> Change-Id: I5b7201c3f631eb40db334dfeec842841a7e58174
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264140
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Commit-Queue: Sameer Vijaykar <samvi@google.com>
> Cr-Commit-Position: refs/heads/main@{#37051}

Bug: webrtc:14125, webrtc:14131
Change-Id: I2ccdd53c80e38dc139669aa3f438864befed3dc0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264506
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37094}
2022-06-02 12:24:36 +00:00
Christoffer Jansson
25361a89dd Revert "Reland "Don't create PacketSocketFactory inside BasicPortAllocatorSession""
This reverts commit a8be79ce27.

Reason for revert: Downstream projects were not fixed and I was to eager to reland this, sorry about this.

Original change's description:
> Reland "Don't create PacketSocketFactory inside BasicPortAllocatorSession"
>
> This is a reland of commit 7d4634cef7
>
> Original change's description:
> > Don't create PacketSocketFactory inside BasicPortAllocatorSession
> >
> > This extends AlwaysValidPointer to avoid creating a unique_ptr inside it.
> >
> > Bug: webrtc:13145
> > Change-Id: I73a4f18d0a7037b57f575b04b134e4f7eadceb79
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263240
> > Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> > Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#37048}
>
> Bug: webrtc:13145
> Change-Id: I7d64c25b2942b392a1c35ff2fe1edc83d7b03746
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264503
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Christoffer Jansson <jansson@webrtc.org>
> Commit-Queue: Christoffer Jansson <jansson@webrtc.org>
> Reviewed-by: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
> Cr-Commit-Position: refs/heads/main@{#37088}

Bug: webrtc:13145
Change-Id: Ie7990bae9a7c864ffaa4eb5b637618caad509633
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264823
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Christoffer Jansson <jansson@webrtc.org>
Owners-Override: Christoffer Jansson <jansson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37089}
2022-06-02 09:45:16 +00:00
Byoungchan Lee
a8be79ce27 Reland "Don't create PacketSocketFactory inside BasicPortAllocatorSession"
This is a reland of commit 7d4634cef7

Original change's description:
> Don't create PacketSocketFactory inside BasicPortAllocatorSession
>
> This extends AlwaysValidPointer to avoid creating a unique_ptr inside it.
>
> Bug: webrtc:13145
> Change-Id: I73a4f18d0a7037b57f575b04b134e4f7eadceb79
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263240
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37048}

Bug: webrtc:13145
Change-Id: I7d64c25b2942b392a1c35ff2fe1edc83d7b03746
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264503
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Christoffer Jansson <jansson@webrtc.org>
Commit-Queue: Christoffer Jansson <jansson@webrtc.org>
Reviewed-by: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#37088}
2022-06-02 09:31:06 +00:00
Tommi
408143d5af Refactor StunMessage a bit
* Add ctors for providing the type and transaction id at construction.
* Update tests to use them instead of SetType+SetTransactionID
* Make sure stun message enum types are based on uint16_t
* Mark SetTransactionID as deprecated.
* Mark SetStunMagicCookie as deprecated (unused in webrtc).
* Add SetTransactionIdForTest for the one test that uses it (might not
  actually need it)
* Make StunRequest::Construct() protected.
  * Add a TODO to follow up on this since construction of StunRequest
    goes through an unnecessarily complex 3-step process involving
    other classes and a virtual method.

Bug: none
Change-Id: Ib013e58f28e7b2b4fcb3b3e1034da31dfc93e9d3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264546
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37079}
2022-06-01 17:43:55 +00:00
Niels Möller
6ef0a3816e Delete old StringToProto signature
Bug: webrtc:13579
Change-Id: I9bc01ce6e41a906d962522d0b395702db7a578f7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263583
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37065}
2022-05-31 13:39:34 +00:00
Sameer Vijaykar
9453e5f4b3 Revert "Refactor IceControllerEvent"
This reverts commit 794e68cf3d.

Reason for revert: Possibly breaks downstream project

Original change's description:
> Refactor IceControllerEvent
>
> This change is the first step in decoupling IceControllerEvent from the
> ICE switch reason. Further cleanup is earmarked, and will be landed
> after some internal cleanup.
>
> This change
> - adds a new enum - IceSwitchReason
> - adds a member for the new enum in IceControllerEvent
> - uses the new enum within P2PTransportChannel
> - adds methods to IceControllerInterface accepting the new enum
> - deprecates usages of the old enum in IceControllerInterface
> - adds conversion between the old and new enums for compatibility
>
> Bug: webrtc:14125, webrtc:14131
> Change-Id: I5b7201c3f631eb40db334dfeec842841a7e58174
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264140
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Commit-Queue: Sameer Vijaykar <samvi@google.com>
> Cr-Commit-Position: refs/heads/main@{#37051}

Bug: webrtc:14125, webrtc:14131
Change-Id: Ie6c4dea0f9007f78ce2bf1ee4e6b1dbca08f3142
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264505
Auto-Submit: Sameer Vijaykar <samvi@google.com>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37059}
2022-05-31 11:59:35 +00:00