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

Unified Diff: content/renderer/media/media_factory.cc

Issue 2913153004: Fix MediaRemoting MediaObserver (Closed)
Patch Set: Add DCHECK Created 3 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_factory.cc
diff --git a/content/renderer/media/media_factory.cc b/content/renderer/media/media_factory.cc
index efeba89bc79c54e629737d969dab9764b1e6a27b..c6839cefa16abf2b14c7d463fa7280f6c49d0694 100644
--- a/content/renderer/media/media_factory.cc
+++ b/content/renderer/media/media_factory.cc
@@ -216,6 +216,10 @@ blink::WebMediaPlayer* MediaFactory::CreateMediaPlayer(
CreateRendererFactorySelector(media_log.get(), use_media_player_renderer,
GetDecoderFactory(), &media_observer);
+#if BUILDFLAG(ENABLE_MEDIA_REMOTING)
+ DCHECK(media_observer);
+#endif
+
if (!url_index_.get() || url_index_->frame() != web_frame)
url_index_.reset(new media::UrlIndex(web_frame));
@@ -349,8 +353,7 @@ MediaFactory::CreateRendererFactorySelector(
std::unique_ptr<RemotingController> remoting_controller(
new RemotingController(new media::remoting::SharedSession(
std::move(remoting_source_request), std::move(remoter))));
- base::WeakPtr<media::MediaObserver> media_observer =
- remoting_controller->GetWeakPtr();
+ *out_media_observer = remoting_controller->GetWeakPtr();
auto courier_factory =
base::MakeUnique<media::remoting::CourierRendererFactory>(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698