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

Unified Diff: content/browser/media/session/audio_focus_manager.h

Issue 2274873003: Letting Flash join MediaSession (stack implementaion) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@media_session_type
Patch Set: fixed unduck bug Created 4 years, 4 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
Index: content/browser/media/session/audio_focus_manager.h
diff --git a/content/browser/media/session/audio_focus_manager.h b/content/browser/media/session/audio_focus_manager.h
index 6844ae767c402324872af4f787b100f3722e0222..b5a2119b11337587ea73c7534a6cb325ebdb778e 100644
--- a/content/browser/media/session/audio_focus_manager.h
+++ b/content/browser/media/session/audio_focus_manager.h
@@ -5,6 +5,7 @@
#ifndef CONTENT_BROWSER_MEDIA_SESSION_AUDIO_FOCUS_MANAGER_H_
#define CONTENT_BROWSER_MEDIA_SESSION_AUDIO_FOCUS_MANAGER_H_
+#include <list>
#include <unordered_map>
#include "base/memory/singleton.h"
@@ -60,35 +61,9 @@ class CONTENT_EXPORT AudioFocusManager {
void OnWebContentsDestroyed(WebContents* web_contents);
- // Internal usage of AbandonAudioFocus using WebContents.
- void AbandonAudioFocusInternal(WebContents* web_contents);
-
- // This method is meant to be called when a new session is of type
- // GainTransientMayDuck. If it is the first one, other clients will be asked
- // to duck.
- void MaybeStartDucking() const;
-
- // This method is meant to be called when a session is no longer of type
- // GainTransientMayDuck. If it was the last one, other clients will be asked
- // to no longer duck.
- void MaybeStopDucking() const;
-
- // Returns how many sessions require current audio focused session to duck.
- int TransientMayDuckEntriesCount() const;
-
- // Internal method to request audio focus of type AudioFocusType::Gain.
- void RequestAudioFocusGain(WebContents* web_contents);
-
- // Removes the entry associated with |web_contents| from the
- // |transient_entries_| if there is one.
- void MaybeRemoveTransientEntry(WebContents* web_contents);
-
- // Removes the focused session if it is associated with |web_contents|.
void MaybeRemoveFocusEntry(WebContents* web_contents);
- std::unordered_map<WebContents*, std::unique_ptr<AudioFocusEntry>>
- transient_entries_;
- std::unique_ptr<AudioFocusEntry> focus_entry_;
+ std::list<std::unique_ptr<AudioFocusEntry>> audio_focus_stack_;
whywhat 2016/08/30 21:09:37 nit: why not std::stack if it is a stack? why call
Zhiqiang Zhang (Slow) 2016/08/31 14:37:34 I think it is better to use an linked-list impleme
whywhat 2016/08/31 18:37:09 That's why I posted a second question. If you use
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698