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