Commit graph

7 commits

Author SHA1 Message Date
Tommi
c848268ab1 Use SequenceChecker(SequenceChecker::kDetached) in a few places.
This CL is partly a test to see if there's an impact on binary size:
- Not a big difference for binaries (decrease): -776b to -4Kb
- For libraries (libwebrtc.a) it actually increases the size: +40Kb

Secondarily this CL is basically to introduce this pattern to the
code base. In terms of LOC, this makes things slightly more compact.

From:

  class Foo {
   public:
     Foo() {
       checker_.Detach();
     }
   private:
    SequenceChecker checker_;
  };

To:

  class Foo {
   public:
     Foo() = default;
   private:
    SequenceChecker checker_{SequenceChecker::kDetached};
  };

Bug: none
Change-Id: I59fc34ccea10847e13455a349851ce9a0af458e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299020
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39664}
2023-03-24 07:44:18 +00:00
Harald Alvestrand
5ad491ec87 Remove call operator from UniqueIdGenerator classes
Call operators do not improve code clarity, and usage was moderate.

Bug: None
Change-Id: I8d86bd7d435ce88e99f4abee8ab95a336d47dc22
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/292960
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39294}
2023-02-10 13:10:35 +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
Artem Titov
96e3b991da Use backticks not vertical bars to denote variables in comments for /rtc_base
Bug: webrtc:12338
Change-Id: I72fcb505a92f03b2ace7160ee33d555a977eddfd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226955
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34587}
2021-07-28 13:51:47 +00:00
Tomas Gunnarsson
64099bcbe7 Add locking to UniqueRandomIdGenerator.
The SdpOfferAnswerHandler::ssrc_generator_ variable is used from
multiple threads.

Adding thread checks + tests for UniqueNumberGenerator along the way.

Bug: webrtc:12666
Change-Id: Id2973362a27fc1d2c7db60de2ea447d84d18ae3e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214702
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33668}
2021-04-09 10:04:25 +00:00
Elad Alon
efc9a14a2b Make UniqueNumberGenerator::AddKnownId() return a value
Make AddKnownId() return a value to indicate whether the ID was
known before, or has only been made known now.
This allows users of the class to RTC_DCHECK that no collisions
existed in their seed set, for instance.

This change is done for the following classes:
1. UniqueNumberGenerator
2. UniqueRandomIdGenerator
3. UniqueStringGenerator

Bug: None
Change-Id: I627d2821cb76aa333075e36575088d76dbeb3665
Reviewed-on: https://webrtc-review.googlesource.com/c/121780
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Amit Hilbuch <amithi@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26621}
2019-02-09 00:55:14 +00:00
Amit Hilbuch
dbb49dfb27 Moving UniqueIdGenerator into rtc_base.
UniqueIdGenerator classes are useful outside the pc directory.
This change moves them to the rtc_base directory to enable code
in all directories to reference them.

Bug: None
Change-Id: I1c77da87ea26d9611f37dc1d4d2c16006a6589c6
Reviewed-on: https://webrtc-review.googlesource.com/c/119460
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26378}
2019-01-24 00:52:31 +00:00
Renamed from pc/unique_id_generator.h (Browse further)