| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_UMA_HISTOGRAMS_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_UMA_HISTOGRAMS_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_UMA_HISTOGRAMS_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_UMA_HISTOGRAMS_H_ |
| 7 | 7 |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "base/threading/non_thread_safe.h" | 9 #include "base/threading/non_thread_safe.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 MEDIA_STREAM_REQUEST_EXPLICITLY_CANCELLED = 0, | 23 MEDIA_STREAM_REQUEST_EXPLICITLY_CANCELLED = 0, |
| 24 MEDIA_STREAM_REQUEST_NOT_GENERATED = 1, | 24 MEDIA_STREAM_REQUEST_NOT_GENERATED = 1, |
| 25 MEDIA_STREAM_REQUEST_PENDING_MEDIA_TRACKS = 2, | 25 MEDIA_STREAM_REQUEST_PENDING_MEDIA_TRACKS = 2, |
| 26 NUM_MEDIA_STREAM_REQUEST_WITH_NO_RESULT | 26 NUM_MEDIA_STREAM_REQUEST_WITH_NO_RESULT |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 void LogUserMediaRequestWithNoResult(MediaStreamRequestState state); | 29 void LogUserMediaRequestWithNoResult(MediaStreamRequestState state); |
| 30 void LogUserMediaRequestResult(MediaStreamRequestResult result); | 30 void LogUserMediaRequestResult(MediaStreamRequestResult result); |
| 31 | 31 |
| 32 // Helper enum used for histogramming calls to WebRTC APIs from JavaScript. | 32 // Helper enum used for histogramming calls to WebRTC APIs from JavaScript. |
| 33 // The entries are linked to UMA values and cannot be changed. |
| 33 enum JavaScriptAPIName { | 34 enum JavaScriptAPIName { |
| 34 WEBKIT_GET_USER_MEDIA, | 35 WEBKIT_GET_USER_MEDIA, |
| 35 WEBKIT_PEER_CONNECTION, | 36 WEBKIT_PEER_CONNECTION, |
| 36 WEBKIT_DEPRECATED_PEER_CONNECTION, | 37 WEBKIT_DEPRECATED_PEER_CONNECTION, |
| 37 WEBKIT_RTC_PEER_CONNECTION, | 38 WEBKIT_RTC_PEER_CONNECTION, |
| 38 WEBKIT_GET_MEDIA_DEVICES, | 39 WEBKIT_GET_MEDIA_DEVICES, |
| 40 WEBKIT_MEDIA_STREAM_RECORDER, |
| 39 INVALID_NAME | 41 INVALID_NAME |
| 40 }; | 42 }; |
| 41 | 43 |
| 42 // Helper method used to collect information about the number of times | 44 // Helper method used to collect information about the number of times |
| 43 // different WebRTC APIs are called from JavaScript. | 45 // different WebRTC APIs are called from JavaScript. |
| 44 // | 46 // |
| 45 // This contributes to two histograms; the former is a raw count of | 47 // This contributes to two histograms; the former is a raw count of |
| 46 // the number of times the APIs are called, and be viewed at | 48 // the number of times the APIs are called, and be viewed at |
| 47 // chrome://histograms/WebRTC.webkitApiCount. | 49 // chrome://histograms/WebRTC.webkitApiCount. |
| 48 // | 50 // |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 94 |
| 93 int num_streams_; | 95 int num_streams_; |
| 94 bool has_used_api_[INVALID_NAME]; | 96 bool has_used_api_[INVALID_NAME]; |
| 95 | 97 |
| 96 DISALLOW_COPY_AND_ASSIGN(PerSessionWebRTCAPIMetrics); | 98 DISALLOW_COPY_AND_ASSIGN(PerSessionWebRTCAPIMetrics); |
| 97 }; | 99 }; |
| 98 | 100 |
| 99 } // namespace content | 101 } // namespace content |
| 100 | 102 |
| 101 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_UMA_HISTOGRAMS_H_ | 103 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_UMA_HISTOGRAMS_H_ |
| OLD | NEW |