Chromium Code Reviews| Index: cc/paint_time_counter.h |
| diff --git a/cc/paint_time_counter.h b/cc/paint_time_counter.h |
| index d79db69e675dd1dd1353cc39dfd65f37beeb0a89..3561b990a2fe0396196490d3e514e6c357a79be2 100644 |
| --- a/cc/paint_time_counter.h |
| +++ b/cc/paint_time_counter.h |
| @@ -19,18 +19,41 @@ class PaintTimeCounter { |
| size_t HistorySize() const { return ring_buffer_.BufferSize(); } |
| + struct Entry { |
| + Entry() |
| + : commit_number(0) { } |
| + |
| + int commit_number; |
| + base::TimeDelta paint_time; |
| + base::TimeDelta rasterize_time; |
| + |
| + base::TimeDelta time() const { |
|
danakj
2013/02/15 18:45:06
nit: total_time()?
|
| + return paint_time + rasterize_time; |
| + } |
| + }; |
| + |
| // n = 0 returns the oldest and |
| // n = PaintTimeHistorySize() - 1 the most recent paint time. |
| base::TimeDelta GetPaintTimeOfRecentFrame(const size_t& n) const; |
| - void SavePaintTime(const base::TimeDelta& total_paint_time); |
| + void SavePaintTime(const base::TimeDelta& total_paint_time, |
| + const int& commit_number); |
|
danakj
2013/02/15 18:45:06
int by value
|
| + void SaveRasterizeTime(const base::TimeDelta& total_rasterize_time, |
| + const int& commit_number); |
|
danakj
2013/02/15 18:45:06
int by value
|
| void GetMinAndMaxPaintTime(base::TimeDelta* min, base::TimeDelta* max) const; |
| + void ClearHistory(); |
| + |
| private: |
| PaintTimeCounter(); |
| - RingBuffer<base::TimeDelta, 90> ring_buffer_; |
| + RingBuffer<Entry, 90> ring_buffer_; |
| + |
| base::TimeDelta last_total_paint_time_; |
| + base::TimeDelta last_total_rasterize_time_; |
| + |
| + bool can_save_paint_time_delta; |
|
danakj
2013/02/15 18:45:06
these should have _ suffix
|
| + bool can_save_rasterize_time_delta; |
| DISALLOW_COPY_AND_ASSIGN(PaintTimeCounter); |
| }; |