Index: chrome/browser/media/router/offscreen_presentation_manager.cc |
diff --git a/chrome/browser/media/router/offscreen_presentation_manager.cc b/chrome/browser/media/router/offscreen_presentation_manager.cc |
index 1cb996ae22ef9a20c4cc34ed23629e3f353fd172..abd5cd37f3488dbd2b25bf0fddfd48657bd84d00 100644 |
--- a/chrome/browser/media/router/offscreen_presentation_manager.cc |
+++ b/chrome/browser/media/router/offscreen_presentation_manager.cc |
@@ -61,9 +61,11 @@ void OffscreenPresentationManager::UnregisterOffscreenPresentationController( |
// Remove presentation if no controller and receiver. |
it->second->UnregisterController(render_frame_host_id); |
- if (it->second->pending_controllers_.size() == 0 && |
- it->second->receiver_callback_.is_null()) |
+ if (!it->second->IsValid()) { |
+ DLOG(WARNING) << __func__ << " no receiver callback has been registered to " |
+ << "[presentation_id]: " << presentation_id; |
offscreen_presentations_.erase(presentation_id); |
+ } |
} |
void OffscreenPresentationManager::OnOffscreenPresentationReceiverCreated( |