New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 595900 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

OnPipelineResumed() should be reentrancy-safe.

Project Member Reported by sande...@chromium.org, Mar 17 2016

Issue description

OnPipelineSuspended() and OnPipelineResumed() are special-purpose callbacks with lifecycle guarantees that are rather different from other PipelineController methods. WMPI should not rely on them except for their intended purpose (which is for displaying the 'now casting' frame, and implementing restart-for-fullscreen).

Instead, NotifyPlaybackStarted() and NotifyPlaybackPaused() should be modified to always be safe to call (including repeatedly), and they should be called at the same time as Suspend()/Resume().
 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 4 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/50a635ebbf250f8f35ea060d564b102b804dcea7

commit 50a635ebbf250f8f35ea060d564b102b804dcea7
Author: sandersd <sandersd@chromium.org>
Date: Mon Apr 04 22:50:09 2016

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 

Review URL: https://codereview.chromium.org/1830913005

Cr-Commit-Position: refs/heads/master@{#385038}

[modify] https://crrev.com/50a635ebbf250f8f35ea060d564b102b804dcea7/media/blink/webmediaplayer_impl.cc
[modify] https://crrev.com/50a635ebbf250f8f35ea060d564b102b804dcea7/media/blink/webmediaplayer_impl.h
[modify] https://crrev.com/50a635ebbf250f8f35ea060d564b102b804dcea7/media/blink/webmediaplayer_impl_unittest.cc
[modify] https://crrev.com/50a635ebbf250f8f35ea060d564b102b804dcea7/media/filters/pipeline_controller.cc
[modify] https://crrev.com/50a635ebbf250f8f35ea060d564b102b804dcea7/media/filters/pipeline_controller.h
[modify] https://crrev.com/50a635ebbf250f8f35ea060d564b102b804dcea7/media/filters/pipeline_controller_unittest.cc

Labels: Hotlist-CodeHealth
Project Member

Comment 3 by sheriffbot@chromium.org, Apr 17 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been available for more than 365 days, and should be re-evaluated. Please re-triage this issue.
The Hotlist-Recharge-Cold label is applied for tracking purposes, and should not be removed after re-triaging the issue.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)
Project Member

Comment 5 by sheriffbot@chromium.org, Apr 20 2018

Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: WontFix (was: Untriaged)
I disagree and think we'll always need these on suspend / on resume method.
If that's true, then we should design a better mechanism. The suspended/resumed callbacks are vulnerable to re-entrancy bugs in a way that the other callbacks are not.
Status: Available (was: WontFix)
Summary: OnPipelineResumed() should be reentrancy-safe. (was: WMPI should not rely on OnPipelineResumed() to notify the delegate)
Re-opening with new description.

It is not safe to call PipelineController methods from OnPipelineSuspended, OnBeforePipelineResumed, or OnPipelineResumed. Since it's easy for reviewers to miss changes that violate this rule, a safer mechanism should be designed.

Sign in to add a comment