| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROMECAST_BROWSER_MEDIA_CAST_MOJO_MEDIA_APPLICATION_H_ |
| 6 #define CHROMECAST_BROWSER_MEDIA_CAST_MOJO_MEDIA_APPLICATION_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "media/mojo/interfaces/service_factory.mojom.h" |
| 11 #include "mojo/shell/public/cpp/interface_factory.h" |
| 12 #include "mojo/shell/public/cpp/message_loop_ref.h" |
| 13 #include "mojo/shell/public/cpp/shell_client.h" |
| 14 |
| 15 namespace base { |
| 16 class SingleThreadTaskRunner; |
| 17 } // namespace base |
| 18 |
| 19 namespace media { |
| 20 class MediaLog; |
| 21 } // namespace media |
| 22 |
| 23 namespace chromecast { |
| 24 namespace media { |
| 25 |
| 26 class CastMojoMediaClient; |
| 27 |
| 28 class CastMojoMediaApplication |
| 29 : public mojo::ShellClient, |
| 30 public mojo::InterfaceFactory<::media::interfaces::ServiceFactory> { |
| 31 public: |
| 32 CastMojoMediaApplication( |
| 33 scoped_ptr<CastMojoMediaClient> mojo_media_client, |
| 34 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner); |
| 35 ~CastMojoMediaApplication() final; |
| 36 |
| 37 private: |
| 38 // mojo::ShellClient implementation. |
| 39 void Initialize(mojo::Connector* connector, |
| 40 const mojo::Identity& identity, |
| 41 uint32_t id) final; |
| 42 bool AcceptConnection(mojo::Connection* connection) final; |
| 43 |
| 44 // mojo::InterfaceFactory<interfaces::ServiceFactory> implementation. |
| 45 void Create(mojo::Connection* connection, |
| 46 mojo::InterfaceRequest<::media::interfaces::ServiceFactory> |
| 47 request) final; |
| 48 |
| 49 scoped_ptr<CastMojoMediaClient> mojo_media_client_; |
| 50 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; |
| 51 scoped_refptr<::media::MediaLog> media_log_; |
| 52 mojo::MessageLoopRefFactory ref_factory_; |
| 53 }; |
| 54 |
| 55 } // namespace media |
| 56 } // namespace chromecast |
| 57 |
| 58 #endif // CHROMECAST_BROWSER_MEDIA_CAST_MOJO_MEDIA_APPLICATION_H_ |
| OLD | NEW |