Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(404)

Unified Diff: webrtc/modules/congestion_controller/congestion_controller.cc

Issue 2752353003: Potential race-condition resolution in CongestionController::min_bitrate_bps_ (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/congestion_controller/include/congestion_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/congestion_controller/congestion_controller.cc
diff --git a/webrtc/modules/congestion_controller/congestion_controller.cc b/webrtc/modules/congestion_controller/congestion_controller.cc
index fdce8da4359e8d27305a7ca39661394538f8177d..685418277253cb6cad8fa94b7fa35d10e27862bc 100644
--- a/webrtc/modules/congestion_controller/congestion_controller.cc
+++ b/webrtc/modules/congestion_controller/congestion_controller.cc
@@ -171,12 +171,11 @@ CongestionController::CongestionController(
remote_bitrate_estimator_(remote_bitrate_observer, clock_),
remote_estimator_proxy_(clock_, packet_router_),
transport_feedback_adapter_(clock_),
- min_bitrate_bps_(congestion_controller::GetMinBitrateBps()),
- max_bitrate_bps_(0),
last_reported_bitrate_bps_(0),
last_reported_fraction_loss_(0),
last_reported_rtt_(0),
network_state_(kNetworkUp),
+ min_bitrate_bps_(congestion_controller::GetMinBitrateBps()),
delay_based_bwe_(new DelayBasedBwe(event_log_, clock_)) {
delay_based_bwe_->SetMinBitrate(min_bitrate_bps_);
worker_thread_checker_.DetachFromThread();
@@ -208,14 +207,13 @@ void CongestionController::SetBweBitrates(int min_bitrate_bps,
probe_controller_->SetBitrates(min_bitrate_bps, start_bitrate_bps,
max_bitrate_bps);
- max_bitrate_bps_ = max_bitrate_bps;
remote_bitrate_estimator_.SetMinBitrate(min_bitrate_bps);
- min_bitrate_bps_ = min_bitrate_bps;
{
rtc::CritScope cs(&bwe_lock_);
if (start_bitrate_bps > 0)
delay_based_bwe_->SetStartBitrate(start_bitrate_bps);
+ min_bitrate_bps_ = min_bitrate_bps;
delay_based_bwe_->SetMinBitrate(min_bitrate_bps_);
}
MaybeTriggerOnNetworkChanged();
@@ -233,8 +231,6 @@ void CongestionController::OnNetworkRouteChanged(
// no longer exposed outside CongestionController.
bitrate_controller_->ResetBitrates(bitrate_bps, min_bitrate_bps,
max_bitrate_bps);
- min_bitrate_bps_ = min_bitrate_bps;
- max_bitrate_bps_ = max_bitrate_bps;
// TODO(honghaiz): Recreate this object once the remote bitrate estimator is
// no longer exposed outside CongestionController.
remote_bitrate_estimator_.SetMinBitrate(min_bitrate_bps);
@@ -243,9 +239,10 @@ void CongestionController::OnNetworkRouteChanged(
network_route.remote_network_id);
{
rtc::CritScope cs(&bwe_lock_);
+ min_bitrate_bps_ = min_bitrate_bps;
delay_based_bwe_.reset(new DelayBasedBwe(event_log_, clock_));
delay_based_bwe_->SetStartBitrate(bitrate_bps);
- delay_based_bwe_->SetMinBitrate(min_bitrate_bps);
+ delay_based_bwe_->SetMinBitrate(min_bitrate_bps_);
}
probe_controller_->Reset();
« no previous file with comments | « no previous file | webrtc/modules/congestion_controller/include/congestion_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698