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 "content/renderer/media/webrtc_uma_histograms.h" | 5 #include "content/renderer/media/webrtc_uma_histograms.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 void PerSessionWebRTCAPIMetrics::LogUsageOnlyOnce(JavaScriptAPIName api_name) { | 58 void PerSessionWebRTCAPIMetrics::LogUsageOnlyOnce(JavaScriptAPIName api_name) { |
59 DCHECK(CalledOnValidThread()); | 59 DCHECK(CalledOnValidThread()); |
60 if (!has_used_api_[api_name]) { | 60 if (!has_used_api_[api_name]) { |
61 has_used_api_[api_name] = true; | 61 has_used_api_[api_name] = true; |
62 LogUsage(api_name); | 62 LogUsage(api_name); |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 void PerSessionWebRTCAPIMetrics::ResetUsage() { | 66 void PerSessionWebRTCAPIMetrics::ResetUsage() { |
67 for (size_t i = 0; i < arraysize(has_used_api_); ++i) | 67 for (bool& has_used_api : has_used_api_) |
68 has_used_api_[i] = false; | 68 has_used_api = false; |
69 } | 69 } |
70 | 70 |
71 } // namespace content | 71 } // namespace content |
OLD | NEW |