Make ChannelInterface::Enabled() be async.

* Changing return value from bool to void since the operation as async
  effects anyway.
* Removing the `enabled()` accessor due to potential threading issues
  and potential TOCTOU issues. It was only used in one place anyway.
* Applying thread restrictions to member variables.

Bug: none
Change-Id: I51949f5594339952d7b717cfd82f99b532e86b23
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216182
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33830}
This commit is contained in:
Tommi
2021-04-26 10:20:19 +02:00
committed by Commit Bot
parent 448d18b18d
commit 1959f8fedc
6 changed files with 35 additions and 21 deletions

View File

@ -37,10 +37,8 @@ class ChannelInterface {
virtual const std::string& content_name() const = 0;
virtual bool enabled() const = 0;
// Enables or disables this channel
virtual bool Enable(bool enable) = 0;
virtual void Enable(bool enable) = 0;
// Used for latency measurements.
virtual sigslot::signal1<ChannelInterface*>& SignalFirstPacketReceived() = 0;