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

Unified Diff: cc/debug/rendering_stats_instrumentation.cc

Issue 1180693002: Update from https://crrev.com/333737 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/debug/rendering_stats_instrumentation.h ('k') | cc/surfaces/surface_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/rendering_stats_instrumentation.cc
diff --git a/cc/debug/rendering_stats_instrumentation.cc b/cc/debug/rendering_stats_instrumentation.cc
index 4a28a66ac8d7fa6113bd073dcd39c63ebb16c781..462177293d159fdac4e90b10b53046ee5cc25071 100644
--- a/cc/debug/rendering_stats_instrumentation.cc
+++ b/cc/debug/rendering_stats_instrumentation.cc
@@ -37,21 +37,21 @@ void RenderingStatsInstrumentation::AccumulateAndClearImplThreadStats() {
impl_thread_rendering_stats_ = RenderingStats();
}
-base::TimeTicks RenderingStatsInstrumentation::StartRecording() const {
+base::TimeDelta RenderingStatsInstrumentation::StartRecording() const {
if (record_rendering_stats_) {
- if (base::TimeTicks::IsThreadNowSupported())
- return base::TimeTicks::ThreadNow();
- return base::TimeTicks::Now();
+ if (base::ThreadTicks::IsSupported())
+ return base::ThreadTicks::Now() - base::ThreadTicks();
+ return base::TimeTicks::Now() - base::TimeTicks();
}
- return base::TimeTicks();
+ return base::TimeDelta();
}
base::TimeDelta RenderingStatsInstrumentation::EndRecording(
- base::TimeTicks start_time) const {
- if (!start_time.is_null()) {
- if (base::TimeTicks::IsThreadNowSupported())
- return base::TimeTicks::ThreadNow() - start_time;
- return base::TimeTicks::Now() - start_time;
+ base::TimeDelta start_time) const {
+ if (start_time != base::TimeDelta()) {
+ if (base::ThreadTicks::IsSupported())
+ return (base::ThreadTicks::Now() - base::ThreadTicks()) - start_time;
+ return (base::TimeTicks::Now() - base::TimeTicks()) - start_time;
}
return base::TimeDelta();
}
« no previous file with comments | « cc/debug/rendering_stats_instrumentation.h ('k') | cc/surfaces/surface_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698