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

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

Issue 2471573005: [Presentation API] (5th) (1-UA) integrate controller and receiver side for 1-UA messaging (Closed)
Patch Set: call OPM.unregisterOPMController() in PresentationFrame::Reset() Created 4 years, 1 month 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 f401199a5f07ddcfd1c18b133169f25242087e4a..b1adae4f9b482f87b8656a38f4b0b50c9ae19b4c 100644
--- a/chrome/browser/media/router/presentation_service_delegate_impl.cc
+++ b/chrome/browser/media/router/presentation_service_delegate_impl.cc
@@ -174,7 +174,7 @@ class PresentationFrame {
RenderFrameHostId render_frame_host_id_;
// References to the owning WebContents, and the corresponding MediaRouter.
- const content::WebContents* web_contents_;
+ content::WebContents* web_contents_;
MediaRouter* router_;
DelegateObserver* delegate_observer_;
@@ -257,8 +257,14 @@ bool PresentationFrame::HasScreenAvailabilityListenerForTest(
}
void PresentationFrame::Reset() {
- for (const auto& pid_route_id : presentation_id_to_route_id_)
+ auto offscreen_presentation_manager = OffscreenPresentationManagerFactory::
+ GetOrCreateForControllerBrowserContext(web_contents_);
+
+ for (const auto& pid_route_id : presentation_id_to_route_id_) {
+ offscreen_presentation_manager->UnregisterOffscreenPresentationController(
+ pid_route_id.first, render_frame_host_id_);
router_->DetachRoute(pid_route_id.second);
+ }
presentation_id_to_route_id_.clear();
url_to_sinks_observer_.clear();

Powered by Google App Engine
This is Rietveld 408576698