Commit 62c7da64 authored by Takumi Fujimoto's avatar Takumi Fujimoto Committed by Commit Bot

Destroy CastMediaNotificationProvider when MediaNotificationService shuts down

CastMediaNotificationProvider depends on MediaRouter, which is a keyed
service. So the instance held by MediaNotificationService needs to be
destroyed in Shutdown().

Change-Id: Idf522c88838f2acc4116005865379b76428bbada
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1919754Reviewed-by: default avatarTommy Steimel <steimel@chromium.org>
Commit-Queue: Takumi Fujimoto <takumif@chromium.org>
Cr-Commit-Position: refs/heads/master@{#716298}
parent 95196f5b
......@@ -310,6 +310,12 @@ void MediaNotificationService::OnContainerDraggedOut(const std::string& id,
observer.OnNotificationListChanged();
}
void MediaNotificationService::Shutdown() {
// |cast_notification_provider_| depends on MediaRouter, which is another
// keyed service.
cast_notification_provider_.reset();
}
void MediaNotificationService::OnOverlayNotificationClosed(
const std::string& id) {
// If the session has been destroyed, no action is needed.
......
......@@ -74,6 +74,9 @@ class MediaNotificationService
void OnContainerDestroyed(const std::string& id) override;
void OnContainerDraggedOut(const std::string& id, gfx::Rect bounds) override;
// KeyedService implementation.
void Shutdown() override;
// Called by the |overlay_media_notifications_manager_| when an overlay
// notification is closed.
void OnOverlayNotificationClosed(const std::string& id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment