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

Unified Diff: chromecast/browser/cast_browser_main_parts.cc

Issue 1824723003: [chromecast] Pass media task runner to VideoPlaneController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: fixed android build Created 4 years, 9 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 | « chromecast/browser/cast_browser_main_parts.h ('k') | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/browser/cast_browser_main_parts.cc
diff --git a/chromecast/browser/cast_browser_main_parts.cc b/chromecast/browser/cast_browser_main_parts.cc
index b4202898a59a35bdca35fcae6509eb4dc46d85cc..6251a345db839343ad6a20b26a4f0a46cbaa9681 100644
--- a/chromecast/browser/cast_browser_main_parts.cc
+++ b/chromecast/browser/cast_browser_main_parts.cc
@@ -251,6 +251,12 @@ CastBrowserMainParts::CastBrowserMainParts(
CastBrowserMainParts::~CastBrowserMainParts() {
}
+scoped_refptr<base::SingleThreadTaskRunner>
+CastBrowserMainParts::GetMediaTaskRunner() const {
+ // TODO(alokp): Obtain task runner from a local thread or mojo media app.
+ return media::MediaMessageLoop::GetTaskRunner();
+}
+
void CastBrowserMainParts::PreMainMessageLoopStart() {
// GroupedHistograms needs to be initialized before any threads are created
// to prevent race conditions between calls to Preregister and those threads
@@ -383,16 +389,22 @@ void CastBrowserMainParts::PreMainMessageLoopRun() {
// TODO(halliwell) move audio builds to use ozone_platform_cast, then can
// simplify this by removing DISABLE_DISPLAY condition. Should then also
// assert(ozone_platform_cast) in BUILD.gn where it depends on //ui/ozone.
+ video_plane_controller_.reset(
+ new media::VideoPlaneController(GetMediaTaskRunner()));
+ cast_browser_process_->cast_screen()->SetDisplayResizeCallback(
+ base::Bind(&media::VideoPlaneController::SetGraphicsPlaneResolution,
+ base::Unretained(video_plane_controller_.get())));
ui::OverlayManagerCast::SetOverlayCompositedCallback(
base::Bind(&media::VideoPlaneController::SetGeometry,
- base::Unretained(media::VideoPlaneController::GetInstance())));
+ base::Unretained(video_plane_controller_.get())));
#endif
cast_browser_process_->SetCastService(
cast_browser_process_->browser_client()->CreateCastService(
cast_browser_process_->browser_context(),
cast_browser_process_->pref_service(),
- url_request_context_factory_->GetSystemGetter()));
+ url_request_context_factory_->GetSystemGetter(),
+ video_plane_controller_.get()));
cast_browser_process_->cast_service()->Initialize();
// Initializing metrics service and network delegates must happen after cast
@@ -452,5 +464,12 @@ void CastBrowserMainParts::PostMainMessageLoopRun() {
#endif
}
+void CastBrowserMainParts::PostDestroyThreads() {
+ // Finalize CastMediaShlib on media thread to ensure it's not accessed
+ // after Finalize.
+ GetMediaTaskRunner()->PostTask(FROM_HERE,
+ base::Bind(&media::CastMediaShlib::Finalize));
+}
+
} // namespace shell
} // namespace chromecast
« no previous file with comments | « chromecast/browser/cast_browser_main_parts.h ('k') | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698