Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2382)

Unified Diff: content/renderer/media/webrtc_uma_histograms.h

Issue 427713004: Add histogram WebRTC.UserMediaRequest.Events to allow to track getUserMedia failures and hangs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/webrtc_uma_histograms.h
diff --git a/content/renderer/media/webrtc_uma_histograms.h b/content/renderer/media/webrtc_uma_histograms.h
index 2dfb032db1bf7e875369b2c0886631580034b16b..fa48f7a0dee0d4a9b4efa5cf6155bfa38030bf61 100644
--- a/content/renderer/media/webrtc_uma_histograms.h
+++ b/content/renderer/media/webrtc_uma_histograms.h
@@ -8,9 +8,26 @@
#include "base/memory/singleton.h"
#include "base/threading/non_thread_safe.h"
#include "content/common/content_export.h"
+#include "content/public/common/media_stream_request.h"
namespace content {
+// Enum to track UserMediaRequest events. MediaStreamRequestResult events are
+// mapped directly to MediaStreamRequestResult + 10.
+enum UserMediaRequestEvent {
+ USERMEDIAREQUEST_CREATED = 0,
vrk (LEFT CHROMIUM) 2014/08/04 18:22:17 I don't think CREATED is a useful histogram value
andresp-chromium 2014/08/04 19:16:23 This was intended to be an events counter.. in suc
+ USERMEDIAREQUEST_CANCELLED = 1,
+ USERMEDIAREQUEST_NO_RESPONSE = 2,
+ // Unused enum ids so they can be used to track events that don't exist in
+ // MediaStreamRequestResult without destroying existent mappings.
+ USERMEDIAREQUEST_RESULT = 10,
vrk (LEFT CHROMIUM) 2014/08/04 18:22:17 ISTM it'd make more sense to have two histograms:
andresp-chromium 2014/08/04 19:16:24 Totally agree. On 2014/08/04 18:22:17, Victoria K
+ NUM_USERMEDIAREQUEST_EVENTS =
+ USERMEDIAREQUEST_RESULT + NUM_MEDIA_REQUEST_RESULTS
+};
+
+void LogUserMediaRequestEvent(UserMediaRequestEvent event);
+void LogUserMediaRequestResult(MediaStreamRequestResult result);
+
// Helper enum used for histogramming calls to WebRTC APIs from JavaScript.
enum JavaScriptAPIName {
WEBKIT_GET_USER_MEDIA,

Powered by Google App Engine
This is Rietveld 408576698