Use propagated instead of global clock in AlrDetector
Bug: webrtc:42223992
Change-Id: I7da261c459e5592a98da1f2b4808a826cdeee8ba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/404241
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45327}
diff --git a/modules/congestion_controller/goog_cc/BUILD.gn b/modules/congestion_controller/goog_cc/BUILD.gn
index b1cd64c..5d65bc2 100644
--- a/modules/congestion_controller/goog_cc/BUILD.gn
+++ b/modules/congestion_controller/goog_cc/BUILD.gn
@@ -81,7 +81,6 @@
"../../../api/units:timestamp",
"../../../logging:rtc_event_pacing",
"../../../rtc_base:checks",
- "../../../rtc_base:timeutils",
"../../../rtc_base/experiments:alr_experiment",
"../../../rtc_base/experiments:field_trial_parser",
"../../pacing:interval_budget",
diff --git a/modules/congestion_controller/goog_cc/alr_detector.cc b/modules/congestion_controller/goog_cc/alr_detector.cc
index d7fde1a..2c97e0a 100644
--- a/modules/congestion_controller/goog_cc/alr_detector.cc
+++ b/modules/congestion_controller/goog_cc/alr_detector.cc
@@ -24,7 +24,6 @@
#include "rtc_base/checks.h"
#include "rtc_base/experiments/alr_experiment.h"
#include "rtc_base/experiments/struct_parameters_parser.h"
-#include "rtc_base/time_utils.h"
namespace webrtc {
@@ -75,7 +74,7 @@
bool state_changed = false;
if (alr_budget_.budget_ratio() > conf_.start_budget_level_ratio &&
!alr_started_time_) {
- alr_started_time_ = Timestamp::Millis(TimeMillis());
+ alr_started_time_ = env_.clock().CurrentTime();
state_changed = true;
} else if (alr_budget_.budget_ratio() < conf_.stop_budget_level_ratio &&
alr_started_time_) {
diff --git a/modules/congestion_controller/goog_cc/alr_detector.h b/modules/congestion_controller/goog_cc/alr_detector.h
index c250e5d..5b74c44 100644
--- a/modules/congestion_controller/goog_cc/alr_detector.h
+++ b/modules/congestion_controller/goog_cc/alr_detector.h
@@ -43,8 +43,8 @@
// Set current estimated bandwidth.
void SetEstimatedBitrate(DataRate bitrate);
- // Returns time in milliseconds when the current application-limited region
- // started or empty result if the sender is currently not application-limited.
+ // Returns time when the current application-limited region started or empty
+ // result if the sender is currently not application-limited.
std::optional<Timestamp> GetApplicationLimitedRegionStartTime() const;
private: