Chromium Code Reviews| Index: webrtc/modules/congestion_controller/probe_controller.cc |
| diff --git a/webrtc/modules/congestion_controller/probe_controller.cc b/webrtc/modules/congestion_controller/probe_controller.cc |
| index 72d0e9ed0dbdb54b0b9698e86dcd5816527f6507..d3e43ef006c9bf10ff1f115d422433631c6bd1a8 100644 |
| --- a/webrtc/modules/congestion_controller/probe_controller.cc |
| +++ b/webrtc/modules/congestion_controller/probe_controller.cc |
| @@ -50,16 +50,9 @@ constexpr int kRepeatedProbeMinPercentage = 70; |
| ProbeController::ProbeController(PacedSender* pacer, Clock* clock) |
| : pacer_(pacer), |
| clock_(clock), |
| - network_state_(kNetworkUp), |
| - state_(State::kInit), |
| - min_bitrate_to_probe_further_bps_(kExponentialProbingDisabled), |
| - time_last_probing_initiated_ms_(0), |
| - estimated_bitrate_bps_(0), |
| - start_bitrate_bps_(0), |
| - max_bitrate_bps_(0), |
| - last_alr_probing_time_(clock_->TimeInMilliseconds()), |
| - enable_periodic_alr_probing_(false), |
| - mid_call_probing_waiting_for_result_(false) {} |
| + enable_periodic_alr_probing_(false) { |
| + Reset(); |
|
stefan-webrtc
2017/03/07 12:16:55
I think indentation is wrong here.
|
| + } |
| void ProbeController::SetBitrates(int64_t min_bitrate_bps, |
| int64_t start_bitrate_bps, |
| @@ -186,6 +179,19 @@ void ProbeController::EnablePeriodicAlrProbing(bool enable) { |
| enable_periodic_alr_probing_ = enable; |
| } |
| +void ProbeController::Reset() { |
| + rtc::CritScope cs(&critsect_); |
| + network_state_ = kNetworkUp; |
| + state_ = State::kInit; |
| + min_bitrate_to_probe_further_bps_ = kExponentialProbingDisabled; |
| + time_last_probing_initiated_ms_ = 0; |
| + estimated_bitrate_bps_ = 0; |
| + start_bitrate_bps_ = 0; |
| + max_bitrate_bps_ = 0; |
| + last_alr_probing_time_ = clock_->TimeInMilliseconds(); |
| + mid_call_probing_waiting_for_result_ = false; |
|
stefan-webrtc
2017/03/07 12:16:55
Can we do something like this instead:
*this = Pro
philipel
2017/03/07 13:09:13
I can see two problems with that. First, what will
stefan-webrtc
2017/03/07 13:11:25
Agree, that seems very risky. :)
|
| +} |
| + |
| void ProbeController::Process() { |
| rtc::CritScope cs(&critsect_); |