 Chromium Code Reviews
 Chromium Code Reviews Issue 2475473002:
  Implement one-shot audio focus inside MediaSession  (Closed)
    
  
    Issue 2475473002:
  Implement one-shot audio focus inside MediaSession  (Closed) 
  | Index: content/browser/media/session/media_session_impl.h | 
| diff --git a/content/browser/media/session/media_session_impl.h b/content/browser/media/session/media_session_impl.h | 
| index 2a6d027f5e4222e12b06e93ea826f6b3d858600f..e8ee0a3d29dbac91d15435b94ac1152b743137e7 100644 | 
| --- a/content/browser/media/session/media_session_impl.h | 
| +++ b/content/browser/media/session/media_session_impl.h | 
| @@ -209,8 +209,8 @@ class MediaSessionImpl : public MediaSession, | 
| // delegate to abandon the audio focus. | 
| CONTENT_EXPORT void AbandonSystemAudioFocusIfNeeded(); | 
| - // Notifies WebContents about the state change of the media session. | 
| - void UpdateWebContents(); | 
| + // Notifies observers about the state change of the media session. | 
| + void DispatchStateChange(); | 
| 
whywhat
2016/11/03 14:32:17
nit: you could call it NotifyObserversAboutStateCh
 
Zhiqiang Zhang (Slow)
2016/11/04 14:10:54
Done.
 | 
| // Internal method that should be used instead of setting audio_focus_state_. | 
| // It sets audio_focus_state_ and notifies observers about the state change. | 
| @@ -231,9 +231,13 @@ class MediaSessionImpl : public MediaSession, | 
| CONTENT_EXPORT bool AddPepperPlayer(MediaSessionPlayerObserver* observer, | 
| int player_id); | 
| + CONTENT_EXPORT bool AddOneShotPlayer(MediaSessionPlayerObserver* observer, | 
| + int player_id); | 
| + | 
| std::unique_ptr<AudioFocusDelegate> delegate_; | 
| PlayersMap players_; | 
| 
whywhat
2016/11/03 14:32:17
nit: perhaps we should rename players_ into normal
 
Zhiqiang Zhang (Slow)
2016/11/04 14:10:54
Done.
 | 
| PlayersMap pepper_players_; | 
| + PlayersMap one_shot_players_; | 
| State audio_focus_state_; | 
| MediaSession::SuspendType suspend_type_; |