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

Issue 1766783003: Expand suspension of idle media players to all platforms. (Closed)

Created:
4 years, 9 months ago by DaleCurtis
Modified:
4 years, 9 months ago
CC:
avayvod+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, mcasas+watch_chromium.org, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, mlamouri+watch-media_chromium.org, posciak+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@notify_pause
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Expand suspension of idle media players to all platforms. This CL enables suspension of idle players on the desktop with the same timers as used on Android: 15 seconds idle (paused, ended, never started), polled every 5 seconds. It also replaces the overloaded OnHidden() method with a more appropriate OnSuspendRequested() method for handling both forced and idle suspensions; OnHidden() continues to handle suspensions upon backgrounding on Android. By separating suspends into a new method we can always suspend idle players without worrying about if they have a media session or not. If they do and the user interacts with the session, we'll resume the player dynamically. BUG=590099 TEST=updated unittest, manual testing. Committed: https://crrev.com/0431cbf89bc6bc50c9ad2ce0cc4ac5117e38b1d9 Cr-Commit-Position: refs/heads/master@{#380819}

Patch Set 1 #

Patch Set 2 : Cleanup. #

Total comments: 21

Patch Set 3 : Simplify. #

Total comments: 12

Patch Set 4 : Fixup API comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -123 lines) Patch
M content/renderer/media/android/webmediaplayer_android.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/media/android/webmediaplayer_android.cc View 1 2 3 1 chunk +8 lines, -5 lines 0 comments Download
M content/renderer/media/renderer_webmediaplayer_delegate.h View 2 chunks +5 lines, -9 lines 0 comments Download
M content/renderer/media/renderer_webmediaplayer_delegate.cc View 1 2 3 8 chunks +12 lines, -20 lines 0 comments Download
M content/renderer/media/renderer_webmediaplayer_delegate_browsertest.cc View 1 2 9 chunks +38 lines, -8 lines 0 comments Download
M content/renderer/media/webmediaplayer_ms.h View 1 2 2 chunks +5 lines, -3 lines 0 comments Download
M content/renderer/media/webmediaplayer_ms.cc View 1 2 3 8 chunks +27 lines, -22 lines 0 comments Download
M content/renderer/media/webmediaplayer_ms_unittest.cc View 1 2 2 chunks +7 lines, -5 lines 0 comments Download
M media/blink/webmediaplayer_delegate.h View 1 2 3 2 chunks +18 lines, -7 lines 0 comments Download
M media/blink/webmediaplayer_impl.h View 1 2 3 2 chunks +5 lines, -1 line 0 comments Download
M media/blink/webmediaplayer_impl.cc View 1 2 3 10 chunks +73 lines, -42 lines 0 comments Download

Messages

Total messages: 28 (9 generated)
DaleCurtis
This brings allows us to always suspend idle players on Android (without impacting the media ...
4 years, 9 months ago (2016-03-05 03:04:01 UTC) #3
mlamouri (slow - plz ping)
https://codereview.chromium.org/1766783003/diff/20001/content/renderer/media/renderer_webmediaplayer_delegate.cc File content/renderer/media/renderer_webmediaplayer_delegate.cc (right): https://codereview.chromium.org/1766783003/diff/20001/content/renderer/media/renderer_webmediaplayer_delegate.cc#newcode158 content/renderer/media/renderer_webmediaplayer_delegate.cc:158: id_map_.Lookup(kv.first)->OnSuspend(false); Why did this changed from OnHidden(true) to OnSuspend(false)? ...
4 years, 9 months ago (2016-03-05 22:37:36 UTC) #5
DaleCurtis
Will wait for other reviewers to way in before uploading a new patch set. Just ...
4 years, 9 months ago (2016-03-07 19:08:07 UTC) #6
xhwang
Didn't review everything yet. Just a few questions on the API. https://chromiumcodereview.appspot.com/1766783003/diff/20001/media/blink/webmediaplayer_delegate.h File media/blink/webmediaplayer_delegate.h (right): ...
4 years, 9 months ago (2016-03-07 19:13:58 UTC) #7
DaleCurtis
https://chromiumcodereview.appspot.com/1766783003/diff/20001/media/blink/webmediaplayer_delegate.h File media/blink/webmediaplayer_delegate.h (right): https://chromiumcodereview.appspot.com/1766783003/diff/20001/media/blink/webmediaplayer_delegate.h#newcode28 media/blink/webmediaplayer_delegate.h:28: virtual void OnSuspend(bool must_suspend) = 0; On 2016/03/07 at ...
4 years, 9 months ago (2016-03-07 19:23:07 UTC) #8
DaleCurtis
https://chromiumcodereview.appspot.com/1766783003/diff/20001/media/blink/webmediaplayer_delegate.h File media/blink/webmediaplayer_delegate.h (right): https://chromiumcodereview.appspot.com/1766783003/diff/20001/media/blink/webmediaplayer_delegate.h#newcode28 media/blink/webmediaplayer_delegate.h:28: virtual void OnSuspend(bool must_suspend) = 0; On 2016/03/07 at ...
4 years, 9 months ago (2016-03-07 19:23:07 UTC) #9
sandersd (OOO until July 31)
https://codereview.chromium.org/1766783003/diff/20001/media/blink/webmediaplayer_impl.cc File media/blink/webmediaplayer_impl.cc (right): https://codereview.chromium.org/1766783003/diff/20001/media/blink/webmediaplayer_impl.cc#newcode366 media/blink/webmediaplayer_impl.cc:366: BackgroundPlaybackState::PLAY_FORBIDDEN_NEVER_CALLED_IN_FOREGROUND && The existence of this check isn't immediately ...
4 years, 9 months ago (2016-03-07 23:27:51 UTC) #10
DaleCurtis
PTAL. I've simplified the approach a lot and updated the CL description to match. https://codereview.chromium.org/1766783003/diff/20001/media/blink/webmediaplayer_delegate.h ...
4 years, 9 months ago (2016-03-09 02:56:14 UTC) #12
sandersd (OOO until July 31)
This is much better, thanks! lgtm https://codereview.chromium.org/1766783003/diff/40001/content/renderer/media/android/webmediaplayer_android.cc File content/renderer/media/android/webmediaplayer_android.cc (right): https://codereview.chromium.org/1766783003/diff/40001/content/renderer/media/android/webmediaplayer_android.cc#newcode1527 content/renderer/media/android/webmediaplayer_android.cc:1527: // players are ...
4 years, 9 months ago (2016-03-10 19:37:00 UTC) #13
xhwang
Looking much better! I have a few API suggestions, and a discussion on potential cleanup ...
4 years, 9 months ago (2016-03-10 21:51:06 UTC) #14
DaleCurtis
https://chromiumcodereview.appspot.com/1766783003/diff/40001/content/renderer/media/android/webmediaplayer_android.cc File content/renderer/media/android/webmediaplayer_android.cc (right): https://chromiumcodereview.appspot.com/1766783003/diff/40001/content/renderer/media/android/webmediaplayer_android.cc#newcode1527 content/renderer/media/android/webmediaplayer_android.cc:1527: // players are allowed to continue playing in the ...
4 years, 9 months ago (2016-03-10 23:11:36 UTC) #15
xhwang
LGTM with bikeshedding on API :) https://chromiumcodereview.appspot.com/1766783003/diff/40001/media/blink/webmediaplayer_delegate.h File media/blink/webmediaplayer_delegate.h (right): https://chromiumcodereview.appspot.com/1766783003/diff/40001/media/blink/webmediaplayer_delegate.h#newcode29 media/blink/webmediaplayer_delegate.h:29: virtual void OnSuspendRequested(bool ...
4 years, 9 months ago (2016-03-11 00:09:19 UTC) #16
DaleCurtis
mlamouri: Did you want to weigh in? https://chromiumcodereview.appspot.com/1766783003/diff/40001/media/blink/webmediaplayer_delegate.h File media/blink/webmediaplayer_delegate.h (right): https://chromiumcodereview.appspot.com/1766783003/diff/40001/media/blink/webmediaplayer_delegate.h#newcode29 media/blink/webmediaplayer_delegate.h:29: virtual void ...
4 years, 9 months ago (2016-03-11 00:15:13 UTC) #17
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1766783003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1766783003/60001
4 years, 9 months ago (2016-03-11 07:48:59 UTC) #19
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-11 09:20:05 UTC) #21
mlamouri (slow - plz ping)
lgtm
4 years, 9 months ago (2016-03-12 01:12:56 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1766783003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1766783003/60001
4 years, 9 months ago (2016-03-12 01:13:15 UTC) #25
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 9 months ago (2016-03-12 01:19:55 UTC) #26
commit-bot: I haz the power
4 years, 9 months ago (2016-03-12 01:21:14 UTC) #28
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/0431cbf89bc6bc50c9ad2ce0cc4ac5117e38b1d9
Cr-Commit-Position: refs/heads/master@{#380819}

Powered by Google App Engine
This is Rietveld 408576698