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

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

Issue 1529063004: Pass MojoMediaClient instance to MojoMediaApplication constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added bug number Created 5 years 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_media_application.cc ('k') | media/mojo/services/mojo_media_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/mojo_media_client.h
diff --git a/media/mojo/services/mojo_media_client.h b/media/mojo/services/mojo_media_client.h
index 323d748593e68e07670f4fa3b58d542670dd1208..5d3f53af79aaa0309d772bcfda3b245bad1abaa4 100644
--- a/media/mojo/services/mojo_media_client.h
+++ b/media/mojo/services/mojo_media_client.h
@@ -26,6 +26,8 @@ class PlatformMojoMediaClient {
public:
virtual ~PlatformMojoMediaClient();
+ // Called exactly once before any other method.
+ virtual void Initialize();
// Returns the RendererFactory to be used by MojoRendererService. If returns
// null, a RendererImpl will be used with audio/video decoders provided in
// CreateAudioDecoders() and CreateVideoDecoders().
@@ -43,11 +45,12 @@ class PlatformMojoMediaClient {
class MojoMediaClient {
public:
- // Returns an instance of the MojoMediaClient object. Only one instance will
- // exist per process.
- static MojoMediaClient* Get();
+ ~MojoMediaClient();
+
+ static scoped_ptr<MojoMediaClient> Create();
// Copy of the PlatformMojoMediaClient interface.
+ void Initialize();
scoped_ptr<RendererFactory> CreateRendererFactory(
const scoped_refptr<MediaLog>& media_log);
scoped_refptr<AudioRendererSink> CreateAudioRendererSink();
@@ -57,12 +60,9 @@ class MojoMediaClient {
mojo::ServiceProvider* service_provider);
private:
- friend struct base::DefaultLazyInstanceTraits<MojoMediaClient>;
-
- MojoMediaClient();
- ~MojoMediaClient();
+ MojoMediaClient(scoped_ptr<PlatformMojoMediaClient> platform_client);
- scoped_ptr<PlatformMojoMediaClient> mojo_media_client_;
+ scoped_ptr<PlatformMojoMediaClient> platform_client_;
DISALLOW_COPY_AND_ASSIGN(MojoMediaClient);
};
« no previous file with comments | « media/mojo/services/mojo_media_application.cc ('k') | media/mojo/services/mojo_media_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698