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 263f937eeb2871d3f3a67b2d785bcda3f001db71..4c349f3e7596f32df50fe28c8e22cf77012a92da 100644 |
--- a/chrome/browser/media/router/presentation_service_delegate_impl.cc |
+++ b/chrome/browser/media/router/presentation_service_delegate_impl.cc |
@@ -169,7 +169,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_; |
}; |
@@ -244,8 +244,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_); |
mark a. foltz
2016/11/16 01:25:37
Side comment: If we could ensure 1 route == 1 pres
|
router_->DetachRoute(pid_route_id.second); |
+ } |
presentation_id_to_route_id_.clear(); |
url_to_sinks_observer_.clear(); |