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

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

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « cc/debug/devtools_instrumentation.h ('k') | cc/debug/frame_rate_counter.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_FRAME_RATE_COUNTER_H_ 5 #ifndef CC_DEBUG_FRAME_RATE_COUNTER_H_
6 #define CC_DEBUG_FRAME_RATE_COUNTER_H_ 6 #define CC_DEBUG_FRAME_RATE_COUNTER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory>
11
10 #include "base/macros.h" 12 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/time/time.h" 13 #include "base/time/time.h"
13 #include "cc/debug/ring_buffer.h" 14 #include "cc/debug/ring_buffer.h"
14 15
15 namespace cc { 16 namespace cc {
16 17
17 // This class maintains a history of timestamps, and provides functionality to 18 // This class maintains a history of timestamps, and provides functionality to
18 // intelligently compute average frames per second. 19 // intelligently compute average frames per second.
19 class FrameRateCounter { 20 class FrameRateCounter {
20 public: 21 public:
21 static scoped_ptr<FrameRateCounter> Create(bool has_impl_thread); 22 static std::unique_ptr<FrameRateCounter> Create(bool has_impl_thread);
22 23
23 size_t current_frame_number() const { return ring_buffer_.CurrentIndex(); } 24 size_t current_frame_number() const { return ring_buffer_.CurrentIndex(); }
24 int dropped_frame_count() const { return dropped_frame_count_; } 25 int dropped_frame_count() const { return dropped_frame_count_; }
25 size_t time_stamp_history_size() const { return ring_buffer_.BufferSize(); } 26 size_t time_stamp_history_size() const { return ring_buffer_.BufferSize(); }
26 27
27 void SaveTimeStamp(base::TimeTicks timestamp, bool software); 28 void SaveTimeStamp(base::TimeTicks timestamp, bool software);
28 29
29 // n = 0 returns the oldest frame interval retained in the history, while n = 30 // n = 0 returns the oldest frame interval retained in the history, while n =
30 // time_stamp_history_size() - 1 returns the most recent frame interval. 31 // time_stamp_history_size() - 1 returns the most recent frame interval.
31 base::TimeDelta RecentFrameInterval(size_t n) const; 32 base::TimeDelta RecentFrameInterval(size_t n) const;
(...skipping 18 matching lines...) Expand all
50 51
51 bool has_impl_thread_; 52 bool has_impl_thread_;
52 int dropped_frame_count_; 53 int dropped_frame_count_;
53 54
54 DISALLOW_COPY_AND_ASSIGN(FrameRateCounter); 55 DISALLOW_COPY_AND_ASSIGN(FrameRateCounter);
55 }; 56 };
56 57
57 } // namespace cc 58 } // namespace cc
58 59
59 #endif // CC_DEBUG_FRAME_RATE_COUNTER_H_ 60 #endif // CC_DEBUG_FRAME_RATE_COUNTER_H_
OLDNEW
« no previous file with comments | « cc/debug/devtools_instrumentation.h ('k') | cc/debug/frame_rate_counter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698