Chromium Code Reviews| Index: webrtc/call/bitrate_allocator.h |
| diff --git a/webrtc/call/bitrate_allocator.h b/webrtc/call/bitrate_allocator.h |
| index 37e15b4f7b016c7315308e98302d90d030dfe32f..6c5624ea62825e07b1d72d623d94785279ec0084 100644 |
| --- a/webrtc/call/bitrate_allocator.h |
| +++ b/webrtc/call/bitrate_allocator.h |
| @@ -17,8 +17,7 @@ |
| #include <utility> |
| #include <vector> |
| -#include "webrtc/base/criticalsection.h" |
| -#include "webrtc/base/thread_annotations.h" |
| +#include "webrtc/base/sequenced_task_checker.h" |
| namespace webrtc { |
| @@ -121,31 +120,24 @@ class BitrateAllocator { |
| typedef std::vector<ObserverConfig> ObserverConfigs; |
| ObserverConfigs::iterator FindObserverConfig( |
| - const BitrateAllocatorObserver* observer) |
| - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| + const BitrateAllocatorObserver* observer); |
| typedef std::multimap<uint32_t, const ObserverConfig*> ObserverSortingMap; |
| typedef std::map<BitrateAllocatorObserver*, int> ObserverAllocation; |
| - ObserverAllocation AllocateBitrates(uint32_t bitrate) |
| - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| + ObserverAllocation AllocateBitrates(uint32_t bitrate); |
| - ObserverAllocation ZeroRateAllocation() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| - ObserverAllocation LowRateAllocation(uint32_t bitrate) |
| - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| + ObserverAllocation ZeroRateAllocation(); |
| + ObserverAllocation LowRateAllocation(uint32_t bitrate); |
| ObserverAllocation NormalRateAllocation(uint32_t bitrate, |
| - uint32_t sum_min_bitrates) |
| - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| + uint32_t sum_min_bitrates); |
| ObserverAllocation MaxRateAllocation(uint32_t bitrate, |
| - uint32_t sum_max_bitrates) |
| - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| + uint32_t sum_max_bitrates); |
| - uint32_t LastAllocatedBitrate(const ObserverConfig& observer_config) |
| - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| + uint32_t LastAllocatedBitrate(const ObserverConfig& observer_config); |
| // The minimum bitrate required by this observer, including enable-hysteresis |
| // if the observer is in a paused state. |
| - uint32_t MinBitrateWithHysteresis(const ObserverConfig& observer_config) |
| - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| + uint32_t MinBitrateWithHysteresis(const ObserverConfig& observer_config); |
| // Splits |bitrate| evenly to observers already in |allocation|. |
| // |include_zero_allocations| decides if zero allocations should be part of |
| // the distribution or not. The allowed max bitrate is |max_multiplier| x |
| @@ -153,22 +145,20 @@ class BitrateAllocator { |
| void DistributeBitrateEvenly(uint32_t bitrate, |
| bool include_zero_allocations, |
| int max_multiplier, |
| - ObserverAllocation* allocation) |
| - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| - bool EnoughBitrateForAllObservers(uint32_t bitrate, uint32_t sum_min_bitrates) |
| - EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
| + ObserverAllocation* allocation); |
| + bool EnoughBitrateForAllObservers(uint32_t bitrate, |
| + uint32_t sum_min_bitrates); |
| LimitObserver* const limit_observer_; |
| - |
| - rtc::CriticalSection crit_sect_; |
| + rtc::SequencedTaskChecker sequenced_checker_; |
| // Stored in a list to keep track of the insertion order. |
| - ObserverConfigs bitrate_observer_configs_ GUARDED_BY(crit_sect_); |
|
pbos-webrtc
2016/07/13 12:35:38
Can you have these GUARDED_BY the sequenced_checke
perkj_webrtc
2016/07/14 10:11:27
Done.
|
| - uint32_t last_bitrate_bps_ GUARDED_BY(crit_sect_); |
| - uint32_t last_non_zero_bitrate_bps_ GUARDED_BY(crit_sect_); |
| - uint8_t last_fraction_loss_ GUARDED_BY(crit_sect_); |
| - int64_t last_rtt_ GUARDED_BY(crit_sect_); |
| + ObserverConfigs bitrate_observer_configs_; |
| + uint32_t last_bitrate_bps_; |
| + uint32_t last_non_zero_bitrate_bps_; |
| + uint8_t last_fraction_loss_; |
| + int64_t last_rtt_; |
| // Number of mute events based on too low BWE, not network up/down. |
| - int num_pause_events_ GUARDED_BY(crit_sect_); |
| + int num_pause_events_; |
| Clock* const clock_; |
| int64_t last_bwe_log_time_; |
| }; |