Index: media/blink/webmediaplayer_impl.h |
diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h |
index 5194a7e1ea5c611ce933e6562944b80f3dfd71b5..ec394b8016733124987cb6a964bb7df94ae09dd3 100644 |
--- a/media/blink/webmediaplayer_impl.h |
+++ b/media/blink/webmediaplayer_impl.h |
@@ -458,6 +458,33 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl |
// handling a src= or MSE based playback. |
void RecordUnderflowDuration(base::TimeDelta duration); |
+ // Indicates why ShouldPauseVideoWhenHidden() or |
+ // ShouldDisableVideoWhenHidden() failed or succeeded for metrics recording. |
+ // Must be in sync with the MediaBackgroundOptimizationCandidacyResult enum |
+ // in histograms.xml. |
+ enum BackgroundOptimizationResult { |
+ // Was optimized because shorter than the threshold. |
+ SUCCESS_FOR_DURATION, |
+ // Was optimized because keyframe distance is shorter than the threshold. |
+ SUCCESS_FOR_KEYFRAME_DISTANCE, |
+ // Was optimized because it doesn't have audio ignoring the threshold. |
+ SUCCESS_FOR_VIDEO_ONLY, |
+ // Wasn't optimized because keyframe distance is too big. |
+ FAIL_FOR_KEYFRAME_DISTANCE, |
+ // Wasn't optimized because is being played remotely. |
+ FAIL_FOR_REMOTE, |
+ // Wasn't optimized because is a streaming video. |
+ FAIL_FOR_STREAMING, |
+ |
+ // Must be the last item and set to the previous item's value. |
+ RESULT_MAX = FAIL_FOR_STREAMING |
+ }; |
+ |
+ // Reports the result of each background optimization check. |
+ // Figures the right bucket based on whether the video has audio or not. |
+ void ReportBackgroundOptimizationResult( |
+ BackgroundOptimizationResult result) const; |
+ |
blink::WebLocalFrame* frame_; |
// The playback state last reported to |delegate_|, to avoid setting duplicate |