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

Unified Diff: chrome/browser/media/router/presentation_service_delegate_impl.cc

Issue 2731043002: [Media Router] Add a presentation id to MediaRoute mapping in the MR (Closed)
Patch Set: Created 3 years, 10 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: chrome/browser/media/router/presentation_service_delegate_impl.cc
diff --git a/chrome/browser/media/router/presentation_service_delegate_impl.cc b/chrome/browser/media/router/presentation_service_delegate_impl.cc
index 2cd8f5054c9af2c1cc13e1c7fec1623d186e01a7..4c5a12c69468b63b374f14309aaa479562eb4e4f 100644
--- a/chrome/browser/media/router/presentation_service_delegate_impl.cc
+++ b/chrome/browser/media/router/presentation_service_delegate_impl.cc
@@ -213,6 +213,7 @@ void PresentationFrame::OnPresentationSessionStarted(
const MediaRoute& route) {
presentation_id_to_route_.insert(
std::make_pair(session.presentation_id, route));
+ router_->RegisterPresentationRoute(session.presentation_id, route);
}
const MediaRoute::Id PresentationFrame::GetRouteId(
@@ -270,6 +271,7 @@ void PresentationFrame::Reset() {
pid_route.first, render_frame_host_id_);
}
router_->DetachRoute(pid_route.second.media_route_id());
+ router_->UnregisterPresentationRoute(pid_route.first);
}
presentation_id_to_route_.clear();
@@ -284,6 +286,8 @@ void PresentationFrame::RemoveConnection(const std::string& presentation_id,
// Remove the presentation id mapping so a later call to Reset is a no-op.
presentation_id_to_route_.erase(presentation_id);
+ router_->UnregisterPresentationRoute(presentation_id);
+
// We no longer need to observe route messages.
session_messages_observers_.erase(route_id);

Powered by Google App Engine
This is Rietveld 408576698