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

Unified Diff: webrtc/base/ratetracker.h

Issue 1835053002: Change default timestamp to 64 bits in all webrtc directories. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 4 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
Index: webrtc/base/ratetracker.h
diff --git a/webrtc/base/ratetracker.h b/webrtc/base/ratetracker.h
index d49d7cacdd5344f09ff38284e70bb9e32d885476..84c1a883257ef82276befe8d54ac94b2aaefbe6a 100644
--- a/webrtc/base/ratetracker.h
+++ b/webrtc/base/ratetracker.h
@@ -21,19 +21,19 @@ namespace rtc {
// that over each bucket the rate was constant.
class RateTracker {
public:
- RateTracker(uint32_t bucket_milliseconds, size_t bucket_count);
+ RateTracker(int bucket_milliseconds, size_t bucket_count);
virtual ~RateTracker();
// Computes the average rate over the most recent interval_milliseconds,
// or if the first sample was added within this period, computes the rate
// since the first sample was added.
- double ComputeRateForInterval(uint32_t interval_milliseconds) const;
+ double ComputeRateForInterval(int interval_milliseconds) const;
// Computes the average rate over the rate tracker's recording interval
// of bucket_milliseconds * bucket_count.
double ComputeRate() const {
return ComputeRateForInterval(bucket_milliseconds_ *
- static_cast<uint32_t>(bucket_count_));
+ static_cast<int>(bucket_count_));
}
// Computes the average rate since the first sample was added to the
@@ -49,19 +49,19 @@ class RateTracker {
protected:
// overrideable for tests
- virtual uint32_t Time() const;
+ virtual int64_t Time() const;
private:
void EnsureInitialized();
size_t NextBucketIndex(size_t bucket_index) const;
- const uint32_t bucket_milliseconds_;
+ const int bucket_milliseconds_;
pthatcher1 2016/04/11 20:56:59 Why not uint64_t?
honghaiz3 2016/04/18 23:39:04 As explained in the other comment, I do not use ui
Taylor Brandstetter 2016/04/19 20:35:27 I totally agree about using signed values. But I d
honghaiz3 2016/04/22 23:45:20 Done.
const size_t bucket_count_;
size_t* sample_buckets_;
size_t total_sample_count_;
size_t current_bucket_;
- uint32_t bucket_start_time_milliseconds_;
- uint32_t initialization_time_milliseconds_;
+ int64_t bucket_start_time_milliseconds_;
+ int64_t initialization_time_milliseconds_;
};
} // namespace rtc

Powered by Google App Engine
This is Rietveld 408576698