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

Unified Diff: webrtc/base/rate_statistics.cc

Issue 2061423003: Refactor NACK bitrate allocation (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed comments Created 4 years, 5 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
Index: webrtc/base/rate_statistics.cc
diff --git a/webrtc/base/rate_statistics.cc b/webrtc/base/rate_statistics.cc
index 1fd63cc6d2a071251edb0a9f4f3744fd700571f2..a4da58bf676343f9a68153641d9ba98a3b11d92d 100644
--- a/webrtc/base/rate_statistics.cc
+++ b/webrtc/base/rate_statistics.cc
@@ -61,8 +61,8 @@ void RateStatistics::Update(size_t count, int64_t now_ms) {
++num_samples_;
}
-rtc::Optional<uint32_t> RateStatistics::Rate(int64_t now_ms) {
- EraseOld(now_ms);
+rtc::Optional<uint32_t> RateStatistics::Rate(int64_t now_ms) const {
+ const_cast<RateStatistics*>(this)->EraseOld(now_ms);
stefan-webrtc 2016/07/06 12:43:21 Isn't mutable an option instead?
sprang_webrtc 2016/07/06 14:13:07 We'd have to declare more or less all members as m
stefan-webrtc 2016/07/08 11:55:58 Acknowledged.
// If window is a single bucket or there is only one sample in a data set that
// has not grown to the full window size, treat this as rate unavailable.
@@ -112,7 +112,7 @@ bool RateStatistics::SetWindowSize(int64_t window_size_ms, int64_t now_ms) {
return true;
}
-bool RateStatistics::IsInitialized() {
+bool RateStatistics::IsInitialized() const {
return oldest_time_ != -max_window_size_ms_;
}

Powered by Google App Engine
This is Rietveld 408576698