| 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> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "media/mojo/interfaces/service_factory.mojom.h" | 11 #include "media/mojo/interfaces/service_factory.mojom.h" |
| 12 #include "services/shell/public/cpp/interface_factory.h" | 12 #include "services/shell/public/cpp/interface_factory.h" |
| 13 #include "services/shell/public/cpp/message_loop_ref.h" | 13 #include "services/shell/public/cpp/message_loop_ref.h" |
| 14 #include "services/shell/public/cpp/shell_client.h" | 14 #include "services/shell/public/cpp/shell_client.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class SingleThreadTaskRunner; | 17 class SingleThreadTaskRunner; |
| 18 } // namespace base | 18 } // namespace base |
| 19 | 19 |
| 20 namespace media { | 20 namespace media { |
| 21 class MediaLog; | 21 class MediaLog; |
| 22 } // namespace media | 22 } // namespace media |
| 23 | 23 |
| 24 namespace chromecast { | 24 namespace chromecast { |
| 25 namespace media { | 25 namespace media { |
| 26 | 26 |
| 27 class CastMojoMediaClient; | 27 class CastMojoMediaClient; |
| 28 | 28 |
| 29 class CastMojoMediaApplication | 29 class CastMojoMediaApplication |
| 30 : public mojo::ShellClient, | 30 : public shell::ShellClient, |
| 31 public mojo::InterfaceFactory<::media::interfaces::ServiceFactory> { | 31 public shell::InterfaceFactory<::media::interfaces::ServiceFactory> { |
| 32 public: | 32 public: |
| 33 CastMojoMediaApplication( | 33 CastMojoMediaApplication( |
| 34 std::unique_ptr<CastMojoMediaClient> mojo_media_client, | 34 std::unique_ptr<CastMojoMediaClient> mojo_media_client, |
| 35 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner); | 35 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner); |
| 36 ~CastMojoMediaApplication() final; | 36 ~CastMojoMediaApplication() final; |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 // mojo::ShellClient implementation. | 39 // shell::ShellClient implementation. |
| 40 void Initialize(mojo::Connector* connector, | 40 void Initialize(shell::Connector* connector, |
| 41 const mojo::Identity& identity, | 41 const shell::Identity& identity, |
| 42 uint32_t id) final; | 42 uint32_t id) final; |
| 43 bool AcceptConnection(mojo::Connection* connection) final; | 43 bool AcceptConnection(shell::Connection* connection) final; |
| 44 | 44 |
| 45 // mojo::InterfaceFactory<interfaces::ServiceFactory> implementation. | 45 // shell::InterfaceFactory<interfaces::ServiceFactory> implementation. |
| 46 void Create(mojo::Connection* connection, | 46 void Create(shell::Connection* connection, |
| 47 mojo::InterfaceRequest<::media::interfaces::ServiceFactory> | 47 mojo::InterfaceRequest<::media::interfaces::ServiceFactory> |
| 48 request) final; | 48 request) final; |
| 49 | 49 |
| 50 std::unique_ptr<CastMojoMediaClient> mojo_media_client_; | 50 std::unique_ptr<CastMojoMediaClient> mojo_media_client_; |
| 51 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; | 51 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; |
| 52 scoped_refptr<::media::MediaLog> media_log_; | 52 scoped_refptr<::media::MediaLog> media_log_; |
| 53 mojo::MessageLoopRefFactory ref_factory_; | 53 shell::MessageLoopRefFactory ref_factory_; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 } // namespace media | 56 } // namespace media |
| 57 } // namespace chromecast | 57 } // namespace chromecast |
| 58 | 58 |
| 59 #endif // CHROMECAST_BROWSER_MEDIA_CAST_MOJO_MEDIA_APPLICATION_H_ | 59 #endif // CHROMECAST_BROWSER_MEDIA_CAST_MOJO_MEDIA_APPLICATION_H_ |
| OLD | NEW |