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

Unified Diff: content/browser/media/session/media_session.cc

Issue 2429823002: Hotfix for MediaSession::OnPlayerPaused (Closed)
Patch Set: rebased Created 4 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/session/media_session.cc
diff --git a/content/browser/media/session/media_session.cc b/content/browser/media/session/media_session.cc
index f4d3c0979e38a34cf3e57e399cd5c81f9797b5c6..eedfcd1da8f63e2a3996c708d45a8c843e72e11a 100644
--- a/content/browser/media/session/media_session.cc
+++ b/content/browser/media/session/media_session.cc
@@ -168,11 +168,15 @@ void MediaSession::OnPlayerPaused(MediaSessionPlayerObserver* observer,
// Also, this method may be called when a player that is not added
// to this session (e.g. a silent video) is paused. MediaSession
// should ignore the paused player for this case.
- if (!players_.count(PlayerIdentifier(observer, player_id)))
+ if (!players_.count(PlayerIdentifier(observer, player_id)) &&
+ !pepper_players_.count(PlayerIdentifier(observer, player_id))) {
return;
+ }
- // If there is more than one observer, remove the paused one from the session.
- if (players_.size() != 1) {
+ // If the player to be removed is a pepper player, or there is more than one
+ // observer, remove the paused one from the session.
+ if (pepper_players_.count(PlayerIdentifier(observer, player_id)) ||
+ players_.size() != 1) {
RemovePlayer(observer, player_id);
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698