Commit graph

40 commits

Author SHA1 Message Date
Philipp Hancke
b5ff55adee Reland "Enable TLS Client Hello extension permutation by default"
This is a reland of commit e13945bf07
with additional backward compability defaulting to the new value.

Original change's description:
> Enable TLS Client Hello extension permutation by default
>
> similar to the previous change for DTLS. This affects native TURN/TLS
> connections which are already using this in Chromium.
>
> BUG=webrtc:422225803
>
> Change-Id: I605f106371f2dbe23b1ad5f8385e0e01abe7c48f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357903
> Commit-Queue: Philipp Hancke <phancke@meta.com>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42688}

Bug: webrtc:422225803
Change-Id: Ic194e4f763029e65c1a15a6bbaabcfbcd2866eac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358120
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42702}
2024-07-31 06:01:22 +00:00
Mirko Bonadei
dfa7b2b425 Revert "Enable TLS Client Hello extension permutation by default"
This reverts commit e13945bf07.

Reason for revert: Breaks downstream project

Original change's description:
> Enable TLS Client Hello extension permutation by default
>
> similar to the previous change for DTLS. This affects native TURN/TLS
> connections which are already using this in Chromium.
>
> BUG=webrtc:422225803
>
> Change-Id: I605f106371f2dbe23b1ad5f8385e0e01abe7c48f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357903
> Commit-Queue: Philipp Hancke <phancke@meta.com>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42688}

Bug: webrtc:422225803
Change-Id: I8020e420e270c0f47cb8e26a210c801e94f8de7d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357883
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42689}
2024-07-30 07:56:29 +00:00
Philipp Hancke
e13945bf07 Enable TLS Client Hello extension permutation by default
similar to the previous change for DTLS. This affects native TURN/TLS
connections which are already using this in Chromium.

BUG=webrtc:422225803

Change-Id: I605f106371f2dbe23b1ad5f8385e0e01abe7c48f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357903
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42688}
2024-07-30 06:01:19 +00:00
Mirko Bonadei
05c6e745db Better capture the goal of TurnPortTest.TestChannelBindGetErrorResponse
Using 1 as channel_id doesn't make it clear that the goal was to
provide an invalid channel.

Bug: webrtc:345518625
Change-Id: Ie64f25b9398eafd3d0a9c8bab106e5277adef7df
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353984
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42494}
2024-06-17 08:19:07 +00:00
Philipp Hancke
4158678b46 Split "helpers" from SSL target to "crypto_random" and rename
since it contains helpers mostly related to cryptographically secure random numbers and strings.

BUG=webrtc:339300437

Change-Id: I10db939534b25dc792ac1600a4721d1b84521880
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352620
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42441}
2024-06-07 06:41:51 +00:00
Harald Alvestrand
f0ddae8c22 Convert ByteBufferWriter to be type uint8_t
and make follow-on changes.

Bug: webrtc:15665
Change-Id: Ice646f88ba5a09d6a8d9ce70415d8a14d7050d3c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/329781
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41393}
2023-12-15 12:27:50 +00:00
Per K
14630a7e37 Use rtc::ReceivedPacket in Stun and TurnServer
StunServer is updated to ensure registring for receiving packet from the socket is happening on the same thread as where the packets are recevied.

Bug: webrtc:15368, webrtc:11943
Change-Id: I94cc3a47278d5489de7f170c8d43015d1551c437
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/328120
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41219}
2023-11-23 10:40:56 +00:00
Harald Alvestrand
502afbf510 Change StunByteStringAttribute to have uint8_t* internal type
Also make it more convenient to use uint8_t array view for
interfacing to the class.

Bug: webrtc:15665
Change-Id: Ib671b5add79a48004133a6ecd99429534f7de1de
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/328140
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41212}
2023-11-22 13:18:26 +00:00
Harald Alvestrand
572502c2ab Deprecate char* functions on ByteBufferReader
Bug: webrtc:15661, webrtc:15665
Change-Id: Ia35b0092c219a89b5eba08d2e1a91be6e47dc746
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/328000
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41210}
2023-11-22 11:46:25 +00:00
Tommi
2afd284016 Rename [Un]SubscribeClose event subscription methods for clarity.
This is following up on a discussion here:
https://webrtc-review.googlesource.com/c/src/+/318061

Bug: none
Change-Id: Idb572ca6d0aad8d791eb6ba80dc0f48292f9f244
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/318883
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40698}
2023-09-05 10:07:30 +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
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
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
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
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
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
Tomas Gunnarsson
f15189dbce [CallbackList] Use CallbackList in AsyncPacketSocket for close events.
This removes use of the SignalClose sigslot. This CL includes thread
checks for the callback list and updates some call sites to unsubscribe
from events before deletion or detaching from a socket instance.

Bug: webrtc:11943
Change-Id: Ib66d39aa5cc795b750c9e3eaa85ed6af8b55b2b5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258561
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36540}
2022-04-13 14:56:58 +00:00
Ali Tofigh
fd6a4d6e2a Adopt absl::string_view in rtc_base/string_encode.*
Bug: webrtc:13579
Change-Id: If52108d151a12bde0e8d552ce7940948c08cef3a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256812
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36424}
2022-04-04 12:30:56 +00:00
Philipp Hancke
08a6e35848 Reland "Revert "Reland "remove stun origin support"""
This reverts commit 3b18208f13
and is the third attempt at removing stun origin support

Bug: webrtc:12132
Change-Id: Ic41a6d011fb6239907a257cc4c81ec4d2923dc4e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236260
Reviewed-by: Taylor Brandstetter <deadbeef@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Christoffer Jansson <jansson@google.com>
Cr-Commit-Position: refs/heads/main@{#35294}
2021-11-02 09:53:11 +00:00
Niels Möller
ac9a288274 Disable SSLAdapter methods Listen and Accept
Only affects turn server. Refactored to wrap sockets with SSLAdapter
after Accept, using the SSLAdapterFactory to hold needed configuration.

Bug: webrtc:13065
Change-Id: I5df65aad5728d8d40d95b22db6398a573ec7a36f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235823
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35258}
2021-10-21 12:08:30 +00:00
Taylor Brandstetter
3b18208f13 Revert "Reland "remove stun origin support""
This reverts commit 11a89c99e9.

Reason for revert: Breaks downstream code which is using the TurnPort constructor.

Original change's description:
> Reland "remove stun origin support"
>
> This is a reland of ba29ce320f
> readding the origin to the CreateRelayPortArgs structure to not break
> downstream tests yet:
>   https://webrtc-review.googlesource.com/c/src/+/235300/1..2
>
> Original change's description:
> > remove stun origin support
> >
> > Bug: webrtc:12132
> > Change-Id: I0f32e6af77e0c553b0c3b0d047ff03e14c492b31
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234384
> > Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#35202}
>
> Bug: webrtc:12132
> Change-Id: Ied840b59bb7c9497e98f9b80eb0a54d30008a40f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235300
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35220}

TBR=deadbeef@webrtc.org,hta@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com,philipp.hancke@googlemail.com

Change-Id: If16cedb8ccba22d83c919f64f7234873ba859a75
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:12132
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235346
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35221}
2021-10-15 21:27:48 +00:00
Philipp Hancke
11a89c99e9 Reland "remove stun origin support"
This is a reland of ba29ce320f
readding the origin to the CreateRelayPortArgs structure to not break
downstream tests yet:
  https://webrtc-review.googlesource.com/c/src/+/235300/1..2

Original change's description:
> remove stun origin support
>
> Bug: webrtc:12132
> Change-Id: I0f32e6af77e0c553b0c3b0d047ff03e14c492b31
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234384
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35202}

Bug: webrtc:12132
Change-Id: Ied840b59bb7c9497e98f9b80eb0a54d30008a40f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235300
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35220}
2021-10-15 19:46:24 +00:00
Artem Titov
41205b3c4d Revert "remove stun origin support"
This reverts commit ba29ce320f.

Reason for revert: Breaks downstream projects

Original change's description:
> remove stun origin support
>
> Bug: webrtc:12132
> Change-Id: I0f32e6af77e0c553b0c3b0d047ff03e14c492b31
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234384
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35202}

TBR=deadbeef@webrtc.org,hta@webrtc.org,philipp.hancke@googlemail.com,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I5f3a7a15c7da8e752569683bfeac91f2160a4f55
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:12132
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235241
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35209}
2021-10-14 15:08:28 +00:00
Philipp Hancke
ba29ce320f remove stun origin support
Bug: webrtc:12132
Change-Id: I0f32e6af77e0c553b0c3b0d047ff03e14c492b31
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234384
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35202}
2021-10-14 11:27:46 +00:00
Niels Möller
6da016ff71 Delete unused listen-mode of AsyncStunTCPSocket
Small step towards using separate classes for TCP server sockets.
Added a new test-only class AsyncStunServerTCPSocket needed
for unit tests of AsyncStunTCPSocket.

Bug: webrtc:13065
Change-Id: I7d9713983d8f6b30aa3d3e7442bb34ea48b815eb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232324
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35047}
2021-09-21 08:01:15 +00:00
Niels Möller
d0b8879770 Delete AsyncSocket class, merge into Socket class
Bug: webrtc:13065
Change-Id: I13afee2386ea9c4de0e4fa95133f0c4d3ec826e8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227031
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34787}
2021-08-17 15:39:25 +00:00
Niels Möller
2ba32f3423 Delete AsyncInvoker usage in TurnServer
Bug: webrtc:12339
Change-Id: Ibcc5d9d5b5abf0d926290e3164f60dd46c0b460b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212666
Reviewed-by: Taylor <deadbeef@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33535}
2021-03-23 08:01:00 +00:00
Niels Möller
76b51e21bc Improve thread annotations for TurnServer
Bug: webrtc:12339
Change-Id: I317485a392ad6cdf77ebf4ea8a7066f8ba0245bb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212502
Reviewed-by: Taylor <deadbeef@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33516}
2021-03-22 09:09:57 +00:00
Harald Alvestrand
07d83c8a9a Modified STUN verification functions
The new verification makes verification a function on a message.
It also stores the password used in the request message, so that
it is easily accessible when verifying the response.

Bug: chromium:1177125
Change-Id: I505df4b54214643a28a6b292c4e2262b9d97b097
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209060
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33366}
2021-03-02 10:34:17 +00:00
Niels Möller
87e9f6e666 Update p2p/ to use C++ lambdas instead of rtc::Bind
Bug: webrtc:11339
Change-Id: Ie128e2ed8acb445b453682b88ceb86d968850ef1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201726
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32994}
2021-01-15 10:30:50 +00:00
Tomas Gunnarsson
abdb470d00 Make MessageHandler cleanup optional.
As documented in webrtc:11908 this cleanup is fairly invasive and
when a part of a frequently executed code path, can be quite costly
in terms of performance overhead. This is currently the case with
synchronous calls between threads (Thread) as well with our proxy
api classes.

With this CL, all code in WebRTC should now either be using MessageHandlerAutoCleanup
or calling MessageHandler(false) explicitly.

Next steps will be to update external code to either depend on the
AutoCleanup variant, or call MessageHandler(false).

Changing the proxy classes to use TaskQueue set of concepts instead of
MessageHandler. This avoids the perf overhead related to the cleanup
above as well as incompatibility with the thread policy checks in
Thread that some current external users of the proxies would otherwise
run into (if we were to use Thread::Send() for synchronous call).

Following this we'll move the cleanup step into the AutoCleanup class
and an RTC_DCHECK that all calls to the MessageHandler are setting
the flag to false, before eventually removing the flag and make
MessageHandler pure virtual.

Bug: webrtc:11908
Change-Id: Idf4ff9bcc8438cb8c583777e282005e0bc511c8f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183442
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32049}
2020-09-07 12:57:15 +00:00
Patrik Höglund
56d945233d Move stun.h to api/.
We now have two downstream users of stun.h, so it appears to be
generally usable. I put this in a new dir networking/, but I'm open to
suggestions here (maybe some things in api/ should move in there).

I checked what our downstream users are actually using, and it's

cricket::ComputeStunCredentialHash
cricket::<constants>
cricket::TurnMessage
cricket::GetStunErrorResponseType
cricket::StunAttribute::CreateAddress
cricket::StunErrorCodeAttribute
cricket::StunByteStringAttribute
StunAttribute::CreateUnknownAttributes
cricket::TurnErrorType
cricket::StunMessage

I reckoned that was pretty much everything in stun.h, so I didn't
bother splitting it up. They don't use every function and constant
in there, but all _types_ of functions and constants, so for the
sake of coherence I don't think it makes sense to split it.

There's some old stuff in there like GTURN which could arguably
be split out, but it should likely go away soon anyway, so I don't
think it's worth the effort.

Steps:
1) land this
2) update downstream to point to the new header and target
3) remove p2p/base:stun_types.

Bug: webrtc:11091
Change-Id: I1f05bf06055475d25601197ec6fefb8d3b55e8e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159923
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29822}
2019-11-18 16:11:27 +00:00
Mirko Bonadei
317a1f09ed Use std::make_unique instead of absl::make_unique.
WebRTC is now using C++14 so there is no need to use the Abseil version
of std::make_unique.

This CL has been created with the following steps:

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

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

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

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

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

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

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

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

# Repead the gn_check_autofix step for other platforms

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

Bug: webrtc:10945
Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 15:47:29 +00:00
Patrik Höglund
7d00342f66 Remove old packet socket factory header.
Bug: webrtc:7447
Change-Id: I367e624070561349a2e98c00d1ce97ad8d12edeb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153347
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29207}
2019-09-17 11:21:45 +00:00
Qingsi Wang
20232a914f Use obfuscated IPs in logging in p2p/ and pc/.
Bug: None
Change-Id: I0e7e76ec2d61a1e2719975701a32c1cfc04f97d5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151960
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Alex Drake <alexdrake@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29103}
2019-09-06 21:51:56 +00:00
Jonas Olsson
a4d873786f Format almost everything.
This CL was generated by running

git ls-files | grep -P "(\.h|\.cc)$" | grep -v 'sdk/' | grep -v 'rtc_base/ssl_' | \
grep -v 'fake_rtc_certificate_generator.h' | grep -v 'modules/audio_device/win/' | \
grep -v 'system_wrappers/source/clock.cc' | grep -v 'rtc_base/trace_event.h' | \
grep -v 'modules/audio_coding/codecs/ilbc/' | grep -v 'screen_capturer_mac.h' | \
grep -v 'spl_inl_mips.h' | grep -v 'data_size_unittest.cc' | grep -v 'timestamp_unittest.cc' \
| xargs clang-format -i ; git cl format

Most of these changes are clang-format grouping and reordering includes
differently.

Bug: webrtc:9340
Change-Id: Ic83ddbc169bfacd21883e381b5181c3dd4fe8a63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144051
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28505}
2019-07-08 13:45:15 +00:00
Sebastian Jansson
c01367db40 Deprecating ThreadChecker specific interface.
All changes outside thread_checker.h are by:
s/CalledOnValidThread/IsCurrent/
s/DetachFromThread/Detach/

Bug: webrtc:9883
Change-Id: Idbb1086bff0817db58e770116acf4c9d60fae8b3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131023
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27494}
2019-04-08 16:58:07 +00:00
Steve Anton
ae226f65c8 Use Abseil container algorithms in p2p/
Bug: None
Change-Id: I02dd19efa201bd9d55d0f7c2e1496693017a6848
Reviewed-on: https://webrtc-review.googlesource.com/c/120001
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26455}
2019-01-29 21:52:18 +00:00
Steve Anton
10542f21c8 (4) Rename files to snake_case: update BUILD.gn, include paths, header guards, and DEPS entries
Mechanically generated by running this command:

tools_webrtc/do-renames.sh update all-renames.txt && git cl format

Then manually updating:

tools_webrtc/sanitizers/tsan_suppressions_webrtc.cc

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I54824cd91dada8fc3ee3d098f971bc319d477833
Reviewed-on: https://webrtc-review.googlesource.com/c/115653
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26226}
2019-01-11 17:11:39 +00:00
Steve Anton
1c05765831 (3) Rename files to snake_case: move the files
Mechanically generated with this command:

tools_webrtc/do-rename.sh move all-renames.txt

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I8b05b6eab9b9d18b29c2199bbea239e9add1e690
Reviewed-on: https://webrtc-review.googlesource.com/c/115481
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26225}
2019-01-11 17:05:20 +00:00
Renamed from p2p/base/turnserver.cc (Browse further)