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

Side by Side Diff: cc/debug/rendering_stats_instrumentation.cc

Issue 864943002: Replaces instances of the deprecated TimeTicks::HighResNow() with TimeTicks::Now(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More changes based on review comments. Created 5 years, 11 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/picture_record_benchmark.cc ('k') | cc/scheduler/delay_based_time_source.h » ('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 #include "cc/debug/rendering_stats_instrumentation.h" 5 #include "cc/debug/rendering_stats_instrumentation.h"
6 6
7 namespace cc { 7 namespace cc {
8 8
9 // static 9 // static
10 scoped_ptr<RenderingStatsInstrumentation> 10 scoped_ptr<RenderingStatsInstrumentation>
(...skipping 23 matching lines...) Expand all
34 void RenderingStatsInstrumentation::AccumulateAndClearImplThreadStats() { 34 void RenderingStatsInstrumentation::AccumulateAndClearImplThreadStats() {
35 base::AutoLock scoped_lock(lock_); 35 base::AutoLock scoped_lock(lock_);
36 impl_thread_rendering_stats_accu_.Add(impl_thread_rendering_stats_); 36 impl_thread_rendering_stats_accu_.Add(impl_thread_rendering_stats_);
37 impl_thread_rendering_stats_ = RenderingStats(); 37 impl_thread_rendering_stats_ = RenderingStats();
38 } 38 }
39 39
40 base::TimeTicks RenderingStatsInstrumentation::StartRecording() const { 40 base::TimeTicks RenderingStatsInstrumentation::StartRecording() const {
41 if (record_rendering_stats_) { 41 if (record_rendering_stats_) {
42 if (base::TimeTicks::IsThreadNowSupported()) 42 if (base::TimeTicks::IsThreadNowSupported())
43 return base::TimeTicks::ThreadNow(); 43 return base::TimeTicks::ThreadNow();
44 return base::TimeTicks::HighResNow(); 44 return base::TimeTicks::Now();
45 } 45 }
46 return base::TimeTicks(); 46 return base::TimeTicks();
47 } 47 }
48 48
49 base::TimeDelta RenderingStatsInstrumentation::EndRecording( 49 base::TimeDelta RenderingStatsInstrumentation::EndRecording(
50 base::TimeTicks start_time) const { 50 base::TimeTicks start_time) const {
51 if (!start_time.is_null()) { 51 if (!start_time.is_null()) {
52 if (base::TimeTicks::IsThreadNowSupported()) 52 if (base::TimeTicks::IsThreadNowSupported())
53 return base::TimeTicks::ThreadNow() - start_time; 53 return base::TimeTicks::ThreadNow() - start_time;
54 return base::TimeTicks::HighResNow() - start_time; 54 return base::TimeTicks::Now() - start_time;
55 } 55 }
56 return base::TimeDelta(); 56 return base::TimeDelta();
57 } 57 }
58 58
59 void RenderingStatsInstrumentation::IncrementFrameCount(int64 count) { 59 void RenderingStatsInstrumentation::IncrementFrameCount(int64 count) {
60 if (!record_rendering_stats_) 60 if (!record_rendering_stats_)
61 return; 61 return;
62 62
63 base::AutoLock scoped_lock(lock_); 63 base::AutoLock scoped_lock(lock_);
64 impl_thread_rendering_stats_.frame_count += count; 64 impl_thread_rendering_stats_.frame_count += count;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 return; 113 return;
114 114
115 base::AutoLock scoped_lock(lock_); 115 base::AutoLock scoped_lock(lock_);
116 impl_thread_rendering_stats_.commit_to_activate_duration.Append( 116 impl_thread_rendering_stats_.commit_to_activate_duration.Append(
117 commit_to_activate_duration); 117 commit_to_activate_duration);
118 impl_thread_rendering_stats_.commit_to_activate_duration_estimate.Append( 118 impl_thread_rendering_stats_.commit_to_activate_duration_estimate.Append(
119 commit_to_activate_duration_estimate); 119 commit_to_activate_duration_estimate);
120 } 120 }
121 121
122 } // namespace cc 122 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/picture_record_benchmark.cc ('k') | cc/scheduler/delay_based_time_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698