OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "media/blink/cdm_result_promise_helper.h" | 5 #include "media/blink/cdm_result_promise_helper.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 return; | 63 return; |
64 | 64 |
65 base::LinearHistogram::FactoryGet( | 65 base::LinearHistogram::FactoryGet( |
66 uma_name, | 66 uma_name, |
67 1, | 67 1, |
68 NUM_RESULT_CODES, | 68 NUM_RESULT_CODES, |
69 NUM_RESULT_CODES + 1, | 69 NUM_RESULT_CODES + 1, |
70 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(result); | 70 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(result); |
71 } | 71 } |
72 | 72 |
73 void ReportTimeUMA(const std::string& uma_name, base::TimeDelta time) { | |
74 // Note: This leaks memory, which is expected behavior. | |
75 base::HistogramBase* histogram = base::Histogram::FactoryTimeGet( | |
76 uma_name, base::TimeDelta::FromMilliseconds(1), | |
77 base::TimeDelta::FromSeconds(10), 50, | |
78 base::HistogramBase::kUmaTargetedHistogramFlag); | |
79 | |
80 histogram->AddTime(time); | |
Ilya Sherman
2017/02/11 00:50:53
Please use "base::UmaHistogramTimes(name, time);"
xhwang
2017/02/11 01:12:45
Great. Didn't know this existed. PTAL again!
| |
81 } | |
82 | |
73 } // namespace media | 83 } // namespace media |
OLD | NEW |