OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_SCHEDULER_ROLLING_TIME_DELTA_HISTORY_H_ | 5 #ifndef CC_SCHEDULER_ROLLING_TIME_DELTA_HISTORY_H_ |
6 #define CC_SCHEDULER_ROLLING_TIME_DELTA_HISTORY_H_ | 6 #define CC_SCHEDULER_ROLLING_TIME_DELTA_HISTORY_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/time.h" | 11 #include "base/time/time.h" |
12 #include "cc/base/cc_export.h" | 12 #include "cc/base/cc_export.h" |
13 | 13 |
14 namespace cc { | 14 namespace cc { |
15 | 15 |
16 // Stores a limited number of samples. When the maximum size is reached, each | 16 // Stores a limited number of samples. When the maximum size is reached, each |
17 // insertion results in the deletion of the oldest remaining sample. | 17 // insertion results in the deletion of the oldest remaining sample. |
18 class CC_EXPORT RollingTimeDeltaHistory { | 18 class CC_EXPORT RollingTimeDeltaHistory { |
19 public: | 19 public: |
20 explicit RollingTimeDeltaHistory(size_t max_size); | 20 explicit RollingTimeDeltaHistory(size_t max_size); |
21 | 21 |
(...skipping 13 matching lines...) Expand all Loading... |
35 TimeDeltaMultiset sample_set_; | 35 TimeDeltaMultiset sample_set_; |
36 std::deque<TimeDeltaMultiset::iterator> chronological_sample_deque_; | 36 std::deque<TimeDeltaMultiset::iterator> chronological_sample_deque_; |
37 size_t max_size_; | 37 size_t max_size_; |
38 | 38 |
39 DISALLOW_COPY_AND_ASSIGN(RollingTimeDeltaHistory); | 39 DISALLOW_COPY_AND_ASSIGN(RollingTimeDeltaHistory); |
40 }; | 40 }; |
41 | 41 |
42 } // namespace cc | 42 } // namespace cc |
43 | 43 |
44 #endif // CC_SCHEDULER_ROLLING_TIME_DELTA_HISTORY_H_ | 44 #endif // CC_SCHEDULER_ROLLING_TIME_DELTA_HISTORY_H_ |
OLD | NEW |