| Index: media/blink/webmediaplayer_impl.h
|
| diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h
|
| index 0942929e41b86d6a6792022928d4d7d14af1323c..08e70b736b9dd40a513add59eb0c470349af7e53 100644
|
| --- a/media/blink/webmediaplayer_impl.h
|
| +++ b/media/blink/webmediaplayer_impl.h
|
| @@ -329,7 +329,7 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
|
| // are:
|
| // - isRemote(),
|
| // - hasVideo(),
|
| - // - delegate_->IsHidden(),
|
| + // - delegate_->IsFrameHidden(),
|
| // - network_state_, ready_state_,
|
| // - is_idle_, must_suspend_,
|
| // - paused_, ended_,
|
| @@ -352,7 +352,7 @@ 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
|
| + // Called during OnFrameHidden() when we want a suspended player to enter the
|
| // paused state after some idle timeout.
|
| void ScheduleIdlePauseTimer();
|
|
|
| @@ -367,8 +367,8 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
|
|
|
| void CreateWatchTimeReporter();
|
|
|
| - // Returns true if the player is hidden.
|
| - bool IsHidden() const;
|
| + // Returns true if the player is in the background.
|
| + bool IsBackgrounded() const;
|
|
|
| // Returns true if the player's source is streaming.
|
| bool IsStreaming() const;
|
| @@ -377,17 +377,17 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
|
| // is intended for android.
|
| bool DoesOverlaySupportMetadata() const;
|
|
|
| - // Whether the video should be paused when hidden. Uses metadata so has
|
| - // meaning only after the pipeline has started, otherwise returns false.
|
| + // Whether the video should be paused when in the background. Uses metadata so
|
| + // has meaning only after the pipeline has started, otherwise returns false.
|
| // Doesn't check if the video can actually be paused depending on the
|
| // pipeline's state.
|
| - bool ShouldPauseVideoWhenHidden() const;
|
| + bool ShouldPauseVideoWhenBackground() const;
|
|
|
| - // Whether the video track should be disabled when hidden. Uses metadata so
|
| - // has meaning only after the pipeline has started, otherwise returns false.
|
| - // Doesn't check if the video track can actually be disabled depending on the
|
| - // pipeline's state.
|
| - bool ShouldDisableVideoWhenHidden() const;
|
| + // Whether the video track should be disabled when in the background. Uses
|
| + // metadata so has meaning only after the pipeline has started, otherwise
|
| + // returns false. Doesn't check if the video track can actually be disabled
|
| + // depending on the pipeline's state.
|
| + bool ShouldDisableVideoWhenBackground() const;
|
|
|
| // Whether the video is suitable for background playback optimizations (either
|
| // pausing it or disabling the video track). Uses metadata so has meaning only
|
| @@ -401,26 +401,27 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
|
| // needs to be called to update the optimization state.
|
| void UpdateBackgroundVideoOptimizationState();
|
|
|
| - // Pauses a hidden video only player to save power if possible.
|
| + // Pauses a background video only player to save power if possible.
|
| // Must be called when either of the following happens:
|
| - // - right after the video was hidden,
|
| - // - right ater the pipeline has resumed if the video is hidden.
|
| + // - right after the video was backgrounded,
|
| + // - right ater the pipeline has resumed if the video is in the background.
|
| void PauseVideoIfNeeded();
|
|
|
| // Disables the video track to save power if possible.
|
| // Must be called when either of the following happens:
|
| - // - right after the video was hidden,
|
| + // - right after the video was backgrounded,
|
| // - right after the pipeline has started (|seeking_| is used to detect the
|
| - // when pipeline started) if the video is hidden,
|
| - // - right ater the pipeline has resumed if the video is hidden.
|
| + // when pipeline started) if the video is in the background,
|
| + // - right ater the pipeline has resumed if the video is in the background.
|
| void DisableVideoTrackIfNeeded();
|
|
|
| // Enables the video track if it was disabled before to save power.
|
| // Must be called when either of the following happens:
|
| - // - right after the video was shown,
|
| + // - right after the video was put in the foreground,
|
| // - right before the pipeline is requested to resume
|
| // (see https://crbug.com/678374),
|
| - // - right after the pipeline has resumed if the video is not hidden.
|
| + // - right after the pipeline has resumed if the video is not in the
|
| + // background.
|
| void EnableVideoTrackIfNeeded();
|
|
|
| // Overrides the pipeline statistics returned by GetPiplineStatistics() for
|
| @@ -499,9 +500,9 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
|
| bool paused_;
|
| base::TimeDelta paused_time_;
|
|
|
| - // Set if paused automatically when hidden and need to resume when visible.
|
| - // Reset if paused for any other reason.
|
| - bool paused_when_hidden_;
|
| + // Set if paused automatically when backgrounded and need to resume when
|
| + // foregrounded. Reset if paused for any other reason.
|
| + bool paused_when_background_;
|
|
|
| // Set when starting, seeking, and resuming (all of which require a Pipeline
|
| // seek). |seek_time_| is only valid when |seeking_| is true.
|
|
|