| 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" |
| 11 #include "content/public/common/media_stream_request.h" | 11 #include "content/public/common/media_stream_request.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 // Used to investigate where UserMediaRequests end up. |
| 16 // Only UserMediaRequests that do not log with LogUserMediaRequestResult |
| 17 // should call LogUserMediaRequestWithNoResult. |
| 18 // |
| 19 // Elements in this enum should not be deleted or rearranged; the only |
| 20 // permitted operation is to add new elements before |
| 21 // NUM_MEDIA_STREAM_REQUEST_WITH_NO_RESULT. |
| 22 enum MediaStreamRequestState { |
| 23 MEDIA_STREAM_REQUEST_EXPLICITLY_CANCELLED = 0, |
| 24 MEDIA_STREAM_REQUEST_NOT_GENERATED = 1, |
| 25 MEDIA_STREAM_REQUEST_PENDING_MEDIA_TRACKS = 2, |
| 26 NUM_MEDIA_STREAM_REQUEST_WITH_NO_RESULT |
| 27 }; |
| 28 |
| 29 void LogUserMediaRequestWithNoResult(MediaStreamRequestState state); |
| 15 void LogUserMediaRequestResult(MediaStreamRequestResult result); | 30 void LogUserMediaRequestResult(MediaStreamRequestResult result); |
| 16 | 31 |
| 17 // Helper enum used for histogramming calls to WebRTC APIs from JavaScript. | 32 // Helper enum used for histogramming calls to WebRTC APIs from JavaScript. |
| 18 enum JavaScriptAPIName { | 33 enum JavaScriptAPIName { |
| 19 WEBKIT_GET_USER_MEDIA, | 34 WEBKIT_GET_USER_MEDIA, |
| 20 WEBKIT_PEER_CONNECTION, | 35 WEBKIT_PEER_CONNECTION, |
| 21 WEBKIT_DEPRECATED_PEER_CONNECTION, | 36 WEBKIT_DEPRECATED_PEER_CONNECTION, |
| 22 WEBKIT_RTC_PEER_CONNECTION, | 37 WEBKIT_RTC_PEER_CONNECTION, |
| 23 WEBKIT_GET_MEDIA_DEVICES, | 38 WEBKIT_GET_MEDIA_DEVICES, |
| 24 INVALID_NAME | 39 INVALID_NAME |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 92 |
| 78 int num_streams_; | 93 int num_streams_; |
| 79 bool has_used_api_[INVALID_NAME]; | 94 bool has_used_api_[INVALID_NAME]; |
| 80 | 95 |
| 81 DISALLOW_COPY_AND_ASSIGN(PerSessionWebRTCAPIMetrics); | 96 DISALLOW_COPY_AND_ASSIGN(PerSessionWebRTCAPIMetrics); |
| 82 }; | 97 }; |
| 83 | 98 |
| 84 } // namespace content | 99 } // namespace content |
| 85 | 100 |
| 86 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_UMA_HISTOGRAMS_H_ | 101 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_UMA_HISTOGRAMS_H_ |
| OLD | NEW |