Chromium Code Reviews| Index: webrtc/base/rate_statistics.cc |
| diff --git a/webrtc/base/rate_statistics.cc b/webrtc/base/rate_statistics.cc |
| index 1fd63cc6d2a071251edb0a9f4f3744fd700571f2..7382619b400c8183ae52596bdbdf78d4353f7da8 100644 |
| --- a/webrtc/base/rate_statistics.cc |
| +++ b/webrtc/base/rate_statistics.cc |
| @@ -77,6 +77,12 @@ rtc::Optional<uint32_t> RateStatistics::Rate(int64_t now_ms) { |
| static_cast<uint32_t>(accumulated_count_ * scale + 0.5f)); |
| } |
| +rtc::Optional<uint32_t> RateStatistics::Rate(int64_t now_ms) const { |
|
danilchap
2016/06/28 14:26:17
May be it would be slightly cleaner if only one Ra
sprang_webrtc
2016/07/04 09:33:03
Done.
|
| + // Yes, this is ugly, but it's preferable to declaring all internal state |
| + // mutable... |
| + return const_cast<RateStatistics*>(this)->Rate(now_ms); |
| +} |
| + |
| void RateStatistics::EraseOld(int64_t now_ms) { |
| if (!IsInitialized()) |
| return; |