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

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

Issue 2585243002: [MediaSession] A fix for MediaSessionService routing (Closed)
Patch Set: fixed compile warning Created 4 years 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 | content/browser/media/session/media_session_impl_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/session/media_session_impl.cc
diff --git a/content/browser/media/session/media_session_impl.cc b/content/browser/media/session/media_session_impl.cc
index e405b13ff2f9d1a1fab87af629b7c143f6964575..136c0ed0e53fcdfd3b319f5b7e44adc8c4414c4f 100644
--- a/content/browser/media/session/media_session_impl.cc
+++ b/content/browser/media/session/media_session_impl.cc
@@ -575,6 +575,7 @@ bool MediaSessionImpl::AddOneShotPlayer(MediaSessionPlayerObserver* observer,
void MediaSessionImpl::OnServiceCreated(MediaSessionServiceImpl* service) {
services_[service->GetRenderFrameHost()] = service;
+ UpdateRoutedService();
}
void MediaSessionImpl::OnServiceDestroyed(MediaSessionServiceImpl* service) {
@@ -617,11 +618,7 @@ void MediaSessionImpl::DidReceiveAction(
}
bool MediaSessionImpl::IsServiceActiveForRenderFrameHost(RenderFrameHost* rfh) {
- if (!services_.count(rfh))
- return false;
-
- return services_[rfh]->metadata().has_value() ||
- !services_[rfh]->actions().empty();
+ return services_.find(rfh) != services_.end();
}
void MediaSessionImpl::UpdateRoutedService() {
« no previous file with comments | « no previous file | content/browser/media/session/media_session_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698