Commit graph

1508 commits

Author SHA1 Message Date
Florent Castelli
7f623b05c3 Move bit_buffer out of rtc_base_approved
Bug: webrtc:9838
Change-Id: Ia6e0f1c3017a968b22fdca512ef6adb37957d777
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258769
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36604}
2022-04-21 12:42:04 +00:00
Ali Tofigh
22d094d4c9 adopt absl::string_view in rtc_base/third_party/
Bug: webrtc:13579
Change-Id: Ic0c4843f09f168b158f41df79b211ac9f7f1c3cd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259301
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36591}
2022-04-20 16:13:13 +00:00
Florent Castelli
d119b9e210 Move zero_memory out of rtc_base_approved
Bug: webrtc:9838
Change-Id: I2d1507354abf208947ac299ab41abe3cfa2b4274
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258767
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36585}
2022-04-20 12:19:58 +00:00
Florent Castelli
b1dc4e43f0 Move timestamp_aligner out of rtc_base_approved
Bug: webrtc:9838
Change-Id: I4ea34fd161e321f6506f300abfd27c4be6d785d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258766
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36580}
2022-04-20 08:25:30 +00:00
Jonas Oreland
6c7f98472e WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 16/inf
This cl/ adds the feature actually injecting a FieldTrialsView into
PeerConnectionFactory, or into a PeerConnection or both.

The field trials used for a PeerConnection is those specified in
PeerConnectionDependencies. Otherwise will those from
PeerConnectionFactoryDependencies be used (and until we're finished with
this conversion, the global string fallback is used as last resort).

Note that it is currently not possible to create 2 FieldTrials
objects concurrently...due to global string,
so this cl/ is mostly (but entirely) for show, i.e one _can_
realistically inject them into a PeerConnectionFactory.


Bug: webrtc:10335
Change-Id: Id2e60525f48a1f8293c1dd0be771e3ed03790963
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258134
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36578}
2022-04-20 06:35:27 +00:00
Florent Castelli
aa6d05d268 Move location out of rtc_base_approved
Bug: webrtc:9838
Change-Id: I3510f3d01df532cb228a6cc14be830f6ab81a8e1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258764
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36576}
2022-04-19 21:57:48 +00:00
Florent Castelli
6b6085937e Move one_time_event out of rtc_base_approved
Bug: webrtc:9838
Change-Id: If85ce079e6a437337f1f780fcee0147b4e95f9cf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258765
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36575}
2022-04-19 20:09:21 +00:00
Florent Castelli
a6c10e37b0 Move strong_alias out of rtc_base_approved
Bug: webrtc:9838
Change-Id: Ifb4a8aa64bb94c9f08f7debded70e881a7fb0531
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258763
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36573}
2022-04-19 17:15:37 +00:00
Florent Castelli
71337f387e Move random out of rtc_base_approved
Bug: webrtc:9838
Change-Id: I64a5ef18c19d446139354d04aa6cb2a76d18aad0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258762
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36572}
2022-04-19 14:00:47 +00:00
Niels Möller
d959f3a665 Use std:unique_ptr for Network objects owned by the NetworkManager.
Bug: webrtc:13869, webrtc:13846
Change-Id: I699ac4774f84cf891304b9c75434301f99ca55d6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258500
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36569}
2022-04-19 10:34:37 +00:00
Florent Castelli
45a0599978 Remove platform_thread from //rtc_base:rtc_base_approved public_deps
While the target has a restricted visibility, since it was in rtc_base_approved
public deps, a lot of targets were able to bypass the visibility check.
So we remove the visibility restrictions and use the dependency explicitely
everywhere instead.

Bug: webrtc:8603
Change-Id: I94a03fdf7f94c54ab72081a58dd648e2cca73d17
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258944
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36566}
2022-04-18 23:12:52 +00:00
Florent Castelli
b96902d33c Remove public_deps in //rtc_base:rtc_base_unittests
Bug: webrtc:8603
Change-Id: I37db775faffaca0791d2bd4865843b5353c6e67e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258943
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36565}
2022-04-18 21:44:13 +00:00
Florent Castelli
f35611aa59 Remove public_deps from //rtc_base:rtc_json
Bug: webrtc:8603
Change-Id: Ib2232ef5d6befd3eddafa5743b686af2b4c4ca0b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258942
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36564}
2022-04-18 20:03:33 +00:00
Ali Tofigh
2ab914c6ab Adopt absl::string_view in rtc_base/ (straightforward cases)
Bug: webrtc:13579
Change-Id: I240db6285abb22652242bc0b2ebe9844ec4a45f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258723
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36561}
2022-04-17 12:11:56 +00:00
Sunggook Chue
8a411c4e2c Disallow set_allow_wgc_capturer_fallback call on Win10.
There is a crash report from the Windows OS API
where it repro only win10, not a Win11.

Unfortunately, Microsoft can't access the dump file or
hasn't repro internally so we decided to disable the WGC
fallback use in the OS other than Win11 now.
Once the change (support WGC fallback) reaches to Microsoft Edge
and it produce crash report,  Edge team will take the
dump file to the Windows OS API owner for Win10 level fix (or
bring the Win11 fix to Win10).

Bug: chromium:1312937
Change-Id: I5335e2c57076d4fab08e9c74ade599259cff10d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258821
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Cr-Commit-Position: refs/heads/main@{#36558}
2022-04-15 23:41:16 +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
Tomas Gunnarsson
9797dcd1a7 [CallbackList] Support component build
Bug: webrtc:11943
Change-Id: I2abde42d65bc66f8e026fedfc2aa26bf86e1e46d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258600
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36516}
2022-04-11 08:56:51 +00:00
Tomas Gunnarsson
8bd5d484fe [CallbackList] Allow removal from within callback.
This makes moving from sigslot to CallbackList slightly simpler in some
situations.

Bug: webrtc:11943
Change-Id: I5c6dafb8ac597a119b90b64f369fa9e6316e38da
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258560
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36515}
2022-04-11 08:42:46 +00:00
Niels Möller
35716230b5 Delete deprecated dummy method GetNetworks(NetworkList* networks).
Followup to https://webrtc-review.googlesource.com/c/src/+/256967.

Bug: webrtc:13869
Change-Id: Ie929082681ab285f7e390d646cc258ad573f86c0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258133
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36497}
2022-04-08 13:22:44 +00:00
Tommi
145fdbf3b2 Explicitly disallow copy in PlatformThread
Bug: none
Change-Id: If7a7483f742ef5650b991ad659265a598b91a892
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258400
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36494}
2022-04-08 12:03:04 +00:00
Mirko Bonadei
23e4654303 Apply bugprone-stringview-nullptr.
Bug: None
Change-Id: Id6372a8a94f512fede50cdb36dc3ae378f271cee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258139
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36493}
2022-04-08 11:04:34 +00:00
Niels Möller
016ae448e0 Reland "Delete unused class GlobalMutex"
This is a reland of commit 5831afb832

Original change's description:
> Delete unused class GlobalMutex
>
> Bug: webrtc:13869
> Change-Id: Id3655bdd24630b78e83b606291605a37129fd4bc
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258131
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#36478}

Bug: webrtc:13869
Change-Id: I43f41c9128fc8054fc0051cbeb4dbe5cfc91f458
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258137
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36491}
2022-04-08 10:02:08 +00:00
Artem Titov
db622c359b Revert "Delete unused class GlobalMutex"
This reverts commit 5831afb832.

Reason for revert: The code is still in use: https://ci.chromium.org/ui/p/webrtc/builders/ci/Win32%20Builder%20(Clang)/10243/overview. It wasn't detected for some reasons.

Original change's description:
> Delete unused class GlobalMutex
>
> Bug: webrtc:13869
> Change-Id: Id3655bdd24630b78e83b606291605a37129fd4bc
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258131
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#36478}

Bug: webrtc:13869
Change-Id: Id44dd4f8ec31ac9e05fc0ee75b55916e627fd7bf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258135
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36480}
2022-04-07 13:38:53 +00:00
Niels Möller
2221144d01 Delete old versions of GetNetworks and GetAnyAddressNetworks
Bug: webrtc:13869
Change-Id: I8a54b875a06345ac6a762673aba9ca51d79f0a82
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256967
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36479}
2022-04-07 11:25:12 +00:00
Niels Möller
5831afb832 Delete unused class GlobalMutex
Bug: webrtc:13869
Change-Id: Id3655bdd24630b78e83b606291605a37129fd4bc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258131
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36478}
2022-04-07 11:24:02 +00:00
Florent Castelli
8d4e9fba21 Remove //api:sequence_checker from public deps
Bug: webrtc:8603
Change-Id: Ib572cdc5b5f4c1f0eb3357e5e0812fc9ce7437c4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257915
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36465}
2022-04-06 14:23:50 +00:00
Florent Castelli
dd837e28fa Remove //rtc_base:timeutils from public deps
Bug: webrtc:8603
Change-Id: Iaca9356d16275a02e8842c783f259131d72ef010
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257914
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36460}
2022-04-06 11:23:21 +00:00
Florent Castelli
57aa81bce7 Remove //rtc_base:stringutils from public deps
Bug: webrtc:8603
Change-Id: Ic2dfbe28d310cb4b35983b73e895fc95e8439669
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257913
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36453}
2022-04-05 22:42:19 +00:00
Florent Castelli
e10a9f609a Remove //rtc_base:safe_conversions from public deps
Bug: webrtc:8603
Change-Id: I285ac30975039f8fe9882d1673cc8e4a615c8618
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257912
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36452}
2022-04-05 20:04:59 +00:00
Florent Castelli
33d31fbc48 Remove //rtc_base:rtc_event from public deps
Bug: webrtc:8603
Change-Id: Ib99f43043da17723c939b0fe2aa9f3e515462c93
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257911
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36450}
2022-04-05 17:34:09 +00:00
Florent Castelli
f86f6f9afd Remove //rtc_base:refcount from public deps
Bug: webrtc:8603
Change-Id: Ib27a107ae809df739492846175f0e9c4af40d21a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257910
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36447}
2022-04-05 15:32:29 +00:00
Florent Castelli
4467ad7835 Remove //rtc_base:macromagic from public deps
Bug: webrtc:8603
Change-Id: I9708df48c9bde9f86ba2d1a92a278bb0d09f3865
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257909
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36444}
2022-04-05 12:36:12 +00:00
Florent Castelli
0af55ba60d Remove //rtc_base:logging from public deps
Bug: webrtc:8603
Change-Id: I2704da8618f88032adac7ae9eb2a0f47fce4a836
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257908
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36443}
2022-04-05 10:31:19 +00:00
Niels Möller
e0a92f9a42 Delete unused ScopedRegisterThreadForDebugging facility
Bug: webrtc:6424
Change-Id: I3564d204e8c886ce53e82426ef1d3896d7f6409d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258021
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36441}
2022-04-05 09:21:39 +00:00
Ali Tofigh
e73b66b147 Remove unused overload of rtc::hex_decode_with_delimiter
Bug: webrtc:13579
Change-Id: I81bff9db9327be540bbf53267e678c572e99a78f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257916
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36436}
2022-04-05 05:34:29 +00:00
Florent Castelli
bddfe0215c Remove //rtc_base:atomicops from public deps
Bug: webrtc:8603
Change-Id: If1fb37e44d5ab277e16895ca50325b3a86bd135f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257907
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36432}
2022-04-04 18:25:48 +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
Niels Möller
bf4988a75e New protected method NetworkManagerBase::GetNetworksInternal
Bug: webrtc:13869
Change-Id: Ib41a705362cd45ce894db6a119226844b719b706
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257302
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36420}
2022-04-04 08:41:47 +00:00
Hans Wennborg
597e03f201 Remove set but otherwise unused variable
Recent Clang versions have enhanced -Wunused-but-set-variable which now
warns about this.

Bug: chromium:1309955
Change-Id: I7a9d2175e6314fe8133cf7a77eb00bd4a22a23c5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257300
Reviewed-by: Jonas Oreland <jonaso@google.com>
Auto-Submit: Hans Wennborg <hans@chromium.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36418}
2022-04-04 08:19:05 +00:00
Evan Shrubsole
b7c15706de Fix integer-overflow in TimestampExtrapolator
The Frequency implementation does not allow for nominators as large as
those that can occur in consecutive RTP timestamps, so use double math
instead.

Bug: chromium:1310611
Change-Id: I3b239e1b84043470ca29da06728b42cd4552300f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256978
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36368}
2022-03-29 12:46:51 +00:00
Niels Möller
00b31cc72a Add (temporary) using declaration for BasicNetworkManager::GetNetworks
Needed to migrate downstream code that needs to call new signature of
BasicNetworkManager::GetNetworks(). And similarly for
GetAnyAddressNetworks.

Bug: webrtc:13869
Change-Id: I8b9e842e74e290662c0713846dc29ac739d76ba2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256977
Auto-Submit: Niels Moller <nisse@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36366}
2022-03-29 11:37:01 +00:00
Jonas Oreland
e62c2f2c77 WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 12/inf
rename WebRtcKeyValueConfig to FieldTrialsView

Bug: webrtc:10335
Change-Id: If725bd498c4c3daf144bee638230fa089fdde833
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256965
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36365}
2022-03-29 10:14:00 +00:00
Jonas Oreland
c06fe8b04e WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 11/inf
convert rtc_base/network and collateral.

This also remove last usage of system_wrappers/field_trials
in p2p/...Yay!

Bug: webrtc:10335
Change-Id: Ie8507b1f52bf7f3067e9b4bf8c81a825e4644fda
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256640
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36357}
2022-03-28 15:48:01 +00:00
Niels Möller
e0c6bdf071 Use const rtc::Network* in ports and port allocator
No-try: True
Bug: webrtc:13869
Change-Id: I6004fa96278263d0d25a1446d7bb8de41a563433
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256682
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@google.com>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36353}
2022-03-28 12:48:30 +00:00
Ali Tofigh
3d6c6556b4 Adopt absl::string_view in rtc_base/string_to_number.*
Bug: webrtc:13579
Change-Id: I7e1a8ad6c493c9c0ac20c493d2467f0a2eda26d9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256720
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36340}
2022-03-25 14:32:05 +00:00
Ali Tofigh
1d6de1499c Adopt absl::string_view in testsupport/file_utils*
Bug: webrtc:13579
Change-Id: I5b710cfd218c44be01a7a42c2b281739081881e6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256280
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36332}
2022-03-25 10:34:54 +00:00
Ali Tofigh
e5b2220650 Adopt absl::string_view in rtc_base/string_utils*
Bug: webrtc:13579
Change-Id: I2def83ae546156ff0ec8ef000b7ed0c48d15777c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256721
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36329}
2022-03-25 08:12:36 +00:00
Ali Tofigh
58d861c47f Update missing absl::string_view adoption in openssl files under rtc_base/
Bug: webrtc:13579 webrtc:13870
Change-Id: Ia549285f1a60f41397c04f7bc2acdee684544ec3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256722
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36328}
2022-03-25 08:11:17 +00:00
Evan Shrubsole
195b0a9849 Modernize TimestampExtrapolator to use correct units
* Add unit tests
* Use TimestampUnwrapper
* Follow style guide

Change-Id: I057b05faba0aeafb2830a45007474be0eca1c6e0
Bug: webrtc:13756
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256261
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36313}
2022-03-24 09:36:43 +00:00
Tommi
ccc9d979a5 Add checks for a null msg_queue_ to VirtualSocketServer.
The Thread class internally (`Thread::DoDestroy`) makes this call:
  ss_->SetMessageQueue(nullptr);

Which sets the `msg_queue_` member variable of VirtualSocketServer
to nullptr. VSS checks for this in several places, but not all. In
particular `CancelConnects()` does handle it, but Disconnect(), which
is called from the same place (VirtualSocket::Close()), is missing
this check.

This CL adds some DCHECKs to catch when a pointer might be nullptr
and also avoids dereferencing a potential nullptr deref during teardown
if `Disconnect` is called, e.g. from within `VirtualSocket::Close()`
which is called from the dtor of `VirtualSocket`.

Bug: webrtc:13864
Change-Id: I717a0f033ebf70b1f59338680957723a77ccf4ca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256600
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36312}
2022-03-24 08:18:43 +00:00
Ali Tofigh
6ceb81f62b Clean up SimpleStringBuilder after absl::string_view adoption
Bug: webrtc:13579
Change-Id: I8fdc65e19893c9a96b263bbc99c4f9139fa4b78f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256268
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36291}
2022-03-22 14:33:14 +00:00
Niels Möller
9dde120d65 Reject double RefCountedObject inheritance in rtc::make_ref_counted.
Bug: webrtc:12701
Change-Id: Ie45707e3266e6a27cae073f824a1c77707d77000
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256240
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36281}
2022-03-21 16:31:21 +00:00
Jonas Oreland
e0e91a624a AlwaysValidPointer - forwarding constructor and tests
Bug: webrtc:10335
Change-Id: I1305ccf8d4f1b25f89fef7d26b090741d5f57f7e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256106
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36264}
2022-03-19 00:31:37 +00:00
Jonas Oreland
66eb789b41 Add class for pointer or owned object.
To be used as part of field trial conversion effort.

Bug: webrtc:10335
Change-Id: Iaeff520d5a83331926ead945c9e414716e61cac8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256013
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36259}
2022-03-18 15:24:57 +00:00
Niels Möller
be74b8058b Fix spelling of receiver and transceiver.
Bug: None
Change-Id: I439e217d67283b182833e48da15af9ae367ac14e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256015
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36257}
2022-03-18 14:54:10 +00:00
Mirko Bonadei
9b88e299ba Skip NetworkTest.TestMultipleIPMergeNetworkList.
Bug: webrtc:13846
Change-Id: I6098ef931e355c1d58b661962baab4ccb28916a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256014
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36250}
2022-03-18 13:05:00 +00:00
Mirko Bonadei
b2a5785e79 Don't assume strict order of IPs
Bug: None
Change-Id: I2005a4472b8a14e03a273f430fc6986f6ec0a4bd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256012
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36249}
2022-03-18 12:19:28 +00:00
Ali Tofigh
7fa9057a05 Adopt absl::string_view in function parameters under rtc_base/
This is part of a large-scale effort to increase adoption of
absl::string_view across the WebRTC code base.

This CL converts the majority of "const std::string&"s in function
parameters under rtc_base/ to absl::string_view.

Bug: webrtc:13579
Change-Id: I2b1e3776aa42326aa405f76bb324a2d233b21dca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254081
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Reviewed-by: Anders Lilienthal <andersc@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36239}
2022-03-17 15:39:26 +00:00
Niels Möller
658b88a48e Delete rtc::string_trim. Replaced with absl::StripAsciiWhitespace.
Bug: webrtc:6424, webrtc:13579
Change-Id: I222e1bfb62d5f1f1a2c74e5fce1038e04e7bebfb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255824
Reviewed-by: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36234}
2022-03-17 12:53:14 +00:00
Henrik Boström
19ba552e88 Add TaskQueue::PostDelayedTaskWithPrecision helper method.
Just like the other PostTask methods, this is just short-hand for
invoking the TaskQueueBase's version of the method.

Drive-by fix: remove unnecessary return statement of void methods.

Bug: webrtc:13604
Change-Id: I3d5cae66bfa06334058386909f041916dbfa5ab8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255342
Reviewed-by: Mirko Bonadei <mbonadei@google.com>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36194}
2022-03-14 15:24:17 +00:00
Ali Tofigh
6364d0899e Adopt absl::string_view in rtc_base/log_sinks
This is part of a large scale effort to increase adoption of
absl::string_view across the WebRTC code base.

This CL adds absl::string_view versions of the OnLogMessage functions in
rtc::LogSink. The const std::string& versions are kept for now since
downstream clients use subclasses of LogSink and need to be migrated
before these are removed.

Bug: webrtc:13579
Change-Id: I57bb72ad503805ff0ca16f1d7aece2d44c65cb73
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/253980
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Owners-Override: Xavier Lepaul‎ <xalep@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36189}
2022-03-14 12:47:55 +00:00
Jonas Oreland
c7f691a71a WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 2
convert call/ (and the collaterals)

Bug: webrtc:10335
Change-Id: I8f6bc13c032713aa2a947724b464f6f35454d39a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254320
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36165}
2022-03-09 22:17:52 +00:00
Harald Alvestrand
57869dae11 Remove obsolete comment about loglevels
The nonstandard loglevel equivalents have been removed, but I forgot
to update this comment.

Bug: webrtc:13362
Change-Id: Ifd604cfe53b9ee312d80179cc5e1bc6734ee6c29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254261
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36158}
2022-03-09 11:34:01 +00:00
Evan Shrubsole
d6cdf80072 Use Timestamp and TimeDelta in VCMTiming
* Switches TimestampExtrapolator to use Timestamp as well.

Bug: webrtc:13589
Change-Id: I042be5d693068553d2e8eb92fa532092d77bd7ef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249993
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36112}
2022-03-02 15:07:25 +00:00
Mirko Bonadei
8382968781 Reland "Remove workaround in AutoSocketServerThread that isn't needed anymore."
This reverts commit e4d3952bf0.

Reason for revert: Speculative revert.

Original change's description:
> Revert "Remove workaround in AutoSocketServerThread that isn't needed anymore."
>
> This reverts commit 44156fa024.
>
> Reason for revert: Needed in order to revert https://webrtc-review.googlesource.com/c/src/+/249941, which introduced a crash
>
> Original change's description:
> > Remove workaround in AutoSocketServerThread that isn't needed anymore.
> >
> > Cleanup steps for the Connection class have changed as of:
> > https://webrtc-review.googlesource.com/c/src/+/249941
> >
> > However, it turns out that the PortTest suite still needs it, so the
> > workaround has migrated to there.
> >
> > Bug: none
> > Change-Id: Ia68f47b6c65b3a8fd5e8c04d70a43d15ba1a6422
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250223
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#35894}
>
> Bug: none
> Change-Id: I13a4a79ebcb864054d14c1ba7726e18e044e3bd4
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252542
> Auto-Submit: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#36076}

No-Try: True
Bug: none
Change-Id: If39bb2f26349c42c2377ed9f80c26eb18d90869f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252585
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36082}
2022-02-25 11:33:32 +00:00
Taylor Brandstetter
e4d3952bf0 Revert "Remove workaround in AutoSocketServerThread that isn't needed anymore."
This reverts commit 44156fa024.

Reason for revert: Needed in order to revert https://webrtc-review.googlesource.com/c/src/+/249941, which introduced a crash

Original change's description:
> Remove workaround in AutoSocketServerThread that isn't needed anymore.
>
> Cleanup steps for the Connection class have changed as of:
> https://webrtc-review.googlesource.com/c/src/+/249941
>
> However, it turns out that the PortTest suite still needs it, so the
> workaround has migrated to there.
>
> Bug: none
> Change-Id: Ia68f47b6c65b3a8fd5e8c04d70a43d15ba1a6422
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250223
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35894}

Bug: none
Change-Id: I13a4a79ebcb864054d14c1ba7726e18e044e3bd4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252542
Auto-Submit: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36076}
2022-02-25 10:14:38 +00:00
Harald Alvestrand
380d60c89a Delete INFO/WARNING/LERROR log levels
These have been depreated since November 2021.

Bug: webrtc:13362
Change-Id: Ifc1b984ab54faefc974006f37f909e6927aed056
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251760
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36023}
2022-02-17 10:51:12 +00:00
Danil Chapovalov
e6106102f8 Fix fd leak in ifaddrs_android.cc
allow absl::Cleanup for such purpose

Bug: webrtc:13674
Change-Id: I7434c7a48f1135bf4bf14b66996fbff1a7016c74
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251781
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36016}
2022-02-16 12:37:35 +00:00
Mirko Bonadei
cb03e385ad Fix LOGGING_INSIDE_WEBRTC propagation in Chromium builds.
This macro needs to be both present in all WebRTC targets (see its
definition in at [1] but also propagated to all the targets
depending on the Chromium component defined in
//third_party/webrtc_overrides:webrtc_component (to properly support
transitive header #includes), by using "public_config" GN propagates
the macro accordingly.

[1] - https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/BUILD.gn;l=315;drc=61dbc2db2b84eed9c9769c1b79070e6bd4030331

Bug: None
Change-Id: Idd51643da63be48324c86a5b89676c63c3998e14
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251440
Reviewed-by: Björn Terelius <terelius@google.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35972}
2022-02-10 15:20:16 +00:00
Niels Möller
b02220d1a0 Reland "Mark all bool conversion operators as explicit"
This is a reland of 325789c457

Original change's description:
> Mark all bool conversion operators as explicit
>
> An explicit bool conversion operator will still be used implicitly
> when an expression appears in "bool context", e.g., as the condition
> in an if statement, or as argument to logical operators. The
> `explicit` annotation prevents conversion in other contexts, e.g.,
> converting both a and b to bool in an expression like `a == b`.
>
> Bug: None
> Change-Id: I79ef35b1ea831e6011ae472900375ae8a3e617ab
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250664
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35927}

Bug: None
Change-Id: Ie057dfc8c0b5c498e2c8daff7620172c89f0e011
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251380
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35962}
2022-02-09 09:40:05 +00:00
Niels Möller
27c1452fae Refactor BasicNetworkManager to use TQ methods and PendingTaskSafetyFlag.
Bug: webrtc:11988
Change-Id: I29a1023297510cc57fe81f02bc4ce06fcde614ea
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251042
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35951}
2022-02-08 13:54:37 +00:00
Niels Möller
98d26df5b7 Reland "Delete NO_MAIN_THREAD_WRAPPING preprocessor define."
This is a reland of 0f78c6b28d

Original change's description:
> Delete NO_MAIN_THREAD_WRAPPING preprocessor define.
> 
> Since many tests rely on rtc::Thread::Current(), add an
> explicit rtc::AutoThread in the main() function used by tests.
> 
> Bug: webrtc:9714
> Change-Id: Id82121967c9621fe1c2945846009c48139fa57da
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/39680
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28000}

Bug: webrtc:9714
Change-Id: I85f8a7058387771a31c099b1080ae53f1648dce6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137513
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35932}
2022-02-07 12:47:06 +00:00
Mirko Bonadei
c1fd46f879 Revert "Mark all bool conversion operators as explicit"
This reverts commit 325789c457.

Reason for revert: Breaks downstream clients.

Original change's description:
> Mark all bool conversion operators as explicit
>
> An explicit bool conversion operator will still be used implicitly
> when an expression appears in "bool context", e.g., as the condition
> in an if statement, or as argument to logical operators. The
> `explicit` annotation prevents conversion in other contexts, e.g.,
> converting both a and b to bool in an expression like `a == b`.
>
> Bug: None
> Change-Id: I79ef35b1ea831e6011ae472900375ae8a3e617ab
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250664
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35927}

TBR=mbonadei@webrtc.org,nisse@webrtc.org,tommi@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I392cd0c7bd96c90e0db20831864418adb7d58bc3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251080
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Owners-Override: Mirko Bonadei <mbonadei@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@{#35929}
2022-02-07 10:24:45 +00:00
Niels Möller
325789c457 Mark all bool conversion operators as explicit
An explicit bool conversion operator will still be used implicitly
when an expression appears in "bool context", e.g., as the condition
in an if statement, or as argument to logical operators. The
`explicit` annotation prevents conversion in other contexts, e.g.,
converting both a and b to bool in an expression like `a == b`.

Bug: None
Change-Id: I79ef35b1ea831e6011ae472900375ae8a3e617ab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250664
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35927}
2022-02-07 09:14:05 +00:00
Erik Språng
da897930c3 Fix support for booleans in field trial list parser
The FieldTrialList<T> class hold values internally in a std::vector<T>.
One call site assumes a const T& can be retrieved from the vector, but
it turns out that std::vector<bool> has a bit-packed specialization
which means a normal reference can't be generated.
To work around this, change the code to instead use
typename std::vector<T>::const_reference.

Bug: webrtc:13655
Change-Id: I2a515b7064c8760e1a59d1910d59b1bd2c7a6622
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250543
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Auto-Submit: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35902}
2022-02-03 18:36:50 +00:00
Tommi
44156fa024 Remove workaround in AutoSocketServerThread that isn't needed anymore.
Cleanup steps for the Connection class have changed as of:
https://webrtc-review.googlesource.com/c/src/+/249941

However, it turns out that the PortTest suite still needs it, so the
workaround has migrated to there.

Bug: none
Change-Id: Ia68f47b6c65b3a8fd5e8c04d70a43d15ba1a6422
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250223
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35894}
2022-02-03 07:29:22 +00:00
Henrik Boström
595f688b56 Delete legacy rtc::Thread PostTask APIs.
rtc::Thread already contains PostTask/PostDelayedTask methods that are
inherited from webrtc::TaskQueueBase which are named the same thing and
do the same thing.

Bug: webrtc:13582
Change-Id: I23d897a0079496d89564a51cbb26d214b70e132a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/248168
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35881}
2022-02-02 08:32:31 +00:00
Byoungchan Lee
e717567607 Remove constructor_magic.h
All uses of the RTC_DISALLOW_COPY_AND_ASSIGN macro has replaced,
so it is safe to delete this file.

Bug: webrtc:13555, webrtc:13082
Change-Id: I2db1f53d7056d1c31d3ae9daab6e705a7e6a9526
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249261
Reviewed-by: Artem Titov <titovartem@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@{#35831}
2022-01-28 19:15:56 +00:00
Jonas Oreland
3001905072 Fix guess adapter type.
https://crrev.com/b477fc73cfd2f4c09bb9c416b170ba4b566cecaf added a
cost for VPN, but I forgot to fix this method at the same time.
The VPN cost has luckily(?) not yet been rolled out, so no harm done!

Bug: webrtc:13097
Change-Id: I1e513eb0c1d5ca7a8efd184b5cf6ceeca7112cca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249603
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35827}
2022-01-28 15:13:45 +00:00
Artem Titov
6cae2d5513 Reland "Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely"
This reverts commit 3f87250a4f.

Reason for revert: Downstream is fixed

Original change's description:
> Revert "Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely"
>
> This reverts commit 5f0eb93d2a.
>
> Reason for revert: Breaks downstream project. I'm going to fix that one and create a reland of this CL after.
>
> Original change's description:
> > Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely
> >
> > Bug: webrtc:13555, webrtc:13082
> > Change-Id: Iff2cda6f516739419e97e975e03f77a98f74be03
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249260
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Reviewed-by: Artem Titov <titovartem@webrtc.org>
> > Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
> > Cr-Commit-Position: refs/heads/main@{#35805}
>
> TBR=hta@webrtc.org,titovartem@webrtc.org,daniel.l@hpcnt.com,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: I33d497f1132adfe6d151023195a388d9b7d548f9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:13555, webrtc:13082
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249364
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> Owners-Override: Artem Titov <titovartem@webrtc.org>
> Reviewed-by: Andrey Logvin <landrey@webrtc.org>
> Reviewed-by: Björn Terelius <terelius@webrtc.org>
> Commit-Queue: Artem Titov <titovartem@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35807}

# Not skipping CQ checks because this is a reland.

Bug: webrtc:13555, webrtc:13082
Change-Id: I7ef1ef3b6e3c41b1a96014aa75f003c0fcf33949
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249365
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35814}
2022-01-27 12:55:44 +00:00
Artem Titov
3f87250a4f Revert "Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely"
This reverts commit 5f0eb93d2a.

Reason for revert: Breaks downstream project. I'm going to fix that one and create a reland of this CL after.

Original change's description:
> Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely
>
> Bug: webrtc:13555, webrtc:13082
> Change-Id: Iff2cda6f516739419e97e975e03f77a98f74be03
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249260
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
> Cr-Commit-Position: refs/heads/main@{#35805}

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

Change-Id: I33d497f1132adfe6d151023195a388d9b7d548f9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:13555, webrtc:13082
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249364
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Owners-Override: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35807}
2022-01-26 14:56:14 +00:00
Byoungchan Lee
5f0eb93d2a Remove RTC_DISALLOW_COPY_AND_ASSIGN usages completely
Bug: webrtc:13555, webrtc:13082
Change-Id: Iff2cda6f516739419e97e975e03f77a98f74be03
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249260
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35805}
2022-01-26 14:22:16 +00:00
Ali Tofigh
62238097c9 Remove top-level const from parameters in function declarations.
This is a safe cleanup change since top-level const applied to
parameters in function declarations (that are not also
definitions) are ignored by the compiler. Hence, such changes do
not change the type of the declared functions and are simply
no-ops.

Bug: webrtc:13610
Change-Id: Ibafb92c45119a6d8bdb6f9109aa8dad6385163a9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249086
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35802}
2022-01-26 11:05:25 +00:00
Nico Grunbaum
7eac6caeee Don't use wall clock for stats
This uses the local NTP clock for RTCP report block stats.

This code exists in the version that Mozilla is shipping, with a review
here https://phabricator.services.mozilla.com/D127709 .

Bug: webrtc:13484
Change-Id: I2f46ec02acab0bbb09040778b05b248c2d815bd1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/240142
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35787}
2022-01-25 15:39:53 +00:00
Niels Möller
027c793c57 Replace most explicit new RefCountedObject... with make_ref_counted
Bug: webrtc:12701
Change-Id: Iab91f1e96715eed7f9ddcfe1ca55510a18c817eb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/224544
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35786}
2022-01-25 14:28:12 +00:00
Henrik Boström
2dd3915284 Make use of TaskQueue/TaskQueueBase's PostDelayedHighPrecisionTask.
Use cases of TaskQueue or TaskQueueBase that are considered high
precision are updated to make use of PostDelayedHighPrecisionTask
(see go/postdelayedtask-precision-in-webrtc) instead of PostDelayedTask.

The cases here are the ones covered by that document, plus some
testing-only uses. The FrameBuffer2 and DataTracker use cases will
be covered by separate CLs because FrameBuffer2 uses
RepeatingTaskHandle and DataTracker uses dcsctp::Timer.

This protects these use cases against regressions when PostDelayedTask
gets its precision lowered.

This CL also adds TaskQueue::PostDelayedHighPrecisionTask which calls
TaskQueueBase::PostDelayedHighPrecisionTask (same pattern as for
PostDelayedTask).

Bug: webrtc:13604
Change-Id: I7dcab59cbe4d274d27b734ceb4fc06daa12ffd0f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/248864
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35781}
2022-01-25 08:57:36 +00:00
Niels Möller
2d3186e001 Introduce a variant of rtc::split that returns a vector of string_view
Intended to be compatible with absl::StrSplit, but without the binary
cost of that dependency.

Bug: webrtc:13579
Change-Id: I167726903d74b8d5f299886cfb3e5d60610ddb93
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247185
Reviewed-by: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35780}
2022-01-25 08:25:50 +00:00
Henrik Boström
27e8a095bf Add ability to specify delayed task precision in RepeatingTaskHandle.
See go/postdelayedtask-precision-in-webrtc for context of which use
cases are considered "high" or "low". Most use cases are "low" which
is the default, but this CL allows opting in to "high".

Will be used by FrameBuffer2.

Bug: webrtc:13604
Change-Id: Iebf6eea44779873e78746da749a39e1101b92819
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/248861
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35776}
2022-01-24 17:56:50 +00:00
Henrik Boström
2deee4bbb2 Mark rtc::Thread's versions of PostTask/PostDelayedTask deprecated.
Because rtc::Thread inherits from TaskQueueBase, it already implements
a pair of PostTask/PostDelayedTask methods that we want to keep. But in
addition to those, rtc::Thread defines its own PostTask/PostDelayedTask
using templates. These are the versions that we want to deprecate.

They were originally implemented prior to rtc::Thread inheriting from
TaskQueueBase. We want to deprecate them because...
- We don't want to have multiple code paths that do the same thing.
- We want to move away from rtc::Thread to TaskQueueBase long-term.
- These versions are not overridable in Chromium.
- These versions don't have high/low precision versions of PDT.

Helper methods are added to rtc::Thread so that callers don't have to
wrap every lambda in webrtc::ToQueuedTask() and update dependencies.

Bug: webrtc:13582
Change-Id: I58702c53f4cb3705681bd9f1ea16b7aaa5052c18
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247660
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@google.com>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35750}
2022-01-20 12:59:27 +00:00
Henrik Boström
cf9899c518 TaskQueueBase: Add PostDelayedHighPrecisionTask().
As per go/postdelayedtask-precision-in-webrtc we want to reduce the
precision of PostDelayedTask() in order to schedule work on the CPU
more efficiently. In order not to break "high precision" use cases, a
new API is added to allow opting in to high precision.

PostDelayedHighPrecisionTask() has the same precision that
PostDelayedTask() has today, but by changing the interface's
requirements on PostDelayedTask(), adding the high precision version
of it will unblock making the old PostDelayedTask() API lower
precision.

This CL does not update implementations to support low precision so
until those are updated, both PostDelayedTask() and
PostDelayedHighPrecisionTask() have the same precision (=high).

This CL also adds TODOs to make some rtc::Thread-specific versions
of PostTask/PostDelayedTask obsolete, see
https://crbug.com/webrtc/13582 for more info.

Bug: webrtc:13583, webrtc:13582
Change-Id: I4c6d53d22bb299c49893ce9f3ef73a40d8c75de1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247367
Reviewed-by: Markus Handell <handellm@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35748}
2022-01-20 10:45:10 +00:00
Nicolas Avrutin
a62dcd815d Export rtc::tracing symbols for use in Chrome Remote Desktop.
Bug: webrtc:13585
Change-Id: I12d88ae59c59bd3bc81b823e7e5a5b56e5e9fb6d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247440
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35739}
2022-01-19 12:23:14 +00:00
Niels Möller
902b55457a Let a RepeatingTask stop itself by returning a delay of PlusInfinity.
Bug: none
Change-Id: I5bf87e236019d156ffe85c5b91ce09f5f4042937
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247160
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35710}
2022-01-17 14:57:02 +00:00
Tomas Gunnarsson
87e7b3dd6c Fix uaf issue in RepeatingTaskTest
Bug: none
Change-Id: Ic0e5fd1c50a45e4dde21c36925a84b5fa5bdbf8a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247120
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35704}
2022-01-17 09:44:12 +00:00
Byoungchan Lee
14af7622a7 Remove RTC_DISALLOW_COPY_AND_ASSIGN from rtc_base/
Bug: webrtc:13555, webrtc:13082
Change-Id: I406b7f04497562866ea3329e97c5adc96e927b6f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/245680
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35691}
2022-01-13 20:42:15 +00:00
Niels Möller
9512910e6e Update rtc_base to not use implicit T* --> scoped_refptr<T> conversion
Also updated the OperationsChain and CallbackHandle classes to not use
any virtual methods.

Bug: webrtc:13464
Change-Id: I3437d1b7b043339e66411f5a46c226624b7ff9a5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/246102
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35682}
2022-01-13 12:01:30 +00:00
Collin
cb87ec9557 Remove unnecessary imports from //build
rtc_base/BUILD.gn imports //build/config/{crypto,ui}.gni but uses no
flags from them. Since they aren't needed anymore, remove them to
loosen build system coupling.

Blocking https://chromium-review.googlesource.com/c/chromium/src/+/3379123

Bug: chromium:961767
Change-Id: I006163f510a3fa1da88f7cc3e3109f240684457c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/245820
Auto-Submit: Collin Baker <collinbaker@chromium.org>
Commit-Queue: Collin Baker <collinbaker@chromium.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35662}
2022-01-11 21:43:16 +00:00
Niels Möller
bb57de2959 Extend make_ref_counted to interoperate with RefCountedNonVirtual
Update RtpPacketInfos internals to use rtc::make_ref_counted, and a
Data class with no virtual methods.

Bug: webrtc:13464, webrtc:12701
Change-Id: I03f6bee69a9f060dcf287284fc779268d5eb433e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/244505
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35660}
2022-01-11 16:06:34 +00:00
Evan Shrubsole
21e97f9b9d Add unary operator- to units
This will be used in the frame buffer 3 scheduler.

Bug: webrtc:13343
Change-Id: Ib699072021da30022a34aabe24e36a37e89ddf41
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/245642
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35658}
2022-01-11 14:12:54 +00:00
Byoungchan Lee
be87f0a0f3 Clarify about static variables in logging.cc.
Bug: None
Change-Id: Ia6c751485b5b0a88ce34106a2159fe8af52fc41c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237321
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35554}
2021-12-17 13:52:01 +00:00
Niels Möller
539f3e1a89 Deprecate BasicNetworkManager default constructor
Replaced with a constructor with a SocketFactory argument.

Bug: webrtc:13145
Change-Id: I30db4ad089009284e1be8a6bbdadd5a671e93713
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239180
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35508}
2021-12-09 12:10:20 +00:00
Yun Zhang
4774a9fcb8 Fix rate statistic when time window running out of samples
Current rate statistic tracker has assumption, the tracking window will
always be full after first filled up. This assumption looks not always
true. One example is the input_framerate_ tracker inside
video_stream_sender.cc which is used for setup frame droper and encoder.
Whenever there is a gap in video stream, like mute/unmute,
pacer pause/unpause etc. The fps detected from the rate_statistics
becomes samples_filled_partial_window / full_window_size, which could
be extremely low for a while. This creates a misalignment between the
fps we told encoder/frame dropper, and the real fps we fed into them,
which causes short-term serious overshot and very bad experience on
delay, avsync, congestion etc. This may also depends on how fast
encoder could react to the gap between set fps and real fps, but
libvpx and openh264 at least cannot handle this well.

So propose a fix to update first timestamp after tracker window
drained. This will give more accurate fps estimate similar based on
active window after sample gets drained

Bug: webrtc:13403
Change-Id: I96792c11091fe8bfa63e669f4360a3b3e95593e1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237720
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35447}
2021-11-30 23:57:40 +00:00
Harald Alvestrand
ef5b21e637 Deprecate and remove usage for WARNING log level
Bug: webrtc:13362
Change-Id: Ida112158e4ac5f667e533a0ebfedb400c84df4d9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239124
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35425}
2021-11-27 22:21:54 +00:00
Niels Möller
150503566c Delete unused classes Win32SocketServer, Win32Socket, Win32Thread.
Bug: webrtc:6424. webrtc:13065
Change-Id: I7f180831d3b01ad6d127b7eec51ecc9b2d8046a7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239125
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35424}
2021-11-26 16:51:56 +00:00
Harald Alvestrand
5f34130f26 Declare LERROR deprecated and remove all usage in webrtc
Bug: webrtc:13362
Change-Id: I1c6c6eccd950d73be616b34f96db7832ff94377e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238804
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35416}
2021-11-24 14:34:24 +00:00
Harald Alvestrand
a18cad9c09 Add compile-time warning for RTC_LOG(INFO)
Bug: webrtc:13362
Change-Id: I3727891bfeb192941f249a74ead5ef38ac8acc2f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238800
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35411}
2021-11-23 21:46:38 +00:00
Byoungchan Lee
524a422ecd Modify global variables to not call the destructor on exit.
In logging.cc, use the pointer of the static variable so that
it doesn't need a global constructor/exit time destructor.

In RTCFieldTrials.mm, store the field trial string as a char pointer
instead of a std::unique_ptr to ensure that it is never freed.

LSAN will be unhappy with this fix, but WebRTC itself hasn't been
tested with LSAN enabled, and any code changed in this CL does not
build with build_with_chromium=true, so it shouldn't be a problem.

Bug: webrtc:9693, webrtc:11665
Change-Id: Ia28e3534170e0817b815717f6efe862f7b51ef62
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237320
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35391}
2021-11-19 13:32:21 +00:00
Tommi
0a7a8e0aba Remove DEPRECATED_AsyncInvoker::Flush.
The method is not used so can be safely deleted before the full
(and eventual) removal of the implementation.

Bug: webrtc:12339
Change-Id: I7726313c46562041f670c3baec2db955de0b4298
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238141
Auto-Submit: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35375}
2021-11-18 09:08:55 +00:00
Tommi
9ebe6d7c88 Remove the AsyncInvoker alias.
This emphasizes the "hint" to potential external users that the
class has been deprecated.

Bug: webrtc:12339
Change-Id: Iab83481af69a505059297cce959f02b5ab649f2f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237805
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35368}
2021-11-17 13:37:06 +00:00
Florent Castelli
f94c053814 VSS: Fix TSAN error related to internal variables
The VSS is used in tests, usually from the signaling thread, but all the
network emulation happens in the network thread. TSAN will then complain
about variable access from different threads without any synchronization.

Bug: b/204654931
Change-Id: I164f5d73e559f00e6bf390ef5e5f112bcc58ce11
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237784
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35357}
2021-11-16 15:05:05 +00:00
Artem Titov
3395107778 Remove old definition of the macro RTC_NOTREACHED
Bug: webrtc:9065
Change-Id: I3cb166f217893808af5708ede69abaebb5bde28e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237809
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35356}
2021-11-16 13:56:00 +00:00
Byoungchan Lee
83ceb90fdf Fix -Wunused-but-set-variable
Bug: chromium:1203071
Change-Id: I338bd31ab0e74751f2c0abd5d441ea03ac33dead
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237880
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35350}
2021-11-16 10:30:30 +00:00
Evan Shrubsole
f0f474373c Fix RepeatingTask unittest flakiness
Use a fake task queue to test the RepeatingTask rather than a real
task queue, which removes the need for Sleep(). This fixes the flakiness
issues as the class is no deterministic.

BUG=webrtc:12808

Change-Id: I8c6a8535165b076f5fe6ec3e65ebcf7f07008737
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237803
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35349}
2021-11-16 09:19:50 +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
b8f7ef1c1b Permit current queue reference to be null on sequence checker creation
This makes it not an error to bind a SequenceChecker before the
global TaskQueueBase::Current() is set.

Unbreaks the SDP integration fuzzer.

Bug: webrtc:13374
Change-Id: Ic4c23fa29f4598290cf9196550e5133ba753f44f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237620
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35341}
2021-11-15 09:39:10 +00:00
Danil Chapovalov
1b320f8b7d Speed up field trial parser for large inputs
Change search for next separator to be linear in length of the string
(instead of potentially quadratic)
Reduce copying of std::string by switch to string_view
Throttle logging about unknown key.

Bug: b/204541739
Change-Id: I81d5cd4432966a0a5808077f9001bc62960e5e60
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237500
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Fanny Linderborg <linderborg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35330}
2021-11-10 12:31:34 +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
Niels Möller
646fddc3c9 Fix TCPPort::SetOption to apply options to the accepted sockets
The AsyncListenSocket::SetOption method then gets unused, and can be
deleted.

Bug: webrtc:13065
Change-Id: Idcf70a75b96036290fdceff6e0f96a8d5617f87f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236580
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35302}
2021-11-03 11:02:46 +00:00
Taylor Brandstetter
3041eb21e9 Improve epoll error handling.
The main change is to remove sockets from epoll if there are no
requested events, which happens when a socket is considered closed
(due to an error or otherwise). This prevents a busy loop when a socket
is an error condition where it will constantly be signaled, but not
deleted by higher level code.

Other related changes:
* Set DE_CLOSE on errors regardless of whether the socket is readable or
  writable.
* Don't set DE_ACCEPT on errors.
* Handle getsockopt(SO_ERROR) errors.
* In IsDescriptorClosed:
  * Retry recv on EINTR.
  * Treat ECONNABORTED and EPIPE as errors.

Original patch contributed by andrey.semashev@gmail.com.

Bug: webrtc:11124
Change-Id: I67f33213efc1418b1ffc8f4867f606b7f8dc4ece
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235863
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35300}
2021-11-02 21:27:03 +00:00
Mirko Bonadei
e5e78c4521 Fix -Wunused-but-set-variable.
Bug: None
Change-Id: I8943227108e46c4c942895e4bd8fb276947502e0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236525
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35272}
2021-10-28 12:53:49 +00:00
Mirko Bonadei
af09c13096 Fix -Wunused-but-set-variable.
Bug: None
Change-Id: I3be977ac0536cd6686f73a9e51b7f8adff842d31
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236480
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35268}
2021-10-27 09:26:42 +00:00
Niels Möller
d30ece1804 Reland "Take out listen support from AsyncPacketSocket"
This is a reland of b141c162ee

Original change's description:
> Take out listen support from AsyncPacketSocket
>
> Moved to new interface class AsyncListenSocket.
>
> Bug: webrtc:13065
> Change-Id: Ib96ce154ba19979360ecd8144981d947ff5b8b18
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232607
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35234}

Bug: webrtc:13065
Change-Id: I88bebdd80ebe6bcf6ac635023924d79fbfb76813
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235960
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35260}
2021-10-25 08:26:56 +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
Evan Shrubsole
1f30c2ba9b Revert "Take out listen support from AsyncPacketSocket"
This reverts commit b141c162ee.

Reason for revert: Breaking WebRTC rolls. See https://ci.chromium.org/ui/b/8832847811929676465 for an example failed build.

Original change's description:
> Take out listen support from AsyncPacketSocket
>
> Moved to new interface class AsyncListenSocket.
>
> Bug: webrtc:13065
> Change-Id: Ib96ce154ba19979360ecd8144981d947ff5b8b18
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232607
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35234}

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

Bug: webrtc:13065
Change-Id: Id5d5b35cb21704ca4e3006caf1636906df062609
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235824
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35249}
2021-10-20 15:52:03 +00:00
Byoungchan Lee
08438fcd9a Remove a function for posting tasks to the global queue on MacOS/iOS and make it private.
Since `PostTaskToGlobalQueue` is somewhat different from
other TaskQueue APIs, there are concerns that it should not be
a public API.

Remove this from task_queue_gcd.h and make it a private static function
of AsyncResolver.

Bug: webrtc:13237
Change-Id: Ib4aff296f894a4f3b051969d176369e13a10088f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234900
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35236}
2021-10-19 11:45:12 +00:00
Niels Möller
b141c162ee Take out listen support from AsyncPacketSocket
Moved to new interface class AsyncListenSocket.

Bug: webrtc:13065
Change-Id: Ib96ce154ba19979360ecd8144981d947ff5b8b18
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232607
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35234}
2021-10-19 11:17:02 +00:00
Nico Weber
8caac81390 Delete definition of GetOsVersion()
I deleted the declaration of this function in
https://webrtc-review.googlesource.com/c/src/+/234160 but forgot to
delete the definition.

This now actually happens to remove one call to GetVersionEx.

No behavior change.

Bug: chromium:1255114
Change-Id: I65b61a362da9b6d41c16a9da23781d5a1ccf885f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235080
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#35196}
2021-10-13 19:26:10 +00:00
Byoungchan Lee
7284bd4dab Use GCD instead of Detached Thread in Async Resolver when on MacOS/iOS
The advantage is that GCD maintains the internal thread pool and
spawns threads when needed. I would expect the behavior to be
almost identical to creating a thread using PlatformThread.

Bug: webrtc:13237
Change-Id: Ie4406b5d128c244f66a73830d5a27f2d8fd88549
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234300
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35165}
2021-10-08 02:47:51 +00:00
Nico Weber
bde89ab09e win: Disable deprecation warning for one call of GetVersionEx
Like https://chromium-review.googlesource.com/c/chromium/src/+/3207949
but using pragmas that work with both cl.exe and (very new versions of)
clang-cl.

webrtc also needs the granularity, see e.g.
https://webrtc-review.googlesource.com/c/src/+/229140

Bug: chromium:1255114
Change-Id: I6a2bf9447f377988a2a3844d6ef16aeee63734f7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234420
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#35158}
2021-10-06 16:32:52 +00:00
Niels Möller
6d19d14c26 Add AsyncListenSocket, as alias for AsyncPacketSocket
A preparation for splitting server sockets out into a separate
interface, see https://webrtc-review.googlesource.com/c/src/+/232607.

Transition plan:

1. Land this cl.

2. Update downstream code to use the new name.

3. Attempt landing
   https://webrtc-review.googlesource.com/c/src/+/232607. May need
   additional steps to not break downstream implementations of
   PacketSocketFactory::CreateServerTcpSocket.

Bug: webrtc:13065
Change-Id: Ife448c705222f4c9f66a096e3dc7eb07e0f9c3af
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/233700
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35155}
2021-10-06 11:42:50 +00:00
Nico Weber
79bd4f1bc3 win: Consolidate on a single version checking API
No intended behavior change.

Happens to remove one call to GetVersionEx.

Bug: chromium:1255114
Change-Id: If4d1c57fa27ad4a7547f8f18c3abe38bc9b2a325
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234160
Reviewed-by: Joe Downing <joedow@chromium.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35146}
2021-10-05 22:13:37 +00:00
Mirko Bonadei
54c90f2330 [-Wshadow] - Fix some warnings.
First CL to try to understand the extent of the cleanup needed in
order to remove -Wno-shadow and follow Chromium on enabling this
diagnostic.

Bug: webrtc:13219
Change-Id: Ie699762da50fe3dbc08b1fd92220962d4b7da86b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/233641
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35134}
2021-10-03 11:53:16 +00:00
Shuhai Peng
f270770679 video: Implement bandwidth based scaler
The |slice_qp_detla| reported by the hardware is not credible, which
causing the quality scaler cannot work properly,the resolution cannot
be adjusted correctly.

To fix this issue, this CL implements a bandwidth scaler which is used
for adjust resolution, this scaler will be used when QP based quality
scaler is not working due to untrusted QP reported by HW AVC encoder.

Bug: webrtc:12942
Change-Id: I2fc5f07a5400ec7e5ead2c2c502faee84d7f2a76
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228860
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35120}
2021-09-29 10:39:27 +00:00
Niels Möller
aa373166f7 Pass a SocketFactory to BasicNetworkManager constructor
Used by QueryDefaultLocalAddress, instead of relying on the update
thread's associated socket server.

This is not the only use of rtc::Thread::socketserver() in the
BasicNetworkManager class. It also interacts with the thread's
socket server to call set_network_binder. That is unchanged by this cl,
perhaps those calls can be moved to the caller of StartNetworkMonitor and
StopNetworkMonitor.

Bug: webrtc:13145
Change-Id: If109c2dcb0e74b183e10bb3db7a5aefcc95d1a8c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232613
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35118}
2021-09-29 08:59:37 +00:00
Niels Möller
4a1c2c4754 Delete wiring of SignalAddressReady for TCP ports
This feature is used only by chromium, and only for UDP sockets.

Bug: webrtc:13065
Change-Id: I207ea643aa57cf23bdd36266895f65f1ee251aaa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232860
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35106}
2021-09-28 10:05:05 +00:00
Niels Möller
acf4f55df3 Delete unused FifoBuffer methods
Unused since https://webrtc-review.googlesource.com/c/src/+/186665

Bug: webrtc:11988, webrtc:6424
Change-Id: Ib09e6b862f7550d07d5adf8ce82b74698419730a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/233081
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35097}
2021-09-27 14:32:47 +00:00
Danil Chapovalov
48f9525078 Delete BitBuffer
All BitBuffer usage was replaced with BitstreamReader

Bug: None
Change-Id: Ia91826cea2561679709c0c22767958de596a282c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232125
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35056}
2021-09-21 16:28:38 +00:00
Victor Boivie
b918230640 Move StrongAlias to rtc_base
It's useful for other parts of WebRTC and there is no real reason why
it should be located in net/dcsctp.

Bug: None
Change-Id: Iccaed4e943e21ddaea8603182d693114b2da9f6b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232606
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35055}
2021-09-21 15:17:26 +00:00
Danil Chapovalov
1ce585953c Fix integer underflow in BitstreamReader::ConsumeBits
Unlike ReadBits, ConsumeBits doesn't limit number of bits it may advance,
and thus should work when that number is close to the integer limit

Bug: chromium:1250730
Change-Id: Ia7847869ef9d3fc16450d572c9e2be6e1aa36741
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232332
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35042}
2021-09-20 19:37:49 +00:00
philipel
afc237751a Allow CopyOnWriteBuffer to accept vector-like types.
Bug: none
Change-Id: I03ee91be151e10d6b0385b462158ecd0bd9ad4ed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232129
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35039}
2021-09-20 14:02:05 +00:00
Niels Möller
4420380f38 Use string_view as input type for internal string utilities
Bug: None
Change-Id: I2bfdaf4e7fac109842cc9fde8dfa28ab4961c3fd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232127
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35022}
2021-09-17 09:11:21 +00:00
Stephan Hartmann
3987e61086 GCC: fix template specialization in webrtc::BitstreamReader
GCC complains that explicit specialization in non-namespace scope
is happening for webrtc::BitstreamReader::Read(). However,
specializationvfor bool isn't used because std::is_unsigned<bool>::value
returns true. Add std::is_same for bool check and enable second
specialization only for bool types.

Bug: chromium:819294
Change-Id: I1873cd59e2737516bd4012fb952da65d6bf3172b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231561
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35007}
2021-09-15 17:20:50 +00:00
Jonas Oreland
ac554ebbc5 Add VPN detection by mac-address for Windows
This patch adds VPN detection for windows
based on known MAC addresses.
- Cisco AnyConnect
- GlobalProtect Virtual Ethernet

Bug: webrtc:13097
Change-Id: Ia90ee50be0dc2dcd2e6e9de1493fdd2c5e7d9d3a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/230245
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34997}
2021-09-15 08:57:28 +00:00
Taylor Brandstetter
bd917a13fb Don't invoke custom certificate verifier unless there is an error.
The custom callback is intended to override errors, so there's no
point in calling it if the status is ok.

Calling it during an otherwise successful verification was an
unintentional change from:
https://webrtc-review.googlesource.com/c/src/+/196941

This is misleading as the return value isn't even used.

Bug: chromium:1247577
Change-Id: Id74411f7364537a3225021e7631bc9ab962889ee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231881
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34994}
2021-09-15 00:04:27 +00:00
Åsa Persson
06defc4320 QualityRampupExperiment: SetMaxBitrate may not be set correctly.
Call SetMaxBitrate when encoder is configured instead of in OnMaybeEncodeFrame (which is called after the initial frame dropping ->
max bitrate is not set for dropped frames).

Added support for single active stream configuration.

Bug: none
Change-Id: I33ff96e7feed70b9ea3c9b3da89f117859108347
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231681
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34973}
2021-09-11 10:28:43 +00:00
Harald Alvestrand
b32650e219 Improve SSLVerifyCallback variable naming
The names used were confusing.

Bug: chromium:1247577
Change-Id: I007f8b9b6b9c2188cbfc2dcfb2499acf3c14a9ce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231683
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34967}
2021-09-10 13:40:31 +00:00
Niels Möller
50f7c2cc27 Update socket unittests to not use rtc::Thread::socketserver()
Bug: webrtc:13145
Change-Id: I714e2002697f988c73155e6d8febefc6aff4e34b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231540
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34951}
2021-09-08 12:41:39 +00:00
Niels Möller
634f27950e Delete redundant function rtc::tokenize_with_empty_tokens
It was identical to rtc::split.

Bug: webrtc:6424
Change-Id: I1118ad34050c0eb324ade347c97174f3ad4b39a7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231234
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34946}
2021-09-08 09:16:09 +00:00
Niels Möller
bc93575749 Delete unused class PairHash
Partial revert of
https://webrtc-review.googlesource.com/c/src/+/216243, this class is
no longer needed, after
https://webrtc-review.googlesource.com/c/src/+/229182 replaced usage
of unordered_map with flat_map.

Bug: webrtc:12689
Change-Id: I56e4d9326334b78eb09d471ded752e58601f4abf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231235
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Victor Boivie <boivie@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34941}
2021-09-07 15:05:00 +00:00
Niels Möller
7b5fca4cf4 Delete left-over method SocketFactory::CreateAsyncSocket
Bug: webrtc:13065
Change-Id: I604fc8c37bfde762a992adfe82f187bc3dd1800d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231231
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34936}
2021-09-07 10:52:57 +00:00
Niels Möller
2bd1fadb77 Delete unused variants of rtc::tokenize
Bug: webrtc:6424
Change-Id: I16f3313e242e0e9ee2039a79d3a8b50c28190832
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231129
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34918}
2021-09-03 14:28:47 +00:00