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 |
| 11 void LogUserMediaRequestResult(MediaStreamRequestResult result) { |
| 12 UMA_HISTOGRAM_ENUMERATION( |
| 13 "WebRTC.UserMediaRequest.Result", result, NUM_MEDIA_REQUEST_RESULTS); |
| 14 } |
| 15 |
11 void UpdateWebRTCMethodCount(JavaScriptAPIName api_name) { | 16 void UpdateWebRTCMethodCount(JavaScriptAPIName api_name) { |
12 DVLOG(3) << "Incrementing WebRTC.webkitApiCount for " << api_name; | 17 DVLOG(3) << "Incrementing WebRTC.webkitApiCount for " << api_name; |
13 UMA_HISTOGRAM_ENUMERATION("WebRTC.webkitApiCount", api_name, INVALID_NAME); | 18 UMA_HISTOGRAM_ENUMERATION("WebRTC.webkitApiCount", api_name, INVALID_NAME); |
14 PerSessionWebRTCAPIMetrics::GetInstance()->LogUsageOnlyOnce(api_name); | 19 PerSessionWebRTCAPIMetrics::GetInstance()->LogUsageOnlyOnce(api_name); |
15 } | 20 } |
16 | 21 |
17 PerSessionWebRTCAPIMetrics::~PerSessionWebRTCAPIMetrics() { | 22 PerSessionWebRTCAPIMetrics::~PerSessionWebRTCAPIMetrics() { |
18 } | 23 } |
19 | 24 |
20 // static | 25 // static |
(...skipping 30 matching lines...) Expand all Loading... |
51 LogUsage(api_name); | 56 LogUsage(api_name); |
52 } | 57 } |
53 } | 58 } |
54 | 59 |
55 void PerSessionWebRTCAPIMetrics::ResetUsage() { | 60 void PerSessionWebRTCAPIMetrics::ResetUsage() { |
56 for (size_t i = 0; i < arraysize(has_used_api_); ++i) | 61 for (size_t i = 0; i < arraysize(has_used_api_); ++i) |
57 has_used_api_[i] = false; | 62 has_used_api_[i] = false; |
58 } | 63 } |
59 | 64 |
60 } // namespace content | 65 } // namespace content |
OLD | NEW |