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

Unified Diff: media/blink/webmediaplayer_impl.h

Issue 2039793005: Don't resume paused media. Don't resume playing media after timeout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove now incorrect test. Created 4 years, 6 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 | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.h
diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h
index de61ecb85ed644a2748d82eafc1ff6c6e4713aef..9a127640bbf5fa8b6c1d4909d4c6ea2b7a5c724b 100644
--- a/media/blink/webmediaplayer_impl.h
+++ b/media/blink/webmediaplayer_impl.h
@@ -17,6 +17,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/thread.h"
+#include "base/timer/timer.h"
#include "build/build_config.h"
#include "media/base/media_tracks.h"
#include "media/base/pipeline_impl.h"
@@ -317,6 +318,7 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
// Methods internal to UpdatePlayState().
PlayState UpdatePlayState_ComputePlayState(bool is_remote,
+ bool is_suspended,
bool is_backgrounded);
void SetDelegateState(DelegateState new_state);
void SetMemoryReportingState(bool is_memory_reporting_enabled);
@@ -329,6 +331,10 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
void ReportMemoryUsage();
void FinishMemoryUsageReport(int64_t demuxer_memory_usage);
+ // Called during OnHidden() when we want a suspended player to enter the
+ // paused state after some idle timeout.
+ void ScheduleIdlePauseTimer();
+
blink::WebLocalFrame* frame_;
// The playback state last reported to |delegate_|, to avoid setting duplicate
@@ -502,6 +508,10 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
enum class CanSuspendState { UNKNOWN, YES, NO };
CanSuspendState can_suspend_state_;
+ // Called some-time after OnHidden() if the media was suspended in a playing
+ // state as part of the call to OnHidden().
+ base::OneShotTimer background_pause_timer_;
+
DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl);
};
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698