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

Unified Diff: media/mojo/services/mojo_renderer_impl.h

Issue 1821153004: media: Use PassInterface() in mojo media classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed 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 | « media/mojo/services/mojo_audio_decoder.cc ('k') | media/mojo/services/mojo_renderer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/mojo_renderer_impl.h
diff --git a/media/mojo/services/mojo_renderer_impl.h b/media/mojo/services/mojo_renderer_impl.h
index 85c47aaed8ad875287445744295c931fce271357..9a7bb0f92a21a7241b4f8d30c6adcf9e39e539ca 100644
--- a/media/mojo/services/mojo_renderer_impl.h
+++ b/media/mojo/services/mojo_renderer_impl.h
@@ -30,13 +30,6 @@ class DemuxerStreamProvider;
// |task_runner|*. That means all Renderer and RendererClient methods will be
// called/dispached on the |task_runner|. The only exception is GetMediaTime(),
// which can be called on any thread.
-//
-// * Threading details:
-// mojo::GetProxy() doesn't bind an InterfacePtr to a thread. Then when
-// InterfacePtr::operator->() or InterfacePtr::get() is called for the first
-// time, e.g. to call remote_renderer->Initialize(), the InterfacePtr is bound
-// the thread where the call is made.
-
class MojoRendererImpl : public Renderer, public interfaces::RendererClient {
public:
MojoRendererImpl(
@@ -84,7 +77,12 @@ class MojoRendererImpl : public Renderer, public interfaces::RendererClient {
// lifetime of |this|.
DemuxerStreamProvider* demuxer_stream_provider_;
- // Remote Renderer, bound to |task_runner_|.
+ // This class is constructed on one thread and used exclusively on another
+ // thread. This member is used to safely pass the RendererPtr from one thread
+ // to another. It is set in the constructor and is consumed in Initialize().
+ interfaces::RendererPtrInfo remote_renderer_info_;
+
+ // Remote Renderer, bound to |task_runner_| during Initialize().
interfaces::RendererPtr remote_renderer_;
// Binding for RendererClient, bound to the |task_runner_|.
« no previous file with comments | « media/mojo/services/mojo_audio_decoder.cc ('k') | media/mojo/services/mojo_renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698