Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/metrics/histogram_macros.h" | |
| 6 #include "components/scheduler/renderer/renderer_task_duration.h" | |
|
majidvp
2016/07/27 13:50:59
The class's own header should be included first. T
sunyunjia
2016/07/27 17:28:42
Done.
| |
| 7 | |
| 8 namespace scheduler { | |
| 9 RendererTaskDuration::RendererTaskDuration() | |
| 10 : sample_count_(0) { | |
|
majidvp
2016/07/27 13:50:59
The initializer list should be on the same line as
sunyunjia
2016/07/27 17:28:42
Done.
| |
| 11 } | |
| 12 | |
| 13 RendererTaskDuration::~RendererTaskDuration() { | |
|
majidvp
2016/07/27 13:50:59
Move closing brace to the same line for this empty
sunyunjia
2016/07/27 17:28:42
Done.
| |
| 14 } | |
| 15 | |
| 16 void RendererTaskDuration::ReportSampleDuration(base::TimeDelta duration) { | |
| 17 ++sample_count_; | |
| 18 if (sample_count_ % kSampleInterval == 0) { | |
|
majidvp
2016/07/27 13:50:59
Given that we reset the sample count to 0.
Should
sunyunjia
2016/07/27 17:28:42
Done.
| |
| 19 UMA_HISTOGRAM_TIMES("RendererScheduler.TaskDuration", | |
|
majidvp
2016/07/27 13:50:59
UMA_HISTGRAM_TIMES range is 1ms - 10seconds. This
| |
| 20 duration); | |
|
majidvp
2016/07/27 13:50:59
The line break is not needed. Falls within the 80
sunyunjia
2016/07/27 17:28:42
Done.
| |
| 21 sample_count_ = 0; | |
| 22 } | |
| 23 } | |
| 24 } | |
| OLD | NEW |