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

Side by Side Diff: cc/debug/ring_buffer.h

Issue 734063004: Update from https://crrev.com/304418 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « cc/debug/rendering_stats.h ('k') | cc/layers/delegated_frame_provider_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 {
11 11
12 template<typename T, size_t kSize> 12 template<typename T, size_t kSize>
13 class RingBuffer { 13 class RingBuffer {
14 public: 14 public:
15 explicit RingBuffer() 15 RingBuffer() : current_index_(0) {}
16 : current_index_(0) {
17 }
18 16
19 size_t BufferSize() const { 17 size_t BufferSize() const {
20 return kSize; 18 return kSize;
21 } 19 }
22 20
23 size_t CurrentIndex() const { 21 size_t CurrentIndex() const {
24 return current_index_; 22 return current_index_;
25 } 23 }
26 24
27 // tests if a value was saved to this index 25 // tests if a value was saved to this index
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 111
114 T buffer_[kSize]; 112 T buffer_[kSize];
115 size_t current_index_; 113 size_t current_index_;
116 114
117 DISALLOW_COPY_AND_ASSIGN(RingBuffer); 115 DISALLOW_COPY_AND_ASSIGN(RingBuffer);
118 }; 116 };
119 117
120 } // namespace cc 118 } // namespace cc
121 119
122 #endif // CC_DEBUG_RING_BUFFER_H_ 120 #endif // CC_DEBUG_RING_BUFFER_H_
OLDNEW
« no previous file with comments | « cc/debug/rendering_stats.h ('k') | cc/layers/delegated_frame_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698