OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/browser/media/android/media_session_uma_helper.h" | 5 #include "content/browser/media/android/media_session_uma_helper.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "base/metrics/histogram_base.h" | 9 #include "base/metrics/histogram_base.h" |
8 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
9 #include "base/time/default_clock.h" | 11 #include "base/time/default_clock.h" |
10 | 12 |
11 namespace content { | 13 namespace content { |
12 | 14 |
13 using HistogramBase = base::HistogramBase; | 15 using HistogramBase = base::HistogramBase; |
14 | 16 |
15 MediaSessionUmaHelper::MediaSessionUmaHelper() | 17 MediaSessionUmaHelper::MediaSessionUmaHelper() |
16 : clock_(new base::DefaultClock()) | 18 : clock_(new base::DefaultClock()) |
(...skipping 30 matching lines...) Expand all Loading... |
47 | 49 |
48 if (total_active_time_.is_zero()) | 50 if (total_active_time_.is_zero()) |
49 return; | 51 return; |
50 | 52 |
51 UMA_HISTOGRAM_LONG_TIMES("Media.Session.ActiveTime", total_active_time_); | 53 UMA_HISTOGRAM_LONG_TIMES("Media.Session.ActiveTime", total_active_time_); |
52 total_active_time_ = base::TimeDelta(); | 54 total_active_time_ = base::TimeDelta(); |
53 } | 55 } |
54 | 56 |
55 void MediaSessionUmaHelper::SetClockForTest( | 57 void MediaSessionUmaHelper::SetClockForTest( |
56 scoped_ptr<base::Clock> testing_clock) { | 58 scoped_ptr<base::Clock> testing_clock) { |
57 clock_ = testing_clock.Pass(); | 59 clock_ = std::move(testing_clock); |
58 } | 60 } |
59 | 61 |
60 } // namespace content | 62 } // namespace content |
OLD | NEW |