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

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

Issue 2873983002: Add --enable-internal-media-session to trigger the MediaSession backend. (Closed)
Patch Set: rebase Created 3 years, 7 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 | « content/browser/media/session/media_session_browsertest.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/session/media_session_controllers_manager.cc
diff --git a/content/browser/media/session/media_session_controllers_manager.cc b/content/browser/media/session/media_session_controllers_manager.cc
index 79bf0f1710fdf1884ce89bbcd76af850db937aba..baad1185d844429b4049066a5460f59d13f482b1 100644
--- a/content/browser/media/session/media_session_controllers_manager.cc
+++ b/content/browser/media/session/media_session_controllers_manager.cc
@@ -12,12 +12,13 @@ namespace content {
namespace {
-bool IsDefaultMediaSessionEnabled() {
+bool IsMediaSessionEnabled() {
#if defined(OS_ANDROID)
return true;
#else
- return base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableAudioFocus);
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ return command_line->HasSwitch(switches::kEnableInternalMediaSession) ||
+ command_line->HasSwitch(switches::kEnableAudioFocus);
#endif
}
@@ -32,7 +33,7 @@ MediaSessionControllersManager::~MediaSessionControllersManager() = default;
void MediaSessionControllersManager::RenderFrameDeleted(
RenderFrameHost* render_frame_host) {
- if (!IsDefaultMediaSessionEnabled())
+ if (!IsMediaSessionEnabled())
return;
for (auto it = controllers_map_.begin(); it != controllers_map_.end();) {
@@ -48,7 +49,7 @@ bool MediaSessionControllersManager::RequestPlay(
bool has_audio,
bool is_remote,
media::MediaContentType media_content_type) {
- if (!IsDefaultMediaSessionEnabled())
+ if (!IsMediaSessionEnabled())
return true;
// Since we don't remove session instances on pause, there may be an existing
@@ -76,7 +77,7 @@ bool MediaSessionControllersManager::RequestPlay(
}
void MediaSessionControllersManager::OnPause(const MediaPlayerId& id) {
- if (!IsDefaultMediaSessionEnabled())
+ if (!IsMediaSessionEnabled())
return;
auto it = controllers_map_.find(id);
@@ -87,7 +88,7 @@ void MediaSessionControllersManager::OnPause(const MediaPlayerId& id) {
}
void MediaSessionControllersManager::OnEnd(const MediaPlayerId& id) {
- if (!IsDefaultMediaSessionEnabled())
+ if (!IsMediaSessionEnabled())
return;
controllers_map_.erase(id);
}
« no previous file with comments | « content/browser/media/session/media_session_browsertest.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698