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

Issue 1830913005: Convert WMPI state management to level-triggered. (Closed)

Created:
4 years, 9 months ago by sandersd (OOO until July 31)
Modified:
4 years, 8 months ago
Reviewers:
watk, DaleCurtis
CC:
chromium-reviews, feature-media-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Convert WMPI state management to level-triggered. Calling NotifyPlaybackStarted()/NotifyPlaybackPaused() at the correct times has been a recurring source of bugs. This change moves all of the logic to a single method, which will hopefully be easier to understand and debug. This new method handles delegate state, suspend/resume, and the memory usage reporting timer together in one place. It's not simple, but it is commented liberally. The new suspend/resume logic does not rely on the suspend/resume callbacks (instead it's only based on the goal state, never the current state). As a result I was also able to remove the resume callback from PipelineController in this CL. BUG=595900, 597692 Committed: https://crrev.com/50a635ebbf250f8f35ea060d564b102b804dcea7 Cr-Commit-Position: refs/heads/master@{#385038}

Patch Set 1 #

Patch Set 2 : Remove resumed callback. #

Patch Set 3 : Fix grammar. #

Total comments: 2

Patch Set 4 : Do not throw away the media session immediately on ended. #

Patch Set 5 : Further reduce reliance on |ended_|. #

Total comments: 18

Patch Set 6 : #

Total comments: 2

Patch Set 7 : Contain dependencies better for testing. #

Patch Set 8 : Tests #

Total comments: 12

Patch Set 9 : #

Total comments: 2

Patch Set 10 : Rebase. #

Patch Set 11 : Use EXPECT_TRUE/EXPECT_FALSE. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+456 lines, -223 lines) Patch
M media/blink/webmediaplayer_impl.h View 1 2 3 4 5 6 7 8 9 3 chunks +53 lines, -9 lines 0 comments Download
M media/blink/webmediaplayer_impl.cc View 1 2 3 4 5 6 7 8 9 25 chunks +200 lines, -176 lines 0 comments Download
M media/blink/webmediaplayer_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +189 lines, -0 lines 0 comments Download
M media/filters/pipeline_controller.h View 1 2 3 4 5 6 5 chunks +4 lines, -11 lines 0 comments Download
M media/filters/pipeline_controller.cc View 1 2 3 4 5 6 3 chunks +7 lines, -14 lines 0 comments Download
M media/filters/pipeline_controller_unittest.cc View 1 2 3 4 5 6 9 chunks +3 lines, -13 lines 0 comments Download

Messages

Total messages: 42 (19 generated)
sandersd (OOO until July 31)
4 years, 9 months ago (2016-03-25 22:59:02 UTC) #10
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1830913005/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1830913005/100001
4 years, 9 months ago (2016-03-25 23:11:07 UTC) #12
DaleCurtis
Nice work! Can you add a test for this? The logic is fairly complicated. It ...
4 years, 9 months ago (2016-03-25 23:21:23 UTC) #13
sandersd (OOO until July 31)
On 2016/03/25 23:21:23, DaleCurtis wrote: > Nice work! Can you add a test for this? ...
4 years, 9 months ago (2016-03-25 23:42:33 UTC) #14
sandersd (OOO until July 31)
https://codereview.chromium.org/1830913005/diff/100001/media/blink/webmediaplayer_impl.h File media/blink/webmediaplayer_impl.h (right): https://codereview.chromium.org/1830913005/diff/100001/media/blink/webmediaplayer_impl.h#newcode200 media/blink/webmediaplayer_impl.h:200: // TODO(sandersd): This should move into WebMediaPlayerDelegate. On 2016/03/25 ...
4 years, 9 months ago (2016-03-25 23:42:42 UTC) #15
DaleCurtis
Awesome cleanup! Did you give any though to putting this into a standalone helper class? ...
4 years, 9 months ago (2016-03-26 01:12:55 UTC) #17
sandersd (OOO until July 31)
https://codereview.chromium.org/1830913005/diff/140001/media/blink/webmediaplayer_impl.cc File media/blink/webmediaplayer_impl.cc (left): https://codereview.chromium.org/1830913005/diff/140001/media/blink/webmediaplayer_impl.cc#oldcode1118 media/blink/webmediaplayer_impl.cc:1118: pending_suspend_resume_cycle_ = false; On 2016/03/26 01:12:55, DaleCurtis wrote: > ...
4 years, 8 months ago (2016-03-28 21:31:59 UTC) #18
sandersd (OOO until July 31)
On 2016/03/26 01:12:55, DaleCurtis wrote: > Awesome cleanup! Did you give any though to putting ...
4 years, 8 months ago (2016-03-28 21:35:28 UTC) #19
watk
This is really nice. https://codereview.chromium.org/1830913005/diff/140001/media/blink/webmediaplayer_impl.cc File media/blink/webmediaplayer_impl.cc (right): https://codereview.chromium.org/1830913005/diff/140001/media/blink/webmediaplayer_impl.cc#newcode1439 media/blink/webmediaplayer_impl.cc:1439: // similer, but excludes idle ...
4 years, 8 months ago (2016-03-29 00:47:54 UTC) #20
sandersd (OOO until July 31)
https://codereview.chromium.org/1830913005/diff/140001/media/blink/webmediaplayer_impl.cc File media/blink/webmediaplayer_impl.cc (right): https://codereview.chromium.org/1830913005/diff/140001/media/blink/webmediaplayer_impl.cc#newcode1439 media/blink/webmediaplayer_impl.cc:1439: // similer, but excludes idle suspension, because in the ...
4 years, 8 months ago (2016-03-30 23:46:00 UTC) #21
sandersd (OOO until July 31)
And now with tests. PTAL.
4 years, 8 months ago (2016-03-31 20:16:46 UTC) #22
DaleCurtis
https://codereview.chromium.org/1830913005/diff/200001/media/blink/webmediaplayer_impl.cc File media/blink/webmediaplayer_impl.cc (left): https://codereview.chromium.org/1830913005/diff/200001/media/blink/webmediaplayer_impl.cc#oldcode1154 media/blink/webmediaplayer_impl.cc:1154: #if defined(OS_MACOSX) This was dropped. https://codereview.chromium.org/1830913005/diff/200001/media/blink/webmediaplayer_impl.cc File media/blink/webmediaplayer_impl.cc (right): ...
4 years, 8 months ago (2016-04-01 18:25:48 UTC) #23
sandersd (OOO until July 31)
https://codereview.chromium.org/1830913005/diff/200001/media/blink/webmediaplayer_impl.cc File media/blink/webmediaplayer_impl.cc (left): https://codereview.chromium.org/1830913005/diff/200001/media/blink/webmediaplayer_impl.cc#oldcode1154 media/blink/webmediaplayer_impl.cc:1154: #if defined(OS_MACOSX) On 2016/04/01 18:25:48, DaleCurtis wrote: > This ...
4 years, 8 months ago (2016-04-01 21:22:11 UTC) #24
DaleCurtis
lgtm
4 years, 8 months ago (2016-04-01 22:51:32 UTC) #25
watk
lgtm https://codereview.chromium.org/1830913005/diff/220001/media/blink/webmediaplayer_impl_unittest.cc File media/blink/webmediaplayer_impl_unittest.cc (right): https://codereview.chromium.org/1830913005/diff/220001/media/blink/webmediaplayer_impl_unittest.cc#newcode202 media/blink/webmediaplayer_impl_unittest.cc:202: EXPECT_EQ(WebMediaPlayerImpl::DelegateState::GONE, state.delegate_state); All these WebMediaPlayerImpls only add noise. ...
4 years, 8 months ago (2016-04-02 00:12:53 UTC) #26
sandersd (OOO until July 31)
https://codereview.chromium.org/1830913005/diff/220001/media/blink/webmediaplayer_impl_unittest.cc File media/blink/webmediaplayer_impl_unittest.cc (right): https://codereview.chromium.org/1830913005/diff/220001/media/blink/webmediaplayer_impl_unittest.cc#newcode202 media/blink/webmediaplayer_impl_unittest.cc:202: EXPECT_EQ(WebMediaPlayerImpl::DelegateState::GONE, state.delegate_state); On 2016/04/02 00:12:53, watk wrote: > All ...
4 years, 8 months ago (2016-04-04 19:47:37 UTC) #27
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1830913005/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1830913005/220001
4 years, 8 months ago (2016-04-04 19:48:38 UTC) #29
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_chromium_gn_compile_dbg on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_chromium_gn_compile_dbg/builds/45184)
4 years, 8 months ago (2016-04-04 20:36:48 UTC) #31
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1830913005/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1830913005/260001
4 years, 8 months ago (2016-04-04 20:59:11 UTC) #33
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-04 22:15:30 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1830913005/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1830913005/260001
4 years, 8 months ago (2016-04-04 22:44:21 UTC) #38
commit-bot: I haz the power
Committed patchset #11 (id:260001)
4 years, 8 months ago (2016-04-04 22:50:18 UTC) #40
commit-bot: I haz the power
4 years, 8 months ago (2016-04-04 22:52:01 UTC) #42
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/50a635ebbf250f8f35ea060d564b102b804dcea7
Cr-Commit-Position: refs/heads/master@{#385038}

Powered by Google App Engine
This is Rietveld 408576698