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_DEBUG_RING_BUFFER_H_ | 5 #ifndef CC_DEBUG_RING_BUFFER_H_ |
6 #define CC_DEBUG_RING_BUFFER_H_ | 6 #define CC_DEBUG_RING_BUFFER_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 return Iterator(*this, kSize - 1); | 106 return Iterator(*this, kSize - 1); |
107 } | 107 } |
108 | 108 |
109 private: | 109 private: |
110 inline size_t BufferIndex(size_t n) const { | 110 inline size_t BufferIndex(size_t n) const { |
111 return (current_index_ + n) % kSize; | 111 return (current_index_ + n) % kSize; |
112 } | 112 } |
113 | 113 |
114 T buffer_[kSize]; | 114 T buffer_[kSize]; |
115 size_t current_index_; | 115 size_t current_index_; |
| 116 |
| 117 DISALLOW_COPY_AND_ASSIGN(RingBuffer); |
116 }; | 118 }; |
117 | 119 |
118 } // namespace cc | 120 } // namespace cc |
119 | 121 |
120 #endif // CC_DEBUG_RING_BUFFER_H_ | 122 #endif // CC_DEBUG_RING_BUFFER_H_ |
OLD | NEW |