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

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

Issue 2218963003: Added metrics for background video playback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated the browser test Created 4 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
« no previous file with comments | « no previous file | content/renderer/media/renderer_webmediaplayer_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/renderer_webmediaplayer_delegate.h
diff --git a/content/renderer/media/renderer_webmediaplayer_delegate.h b/content/renderer/media/renderer_webmediaplayer_delegate.h
index f8c8563d347718c3bc12a8cc9228200325afb90c..0271d01766fa4707c97bcedf5e968fbcb9502c5b 100644
--- a/content/renderer/media/renderer_webmediaplayer_delegate.h
+++ b/content/renderer/media/renderer_webmediaplayer_delegate.h
@@ -18,6 +18,10 @@
#include "content/public/renderer/render_frame_observer.h"
#include "media/blink/webmediaplayer_delegate.h"
+#if defined(OS_ANDROID)
+#include "base/time/time.h"
+#endif // OS_ANDROID
+
namespace blink {
class WebMediaPlayer;
}
@@ -83,6 +87,9 @@ class CONTENT_EXPORT RendererWebMediaPlayerDelegate
// Runs periodically to suspend idle delegates in |idle_delegate_map_|.
void CleanupIdleDelegates();
+ // Setter for |is_playing_background_video_| that updates the metrics.
+ void SetIsPlayingBackgroundVideo(bool is_playing);
+
bool has_played_media_ = false;
IDMap<Observer> id_map_;
@@ -110,6 +117,11 @@ class CONTENT_EXPORT RendererWebMediaPlayerDelegate
// foreground.
bool is_playing_background_video_ = false;
+#if defined(OS_ANDROID)
+ // Keeps track of when the background video playback started for metrics.
+ base::TimeTicks background_video_playing_start_time_;
+#endif // OS_ANDROID
+
// The currently playing local videos. Used to determine whether
// OnMediaDelegatePlay() should allow the videos to play in the background or
// not.
« no previous file with comments | « no previous file | content/renderer/media/renderer_webmediaplayer_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698